PageSourceSearch

https://hobsbawm-historicalgame.manus.space/assets/index-TmXHDwAR.js

js hobsbawm-historicalgame.manus.space collected 2026-10-03 05:02:24 UTC 1,368,968 bytes, 163 lines download raw bytes

vendor: 11,666 bytes, lines 1-26
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dds-BtJrYueF.js","assets/dds.pure-B9YwPKkm.js","assets/cubemapToSphericalPolynomial-Bzo7b1SQ.js","assets/ddsTextureLoader-C2f_Crk_.js","assets/envTextureLoader-C3v1GqL8.js"])))=>i.map(i=>d[i]);
2(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();function zx(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Nf={exports:{}},Zo={};/**
3 * @license React
4 * react-jsx-runtime.production.js
5 *
6 * Copyright (c) Meta Platforms, Inc. and affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var ey;function wA(){if(ey)return Zo;ey=1;var a=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var c in s)c!=="key"&&(r[c]=s[c])}else r=s;return s=r.ref,{$$typeof:a,type:i,key:o,ref:s!==void 0?s:null,props:r}}return Zo.Fragment=e,Zo.jsx=t,Zo.jsxs=t,Zo}var ty;function PA(){return ty||(ty=1,Nf.exports=wA()),Nf.exports}var ne=PA(),zf={exports:{}},Qo={},Vf={exports:{}},Gf={};/**
11 * @license React
12 * scheduler.production.js
13 *
14 * Copyright (c) Meta Platforms, Inc. and affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var iy;function OA(){return iy||(iy=1,(function(a){function e(z,X){var q=z.length;z.push(X);e:for(;0<q;){var G=q-1>>>1,j=z[G];if(0<s(j,X))z[G]=X,z[q]=j,q=G;else break e}}function t(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var X=z[0],q=z.pop();if(q!==X){z[0]=q;e:for(var G=0,j=z.length,w=j>>>1;G<w;){var O=2*(G+1)-1,U=z[O],W=O+1,oe=z[W];if(0>s(U,q))W<j&&0>s(oe,U)?(z[G]=oe,z[W]=q,G=W):(z[G]=U,z[O]=q,G=O);else if(W<j&&0>s(oe,q))z[G]=oe,z[W]=q,G=W;else break e}}return X}function s(z,X){var q=z.sortIndex-X.sortIndex;return q!==0?q:z.id-X.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;a.unstable_now=function(){return r.now()}}else{var o=Date,c=o.now();a.unstable_now=function(){return o.now()-c}}var h=[],f=[],_=1,d=null,g=3,p=!1,x=!1,b=!1,T=!1,R=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function I(z){for(var X=t(f);X!==null;){if(X.callback===null)i(f);else if(X.startTime<=z)i(f),X.sortIndex=X.expirationTime,e(h,X);else break;X=t(f)}}function A(z){if(b=!1,I(z),!x)if(t(h)!==null)x=!0,D||(D=!0,te());else{var X=t(f);X!==null&&$(A,X.startTime-z)}}var D=!1,C=-1,k=5,H=-1;function L(){return T?!0:!(a.unstable_now()-H<k)}function J(){if(T=!1,D){var z=a.unstable_now();H=z;var X=!0;try{e:{x=!1,b&&(b=!1,S(C),C=-1),p=!0;var q=g;try{t:{for(I(z),d=t(h);d!==null&&!(d.expirationTime>z&&L());){var G=d.callback;if(typeof G=="function"){d.callback=null,g=d.priorityLevel;var j=G(d.expirationTime<=z);if(z=a.unstable_now(),typeof j=="function"){d.callback=j,I(z),X=!0;break t}d===t(h)&&i(h),I(z)}else i(h);d=t(h)}if(d!==null)X=!0;else{var w=t(f);w!==null&&$(A,w.startTime-z),X=!1}}break e}finally{d=null,g=q,p=!1}X=void 0}}finally{X?te():D=!1}}}var te;if(typeof M=="function")te=function(){M(J)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,B=ae.port2;ae.port1.onmessage=J,te=function(){B.postMessage(null)}}else te=function(){R(J,0)};function $(z,X){C=R(function(){z(a.unstable_now())},X)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(z){z.callback=null},a.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<z?Math.floor(1e3/z):5},a.unstable_getCurrentPriorityLevel=function(){return g},a.unstable_next=function(z){switch(g){case 1:case 2:case 3:var X=3;break;default:X=g}var q=g;g=X;try{return z()}finally{g=q}},a.unstable_requestPaint=function(){T=!0},a.unstable_runWithPriority=function(z,X){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var q=g;g=z;try{return X()}finally{g=q}},a.unstable_scheduleCallback=function(z,X,q){var G=a.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?G+q:G):q=G,z){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=q+j,z={id:_++,callback:X,priorityLevel:z,startTime:q,expirationTime:j,sortIndex:-1},q>G?(z.sortIndex=q,e(f,z),t(h)===null&&z===t(f)&&(b?(S(C),C=-1):b=!0,$(A,q-G))):(z.sortIndex=j,e(h,z),x||p||(x=!0,D||(D=!0,te()))),z},a.unstable_shouldYield=L,a.unstable_wrapCallback=function(z){var X=g;return function(){var q=g;g=X;try{return z.apply(this,arguments)}finally{g=q}}}})(Gf)),Gf}var sy;function FA(){return sy||(sy=1,Vf.exports=OA()),Vf.exports}var Hf={exports:{}},gt={};/**
19 * @license React
20 * react.production.js
21 *
22 * Copyright (c) Meta Platforms, Inc. and affiliates.
23 *
24 * This source code is licensed under the MIT license found in the
25 * LICENSE file in the root directory of this source tree.
26 */var ny;function BA(){if(ny)return gt;ny=1;var a=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),g=Symbol.iterator;function p(w){return w===null||typeof w!="object"?null:(w=g&&w[g]||w["@@iterator"],typeof w=="function"?w:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,T={};function R(w,O,U){this.props=w,this.context=O,this.refs=T,this.updater=U||x}R.prototype.isReactComponent={},R.prototype.setState=function(w,O){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,O,"setState")},R.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function S(){}S.prototype=R.prototype;function M(w,O,U){this.props=w,this.context=O,this.refs=T,this.updater=U||x}var I=M.prototype=new S;I.constructor=M,b(I,R.prototype),I.isPureReactComponent=!0;var A=Array.isArray;function D(){}var C={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function H(w,O,U){var W=U.ref;return{$$typeof:a,type:w,key:O,ref:W!==void 0?W:null,props:U}}function L(w,O){return H(w.type,O,w.props)}function J(w){return typeof w=="object"&&w!==null&&w.$$typeof===a}function te(w){var O={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(U){return O[U]})}var ae=/\/+/g;function B(w,O){return typeof w=="object"&&w!==null&&w.key!=null?te(""+w.key):O.toString(36)}function $(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(D,D):(w.status="pending",w.then(function(O){w.status==="pending"&&(w.status="fulfilled",w.value=O)},function(O){w.status==="pending"&&(w.status="rejected",w.reason=O)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function z(w,O,U,W,oe){var le=typeof w;(le==="undefined"||le==="boolean")&&(w=null);var be=!1;if(w===null)be=!0;else switch(le){case"bigint":case"string":case"number":be=!0;break;case"object":switch(w.$$typeof){case a:case e:be=!0;break;case _:return be=w._init,z(be(w._payload),O,U,W,oe)}}if(be)return oe=oe(w),be=W===""?"."+B(w,0):W,A(oe)?(U="",be!=null&&(U=be.replace(ae,"$&/")+"/"),z(oe,O,U,"",function(Y){return Y})):oe!=null&&(J(oe)&&(oe=L(oe,U+(oe.key==null||w&&w.key===oe.key?"":(""+oe.key).replace(ae,"$&/")+"/")+be)),O.push(oe)),1;be=0;var Ee=W===""?".":W+":";if(A(w))for(var Fe=0;Fe<w.length;Fe++)W=w[Fe],le=Ee+B(W,Fe),be+=z(W,O,U,le,oe);else if(Fe=p(w),typeof Fe=="function")for(w=Fe.call(w),Fe=0;!(W=w.next()).done;)W=W.value,le=Ee+B(W,Fe++),be+=z(W,O,U,le,oe);else if(le==="object"){if(typeof w.then=="function")return z($(w),O,U,W,oe);throw O=String(w),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return be}function X(w,O,U){if(w==null)return w;var W=[],oe=0;return z(w,W,"","",function(le){return O.call(U,le,oe++)}),W}function q(w){if(w._status===-1){var O=w._result;O=O(),O.then(function(U){(w._status===0||w._status===-1)&&(w._status=1,w._result=U)},function(U){(w._status===0||w._status===-1)&&(w._status=2,w._result=U)}),w._status===-1&&(w._status=0,w._result=O)}if(w._status===1)return w._result.default;throw w._result}var G=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},j={map:X,forEach:function(w,O,U){X(w,function(){O.apply(this,arguments)},U)},count:function(w){var O=0;return X(w,function(){O++}),O},toArray:function(w){return X(w,function(O){return O})||[]},only:function(w){if(!J(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return gt.Activity=d,gt.Children=j,gt.Component=R,gt.Fragment=t,gt.Profiler=s,gt.PureComponent=M,gt.StrictMode=i,gt.Suspense=h,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,gt.__COMPILER_RUNTIME={__proto__:null,c:function(w){return C.H.useMemoCache(w)}},gt.cache=function(w){return function(){return w.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(w,O,U){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var W=b({},w.props),oe=w.key;if(O!=null)for(le in O.key!==void 0&&(oe=""+O.key),O)!k.call(O,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&O.ref===void 0||(W[le]=O[le]);var le=arguments.length-2;if(le===1)W.children=U;else if(1<le){for(var be=Array(le),Ee=0;Ee<le;Ee++)be[Ee]=arguments[Ee+2];W.children=be}return H(w.type,oe,W)},gt.createContext=function(w){return w={$$typeof:o,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:r,_context:w},w},gt.createElement=function(w,O,U){var W,oe={},le=null;if(O!=null)for(W in O.key!==void 0&&(le=""+O.key),O)k.call(O,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(
vendor: 11,067 bytes, lines 26-44
26oe[W]=O[W]);var be=arguments.length-2;if(be===1)oe.children=U;else if(1<be){for(var Ee=Array(be),Fe=0;Fe<be;Fe++)Ee[Fe]=arguments[Fe+2];oe.children=Ee}if(w&&w.defaultProps)for(W in be=w.defaultProps,be)oe[W]===void 0&&(oe[W]=be[W]);return H(w,le,oe)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(w){return{$$typeof:c,render:w}},gt.isValidElement=J,gt.lazy=function(w){return{$$typeof:_,_payload:{_status:-1,_result:w},_init:q}},gt.memo=function(w,O){return{$$typeof:f,type:w,compare:O===void 0?null:O}},gt.startTransition=function(w){var O=C.T,U={};C.T=U;try{var W=w(),oe=C.S;oe!==null&&oe(U,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(D,G)}catch(le){G(le)}finally{O!==null&&U.types!==null&&(O.types=U.types),C.T=O}},gt.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},gt.use=function(w){return C.H.use(w)},gt.useActionState=function(w,O,U){return C.H.useActionState(w,O,U)},gt.useCallback=function(w,O){return C.H.useCallback(w,O)},gt.useContext=function(w){return C.H.useContext(w)},gt.useDebugValue=function(){},gt.useDeferredValue=function(w,O){return C.H.useDeferredValue(w,O)},gt.useEffect=function(w,O){return C.H.useEffect(w,O)},gt.useEffectEvent=function(w){return C.H.useEffectEvent(w)},gt.useId=function(){return C.H.useId()},gt.useImperativeHandle=function(w,O,U){return C.H.useImperativeHandle(w,O,U)},gt.useInsertionEffect=function(w,O){return C.H.useInsertionEffect(w,O)},gt.useLayoutEffect=function(w,O){return C.H.useLayoutEffect(w,O)},gt.useMemo=function(w,O){return C.H.useMemo(w,O)},gt.useOptimistic=function(w,O){return C.H.useOptimistic(w,O)},gt.useReducer=function(w,O,U){return C.H.useReducer(w,O,U)},gt.useRef=function(w){return C.H.useRef(w)},gt.useState=function(w){return C.H.useState(w)},gt.useSyncExternalStore=function(w,O,U){return C.H.useSyncExternalStore(w,O,U)},gt.useTransition=function(){return C.H.useTransition()},gt.version="19.2.1",gt}var ry;function Ld(){return ry||(ry=1,Hf.exports=BA()),Hf.exports}var Wf={exports:{}},Yi={};/**
27 * @license React
28 * react-dom.production.js
29 *
30 * Copyright (c) Meta Platforms, Inc. and affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var ay;function LA(){if(ay)return Yi;ay=1;var a=Ld();function e(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)f+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={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 r(h,f,_){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:d==null?null:""+d,children:h,containerInfo:f,implementation:_}}var o=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Yi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Yi.createPortal=function(h,f){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return r(h,f,null,_)},Yi.flushSync=function(h){var f=o.T,_=i.p;try{if(o.T=null,i.p=2,h)return h()}finally{o.T=f,i.p=_,i.d.f()}},Yi.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(h,f))},Yi.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},Yi.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var _=f.as,d=c(_,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,p=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;_==="style"?i.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:g,fetchPriority:p}):_==="script"&&i.d.X(h,{crossOrigin:d,integrity:g,fetchPriority:p,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Yi.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var _=c(f.as,f.crossOrigin);i.d.M(h,{crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(h)},Yi.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var _=f.as,d=c(_,f.crossOrigin);i.d.L(h,_,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Yi.preloadModule=function(h,f){if(typeof h=="string")if(f){var _=c(f.as,f.crossOrigin);i.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(h)},Yi.requestFormReset=function(h){i.d.r(h)},Yi.unstable_batchedUpdates=function(h,f){return h(f)},Yi.useFormState=function(h,f,_){return o.H.useFormState(h,f,_)},Yi.useFormStatus=function(){return o.H.useHostTransitionStatus()},Yi.version="19.2.1",Yi}var oy;function Vx(){if(oy)return Wf.exports;oy=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(e){console.error(e)}}return a(),Wf.exports=LA(),Wf.exports}/**
35 * @license React
36 * react-dom-client.production.js
37 *
38 * Copyright (c) Meta Platforms, Inc. and affiliates.
39 *
40 * This source code is licensed under the MIT license found in the
41 * LICENSE file in the root directory of this source tree.
42 */var ly;function UA(){if(ly)return Qo;ly=1;var a=FA(),e=Ld(),t=Vx();function i(n){var l="https://react.dev/errors/"+n;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+n+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function r(n){var l=n,u=n;if(n.alternate)for(;l.return;)l=l.return;else{n=l;do l=n,(l.flags&4098)!==0&&(u=l.return),n=l.return;while(n)}return l.tag===3?u:null}function o(n){if(n.tag===13){var l=n.memoizedState;if(l===null&&(n=n.alternate,n!==null&&(l=n.memoizedState)),l!==null)return l.dehydrated}return null}function c(n){if(n.tag===31){var l=n.memoizedState;if(l===null&&(n=n.alternate,n!==null&&(l=n.memoizedState)),l!==null)return l.dehydrated}return null}function h(n){if(r(n)!==n)throw Error(i(188))}function f(n){var l=n.alternate;if(!l){if(l=r(n),l===null)throw Error(i(188));return l!==n?null:n}for(var u=n,m=l;;){var y=u.return;if(y===null)break;var v=y.alternate;if(v===null){if(m=y.return,m!==null){u=m;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===u)return h(y),n;if(v===m)return h(y),l;v=v.sibling}throw Error(i(188))}if(u.return!==m.return)u=y,m=v;else{for(var P=!1,V=y.child;V;){if(V===u){P=!0,u=y,m=v;break}if(V===m){P=!0,m=y,u=v;break}V=V.sibling}if(!P){for(V=v.child;V;){if(V===u){P=!0,u=v,m=y;break}if(V===m){P=!0,m=v,u=y;break}V=V.sibling}if(!P)throw Error(i(189))}}if(u.alternate!==m)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?n:l}function _(n){var l=n.tag;if(l===5||l===26||l===27||l===6)return n;for(n=n.child;n!==null;){if(l=_(n),l!==null)return l;n=n.sibling}return null}var d=Object.assign,g=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),M=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function te(n){return n===null||typeof n!="object"?null:(n=J&&n[J]||n["@@iterator"],typeof n=="function"?n:null)}var ae=Symbol.for("react.client.reference");function B(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ae?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case b:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case A:return"Suspense";case D:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case x:return"Portal";case M:return n.displayName||"Context";case S:return(n._context.displayName||"Context")+".Consumer";case I:var l=n.render;return n=n.displayName,n||(n=l.displayName||l.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case C:return l=n.displayName||null,l!==null?l:B(n.type)||"Memo";case k:l=n._payload,n=n._init;try{return B(n(l))}catch{}}return null}var $=Array.isArray,z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},G=[],j=-1;function w(n){return{current:n}}function O(n){0>j||(n.current=G[j],G[j]=null,j--)}function U(n,l){j++,G[j]=n.current,n.current=l}var W=w(null),oe=w(null),le=w(null),be=w(null);function Ee(n,l){switch(U(le,l),U(oe,n),U(W,null),l.nodeType){case 9:case 11:n=(n=l.documentElement)&&(n=n.namespaceURI)?Rp(n):0;break;default:if(n=l.tagName,l=l.namespaceURI)l=Rp(l),n=Ap(l,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}O(W),U(W,n)}function Fe(){O(W),O(oe),O(le)}function Y(n){n.memoizedState!==null&&U(be,n);var l=W.current,u=Ap(l,n.type);l!==u&&(U(oe,n),U(W,u))}function ue(n){oe.current===n&&(O(W),O(oe)),be.current===n&&(O(be),qo._currentValue=q)}var de,we;function qe(n){if(de===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);de=l&&l[1]||"",we=-1<u.stack.indexOf(`
43    at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44`+de+n+we}var ke=!1;function ut(n,l){if(!n||ke)return"";ke=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(l){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(ve){var ye=ve}Reflect.construct(n,[],Ce)}else{try{Ce.call()}catch(ve){ye=ve}n.call(Ce.prototype)}}else{try{throw Error()}catch(ve){ye=ve}(Ce=n())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}
vendor: 6,508 bytes, lines 44-49
44catch(ve){if(ve&&ye&&typeof ve.stack=="string")return[ve.stack,ye.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=m.DetermineComponentFrameRoot(),P=v[0],V=v[1];if(P&&V){var ee=P.split(`
45`),ge=V.split(`
46`);for(y=m=0;m<ee.length&&!ee[m].includes("DetermineComponentFrameRoot");)m++;for(;y<ge.length&&!ge[y].includes("DetermineComponentFrameRoot");)y++;if(m===ee.length||y===ge.length)for(m=ee.length-1,y=ge.length-1;1<=m&&0<=y&&ee[m]!==ge[y];)y--;for(;1<=m&&0<=y;m--,y--)if(ee[m]!==ge[y]){if(m!==1||y!==1)do if(m--,y--,0>y||ee[m]!==ge[y]){var Re=`
47`+ee[m].replace(" at new "," at ");return n.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",n.displayName)),Re}while(1<=m&&0<=y);break}}}finally{ke=!1,Error.prepareStackTrace=u}return(u=n?n.displayName||n.name:"")?qe(u):""}function Gt(n,l){switch(n.tag){case 26:case 27:case 5:return qe(n.type);case 16:return qe("Lazy");case 13:return n.child!==l&&l!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return ut(n.type,!1);case 11:return ut(n.type.render,!1);case 1:return ut(n.type,!0);case 31:return qe("Activity");default:return""}}function Ot(n){try{var l="",u=null;do l+=Gt(n,u),u=n,n=n.return;while(n);return l}catch(m){return`
48Error generating stack: `+m.message+`
49`+m.stack}}var pt=Object.prototype.hasOwnProperty,Nt=a.unstable_scheduleCallback,Ft=a.unstable_cancelCallback,$e=a.unstable_shouldYield,ie=a.unstable_requestPaint,Pe=a.unstable_now,ei=a.unstable_getCurrentPriorityLevel,Xt=a.unstable_ImmediatePriority,ai=a.unstable_UserBlockingPriority,Kt=a.unstable_NormalPriority,Zt=a.unstable_LowPriority,At=a.unstable_IdlePriority,ti=a.log,Dt=a.unstable_setDisableYieldValue,zt=null,ii=null;function mi(n){if(typeof ti=="function"&&Dt(n),ii&&typeof ii.setStrictMode=="function")try{ii.setStrictMode(zt,n)}catch{}}var gi=Math.clz32?Math.clz32:ji,_n=Math.log,zs=Math.LN2;function ji(n){return n>>>=0,n===0?32:31-(_n(n)/zs|0)|0}var Tt=256,Q=262144,Ze=4194304;function Ri(n){var l=n&42;if(l!==0)return l;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function ot(n,l,u){var m=n.pendingLanes;if(m===0)return 0;var y=0,v=n.suspendedLanes,P=n.pingedLanes;n=n.warmLanes;var V=m&134217727;return V!==0?(m=V&~v,m!==0?y=Ri(m):(P&=V,P!==0?y=Ri(P):u||(u=V&~n,u!==0&&(y=Ri(u))))):(V=m&~v,V!==0?y=Ri(V):P!==0?y=Ri(P):u||(u=m&~n,u!==0&&(y=Ri(u)))),y===0?0:l!==0&&l!==y&&(l&v)===0&&(v=y&-y,u=l&-l,v>=u||v===32&&(u&4194048)!==0)?l:y}function ze(n,l){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&l)===0}function N(n,l){switch(n){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 xe(){var n=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),n}function ht(n){for(var l=[],u=0;31>u;u++)l.push(n);return l}function Ye(n,l){n.pendingLanes|=l,l!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function nt(n,l,u,m,y,v){var P=n.pendingLanes;n.pendingLanes=u,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=u,n.entangledLanes&=u,n.errorRecoveryDisabledLanes&=u,n.shellSuspendCounter=0;var V=n.entanglements,ee=n.expirationTimes,ge=n.hiddenUpdates;for(u=P&~u;0<u;){var Re=31-gi(u),Ce=1<<Re;V[Re]=0,ee[Re]=-1;var ye=ge[Re];if(ye!==null)for(ge[Re]=null,Re=0;Re<ye.length;Re++){var ve=ye[Re];ve!==null&&(ve.lane&=-536870913)}u&=~Ce}m!==0&&Ht(n,m,0),v!==0&&y===0&&n.tag!==0&&(n.suspendedLanes|=v&~(P&~l))}function Ht(n,l,u){n.pendingLanes|=l,n.suspendedLanes&=~l;var m=31-gi(l);n.entangledLanes|=l,n.entanglements[m]=n.entanglements[m]|1073741824|u&261930}function Wt(n,l){var u=n.entangledLanes|=l;for(n=n.entanglements;u;){var m=31-gi(u),y=1<<m;y&l|n[m]&l&&(n[m]|=l),u&=~y}}function bi(n,l){var u=l&-l;return u=(u&42)!==0?1:Wn(u),(u&(n.suspendedLanes|l))!==0?0:u}function Wn(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ss(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Sr(){var n=X.p;return n!==0?n:(n=window.event,n===void 0?32:jp(n.type))}function Ks(n,l){var u=X.p;try{return X.p=n,l()}finally{X.p=u}}var Xn=Math.random().toString(36).slice(2),Ni="__reactFiber$"+Xn,ns="__reactProps$"+Xn,ra="__reactContainer$"+Xn,Dh="__reactEvents$"+Xn,xT="__reactListeners$"+Xn,vT="__reactHandles$"+Xn,h_="__reactResources$"+Xn,ao="__reactMarker$"+Xn;function Ih(n){delete n[Ni],delete n[ns],delete n[Dh],delete n[xT],delete n[vT]}function aa(n){var l=n[Ni];if(l)return l;for(var u=n.parentNode;u;){if(l=u[ra]||u[Ni]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(n=wp(n);n!==null;){if(u=n[Ni])return u;n=wp(n)}return l}n=u,u=n.parentNode}return null}function oa(n){if(n=n[Ni]||n[ra]){var l=n.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return n}return null}function oo(n){var l=n.tag;if(l===5||l===26||l===27||l===6)return n.stateNode;throw Error(i(33))}function la(n){var l=n[h_];return l||(l=n[h_]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Ui(n){n[ao]=!0}var u_=new Set,f_={};function Er(n,l){ca(n,l),ca(n+"Capture",l)}function ca(n,l){for(f_[n]=l,n=0;n<l.length;n++)u_.add(l[n])}var TT=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
49037D\\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]*$"),d_={},__={};function RT(n){return pt.call(__,n)?!0:pt.call(d_,n)?!1:TT.test(n)?__[n]=!0:(d_[n]=!0,!1)}function Tl(n,l,u){if(RT(l))if(u===null)n.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":n.removeAttribute(l);return;case"boolean":var m=l.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){n.removeAttribute(l);return}}n.setAttribute(l,""+u)}}function Rl(n,l,u){if(u===null)n.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttribute(l,""+u)}}function mn(n,l,u,m){if(m===null)n.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(u);return}n.setAttributeNS(l,u,""+m)}}function Cs(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function m_(n){var l=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function AT(n,l,u){var m=Object.getOwnPropertyDescriptor(n.constructor.prototype,l);if(!n.hasOwnProperty(l)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,v=m.set;return Object.defineProperty(n,l,{configurable:!0,get:function(){return y.call(this)},set:function(P){u=""+P,v.call(this,P)}}),Object.defineProperty(n,l,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(P){u=""+P},stopTracking:function(){n._valueTracker=null,delete n[l]}}}}function wh(n){if(!n._valueTracker){var l=m_(n)?"checked":"value";n._valueTracker=AT(n,l,""+n[l])}}function g_(n){if(!n)return!1;var l=n._valueTracker;if(!l)return!0;var u=l.getValue(),m="";return n&&(m=m_(n)?n.checked?"true":"false":n.value),n=m,n!==u?(l.setValue(n),!0):!1}function Al(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var MT=/[\n"\\]/g;function Ds(n){return n.replace(MT,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Ph(n,l,u,m,y,v,P,V){n.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?n.type=P:n.removeAttribute("type"),l!=null?P==="number"?(l===0&&n.value===""||n.value!=l)&&(n.value=""+Cs(l)):n.value!==""+Cs(l)&&(n.value=""+Cs(l)):P!=="submit"&&P!=="reset"||n.removeAttribute("value"),l!=null?Oh(n,P,Cs(l)):u!=null?Oh(n,P,Cs(u)):m!=null&&n.removeAttribute("value"),y==null&&v!=null&&(n.defaultChecked=!!v),y!=null&&(n.checked=y&&t
vendor: 5,690 bytes, line 49
49ypeof y!="function"&&typeof y!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?n.name=""+Cs(V):n.removeAttribute("name")}function p_(n,l,u,m,y,v,P,V){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.type=v),l!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||l!=null)){wh(n);return}u=u!=null?""+Cs(u):"",l=l!=null?""+Cs(l):u,V||l===n.value||(n.value=l),n.defaultValue=l}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,n.checked=V?n.checked:!!m,n.defaultChecked=!!m,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(n.name=P),wh(n)}function Oh(n,l,u){l==="number"&&Al(n.ownerDocument)===n||n.defaultValue===""+u||(n.defaultValue=""+u)}function ha(n,l,u,m){if(n=n.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<n.length;u++)y=l.hasOwnProperty("$"+n[u].value),n[u].selected!==y&&(n[u].selected=y),y&&m&&(n[u].defaultSelected=!0)}else{for(u=""+Cs(u),l=null,y=0;y<n.length;y++){if(n[y].value===u){n[y].selected=!0,m&&(n[y].defaultSelected=!0);return}l!==null||n[y].disabled||(l=n[y])}l!==null&&(l.selected=!0)}}function y_(n,l,u){if(l!=null&&(l=""+Cs(l),l!==n.value&&(n.value=l),u==null)){n.defaultValue!==l&&(n.defaultValue=l);return}n.defaultValue=u!=null?""+Cs(u):""}function b_(n,l,u,m){if(l==null){if(m!=null){if(u!=null)throw Error(i(92));if($(m)){if(1<m.length)throw Error(i(93));m=m[0]}u=m}u==null&&(u=""),l=u}u=Cs(l),n.defaultValue=u,m=n.textContent,m===u&&m!==""&&m!==null&&(n.value=m),wh(n)}function ua(n,l){if(l){var u=n.firstChild;if(u&&u===n.lastChild&&u.nodeType===3){u.nodeValue=l;return}}n.textContent=l}var ST=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 x_(n,l,u){var m=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="":m?n.setProperty(l,u):typeof u!="number"||u===0||ST.has(l)?l==="float"?n.cssFloat=u:n[l]=(""+u).trim():n[l]=u+"px"}function v_(n,l,u){if(l!=null&&typeof l!="object")throw Error(i(62));if(n=n.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||l!=null&&l.hasOwnProperty(m)||(m.indexOf("--")===0?n.setProperty(m,""):m==="float"?n.cssFloat="":n[m]="");for(var y in l)m=l[y],l.hasOwnProperty(y)&&u[y]!==m&&x_(n,y,m)}else for(var v in l)l.hasOwnProperty(v)&&x_(n,v,l[v])}function Fh(n){if(n.indexOf("-")===-1)return!1;switch(n){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 ET=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
49-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"]]),CT=/^[\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 Ml(n){return CT.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function gn(){}var Bh=null;function Lh(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var fa=null,da=null;function T_(n){var l=oa(n);if(l&&(n=l.stateNode)){var u=n[ns]||null;e:switch(n=l.stateNode,l.type){case"input":if(Ph(n,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=n;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Ds(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var m=u[l];if(m!==n&&m.form===n.form){var y=m[ns]||null;if(!y)throw Error(i(90));Ph(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)m=u[l],m.form===n.form&&g_(m)}break e;case"textarea":y_(n,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&ha(n,!!u.multiple,l,!1)}}}var Uh=!1;function R_(n,l,u){if(Uh)return n(l,u);Uh=!0;try{var m=n(l);return m}finally{if(Uh=!1,(fa!==null||da!==null)&&(fc(),fa&&(l=fa,n=da,da=fa=null,T_(l),n)))for(l=0;l<n.length;l++)T_(n[l])}}function lo(n,l){var u=n.stateNode;if(u===null)return null;var m=u[ns]||null;if(m===null)return null;u=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(n=n.type,m=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!m;break e;default:n=!1}if(n)return null;if(u&&typeof u!="function")throw Error(i(231,l,typeof u));return u}var pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kh=!1;if(pn)try{var co={};Object.defineProperty(co,"passive",{get:function(){kh=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{kh=!1}var qn=null,Nh=null,Sl=null;function A_(){if(Sl)return Sl;var n,l=Nh,u=l.length,m,y="value"in qn?qn.value:qn.textContent,v=y.length;for(n=0;n<u&&l[n]===y[n];n++);var P=u-n;for(m=1;m<=P&&l[u-m]===y[v-m];m++);return Sl=y.slice(n,1<m?1-m:void 0)}function El(n){var l=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&l===13&&(n=13)):n=l,n===10&&(n=13),32<=n||n===13?n:0}function Cl(){return!0}function M_(){return!1}function rs(n){function l(u,m,y,v,P){this._reactName=u,this._targetInst=y,this.type=m,this.nativeEvent=v,this.target=P,this.currentTarget=null;for(var V in n)n.hasOwnProperty(V)&&(u=n[V],this[V]=u?u(v):v[V]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Cl:M_,this.isPropagationStopped=M_,this}return d(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Cl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),l}var Cr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=rs(Cr),ho=d({},Cr,{view:0,detail:0}),DT=rs(ho),zh,Vh,uo,Il=d({},ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hh,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==uo&&(uo&&n.type==="mousemove"?(zh=n.screenX-uo.screenX,Vh=n.screenY-uo.screenY):Vh=zh=0,uo=n),zh)},movementY:function(n){return"movementY"in n?n.movementY:Vh}}),S_=rs(Il),IT=d({},Il,{dataTransfer:0}),wT=rs(IT),PT=d({},ho,{relatedTarget:0}),Gh=rs(PT),OT=d({},Cr,{animationName:0,elapsedTime:0,pseudoElement:0}),FT=rs(OT),BT=d({},Cr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),LT=rs(BT),UT=d({},Cr,{data:0}),E_=rs(UT),kT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NT={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"},zT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VT(n){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(n):(n=zT[n])?!!l[n]:!1}function Hh(){return VT}var GT=d({},ho,{key:function(n){if(n.key){var l=kT[n.key]||n.key;if(l!=="Unidentified")return l}
vendor: 5,186 bytes, line 49
49return n.type==="keypress"?(n=El(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?NT[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hh,charCode:function(n){return n.type==="keypress"?El(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?El(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),HT=rs(GT),WT=d({},Il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C_=rs(WT),XT=d({},ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hh}),qT=rs(XT),jT=d({},Cr,{propertyName:0,elapsedTime:0,pseudoElement:0}),YT=rs(jT),KT=d({},Il,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),ZT=rs(KT),QT=d({},Cr,{newState:0,oldState:0}),$T=rs(QT),JT=[9,13,27,32],Wh=pn&&"CompositionEvent"in window,fo=null;pn&&"documentMode"in document&&(fo=document.documentMode);var eR=pn&&"TextEvent"in window&&!fo,D_=pn&&(!Wh||fo&&8<fo&&11>=fo),I_=" ",w_=!1;function P_(n,l){switch(n){case"keyup":return JT.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O_(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var _a=!1;function tR(n,l){switch(n){case"compositionend":return O_(l);case"keypress":return l.which!==32?null:(w_=!0,I_);case"textInput":return n=l.data,n===I_&&w_?null:n;default:return null}}function iR(n,l){if(_a)return n==="compositionend"||!Wh&&P_(n,l)?(n=A_(),Sl=Nh=qn=null,_a=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return D_&&l.locale!=="ko"?null:l.data;default:return null}}var sR={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 F_(n){var l=n&&n.nodeName&&n.nodeName.toLowerCase();return l==="input"?!!sR[n.type]:l==="textarea"}function B_(n,l,u,m){fa?da?da.push(m):da=[m]:fa=m,l=bc(l,"onChange"),0<l.length&&(u=new Dl("onChange","change",null,u,m),n.push({event:u,listeners:l}))}var _o=null,mo=null;function nR(n){pp(n,0)}function wl(n){var l=oo(n);if(g_(l))return n}function L_(n,l){if(n==="change")return l}var U_=!1;if(pn){var Xh;if(pn){var qh="oninput"in document;if(!qh){var k_=document.createElement("div");k_.setAttribute("oninput","return;"),qh=typeof k_.oninput=="function"}Xh=qh}else Xh=!1;U_=Xh&&(!document.documentMode||9<document.documentMode)}function N_(){_o&&(_o.detachEvent("onpropertychange",z_),mo=_o=null)}function z_(n){if(n.propertyName==="value"&&wl(mo)){var l=[];B_(l,mo,n,Lh(n)),R_(nR,l)}}function rR(n,l,u){n==="focusin"?(N_(),_o=l,mo=u,_o.attachEvent("onpropertychange",z_)):n==="focusout"&&N_()}function aR(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return wl(mo)}function oR(n,l){if(n==="click")return wl(l)}function lR(n,l){if(n==="input"||n==="change")return wl(l)}function cR(n,l){return n===l&&(n!==0||1/n===1/l)||n!==n&&l!==l}var _s=typeof Object.is=="function"?Object.is:cR;function go(n,l){if(_s(n,l))return!0;if(typeof n!="object"||n===null||typeof l!="object"||l===null)return!1;var u=Object.keys(n),m=Object.keys(l);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var y=u[m];if(!pt.call(l,y)||!_s(n[y],l[y]))return!1}return!0}function V_(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function G_(n,l){var u=V_(n);n=0;for(var m;u;){if(u.nodeType===3){if(m=n+u.textContent.length,n<=l&&m>=l)return{node:u,offset:l-n};n=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=V_(u)}}function H_(n,l){return n&&l?n===l?!0:n&&n.nodeType===3?!1:l&&l.nodeType===3?H_(n,l.parentNode):"contains"in n?n.contains(l):n.compareDocumentPosition?!!(n.compareDocumentPosition(l)&16):!1:!1}function W_(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var l=Al(n.document);l instanceof n.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)n=l.contentWindow;else break;l=Al(n.document)}return l}function jh(n){var l=n&&n.nodeName&&n.nodeName.toLowerCase();return l&&(l==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||l==="textarea"||n.contentEditable==="true")}var hR=pn&&"documentMode"in document&&11>=document.documentMode,ma=null,Yh=null,po=null,Kh=!1;function X_(n,l,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Kh||ma==null||ma!==Al(m)||(m=ma,"selectionStart"in m&&jh(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focu
vendor: 22,846 bytes, line 49
49sNode:m.focusNode,focusOffset:m.focusOffset}),po&&go(po,m)||(po=m,m=bc(Yh,"onSelect"),0<m.length&&(l=new Dl("onSelect","select",null,l,u),n.push({event:l,listeners:m}),l.target=ma)))}function Dr(n,l){var u={};return u[n.toLowerCase()]=l.toLowerCase(),u["Webkit"+n]="webkit"+l,u["Moz"+n]="moz"+l,u}var ga={animationend:Dr("Animation","AnimationEnd"),animationiteration:Dr("Animation","AnimationIteration"),animationstart:Dr("Animation","AnimationStart"),transitionrun:Dr("Transition","TransitionRun"),transitionstart:Dr("Transition","TransitionStart"),transitioncancel:Dr("Transition","TransitionCancel"),transitionend:Dr("Transition","TransitionEnd")},Zh={},q_={};pn&&(q_=document.createElement("div").style,"AnimationEvent"in window||(delete ga.animationend.animation,delete ga.animationiteration.animation,delete ga.animationstart.animation),"TransitionEvent"in window||delete ga.transitionend.transition);function Ir(n){if(Zh[n])return Zh[n];if(!ga[n])return n;var l=ga[n],u;for(u in l)if(l.hasOwnProperty(u)&&u in q_)return Zh[n]=l[u];return n}var j_=Ir("animationend"),Y_=Ir("animationiteration"),K_=Ir("animationstart"),uR=Ir("transitionrun"),fR=Ir("transitionstart"),dR=Ir("transitioncancel"),Z_=Ir("transitionend"),Q_=new Map,Qh="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(" ");Qh.push("scrollEnd");function Vs(n,l){Q_.set(n,l),Er(l,[n])}var Pl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Is=[],pa=0,$h=0;function Ol(){for(var n=pa,l=$h=pa=0;l<n;){var u=Is[l];Is[l++]=null;var m=Is[l];Is[l++]=null;var y=Is[l];Is[l++]=null;var v=Is[l];if(Is[l++]=null,m!==null&&y!==null){var P=m.pending;P===null?y.next=y:(y.next=P.next,P.next=y),m.pending=y}v!==0&&$_(u,y,v)}}function Fl(n,l,u,m){Is[pa++]=n,Is[pa++]=l,Is[pa++]=u,Is[pa++]=m,$h|=m,n.lanes|=m,n=n.alternate,n!==null&&(n.lanes|=m)}function Jh(n,l,u,m){return Fl(n,l,u,m),Bl(n)}function wr(n,l){return Fl(n,null,null,l),Bl(n)}function $_(n,l,u){n.lanes|=u;var m=n.alternate;m!==null&&(m.lanes|=u);for(var y=!1,v=n.return;v!==null;)v.childLanes|=u,m=v.alternate,m!==null&&(m.childLanes|=u),v.tag===22&&(n=v.stateNode,n===null||n._visibility&1||(y=!0)),n=v,v=v.return;return n.tag===3?(v=n.stateNode,y&&l!==null&&(y=31-gi(u),n=v.hiddenUpdates,m=n[y],m===null?n[y]=[l]:m.push(l),l.lane=u|536870912),v):null}function Bl(n){if(50<No)throw No=0,cf=null,Error(i(185));for(var l=n.return;l!==null;)n=l,l=n.return;return n.tag===3?n.stateNode:null}var ya={};function _R(n,l,u,m){this.tag=n,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ms(n,l,u,m){return new _R(n,l,u,m)}function eu(n){return n=n.prototype,!(!n||!n.isReactComponent)}function yn(n,l){var u=n.alternate;return u===null?(u=ms(n.tag,l,n.key,n.mode),u.elementType=n.elementType,u.type=n.type,u.stateNode=n.stateNode,u.alternate=n,n.alternate=u):(u.pendingProps=l,u.type=n.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=n.flags&65011712,u.childLanes=n.childLanes,u.lanes=n.lanes,u.child=n.child,u.memoizedProps=n.memoizedProps,u.memoizedState=n.memoizedState,u.updateQueue=n.updateQueue,l=n.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=n.sibling,u.index=n.index,u.ref=n.ref,u.refCleanup=n.refCleanup,u}function J_(n,l){n.flags&=65011714;var u=n.alternate;return u===null?(n.childLanes=0,n.lanes=l,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=u.childLanes,n.lanes=u.lanes,n.child=u.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=u.memoizedProps,n.memoizedState=u.memoizedState,n.updateQueue=u.updateQueue,n.type=u.type,l=u.dependencies,n.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),n}function Ll(n,l,u,m,y,v){var P=0;if(m=n,typeof n=="function")eu(n)&&(P=1);else if(typeof n=="string")P=bA(n,u,W.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case H:return n=ms(31,u,l,y),n.elementType=H,n.lanes=v,n;case b:return Pr(u.children,y,v,l);case T:P=8,y|=24;break;case R:return n=ms(12,u,l,y|2),n.elementType=R,n.lanes=v,n;case A:return n=ms(13,u,l,y),n.elementType=A,n.lanes=v,n;case D:return n=ms(19,u,l,y),n.elementType=D,n.lanes=v,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case M:P=10;break e;case S:P=9;break e;case I:P=11;break e;case C:P=14;break e;case k:P=16,m=null;break e}P=29,u=Error(i(130,n===null?"null":typeof n,"")),m=null}return l=ms(P,u,l,y),l.elementType=n,l.type=m,l.lanes=v,l}function Pr(n,l,u,m){return n=ms(7,n,m,l),n.lanes=u,n}function tu(n,l,u){return n=ms(6,n,null,l),n.lanes=u,n}function em(n){var l=ms(18,null,null,0);return l.stateNode=n,l}function iu(n,l,u){return l=ms(4,n.children!==null?n.children:[],n.key,l),l.lanes=u,l.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},l}var tm=new WeakMap;function ws(n,l){if(typeof n=="object"&&n!==null){var u=tm.get(n);return u!==void 0?u:(l={value:n,source:l,stack:Ot(l)},tm.set(n,l),l)}return{value:n,source:l,stack:Ot(l)}}var ba=[],xa=0,Ul=null,yo=0,Ps=[],Os=0,jn=null,Zs=1,Qs="";function bn(n,l){ba[xa++]=yo,ba[xa++]=Ul,Ul=n,yo=l}function im(n,l,u){Ps[Os++]=Zs,Ps[Os++]=Qs,Ps[Os++]=jn,jn=n;var m=Zs;n=Qs;var y=32-gi(m)-1;m&=~(1<<y),u+=1;var v=32-gi(l)+y;if(30<v){var P=y-y%5;v=(m&(1<<P)-1).toString(32),m>>=P,y-=P,Zs=1<<32-gi(l)+y|u<<y|m,Qs=v+n}else Zs=1<<v|u<<y|m,Qs=n}function su(n){n.return!==null&&(bn(n,1),im(n,1,0))}function nu(n){for(;n===Ul;)Ul=ba[--xa],ba[xa]=null,yo=ba[--xa],ba[xa]=null;for(;n===jn;)jn=Ps[--Os],Ps[Os]=null,Qs=Ps[--Os],Ps[Os]=null,Zs=Ps[--Os],Ps[Os]=null}function sm(n,l){Ps[Os++]=Zs,Ps[Os++]=Qs,Ps[Os++]=jn,Zs=l.id,Qs=l.overflow,jn=n}var zi=null,hi=null,It=!1,Yn=null,Fs=!1,ru=Error(i(519));function Kn(n){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bo(ws(l,n)),ru}function nm(n){var l=n.stateNode,u=n.type,m=n.memoizedProps;switch(l[Ni]=n,l[ns]=m,u){case"dialog":St("cancel",l),St("close",l);break;case"iframe":case"object":case"embed":St("load",l);break;case"video":case"audio":for(u=0;u<Vo.length;u++)St(Vo[u],l);break;case"source":St("error",l);break;case"img":case"image":case"link":St("error",l),St("load",l);break;case"details":St("toggle",l);break;case"input":St("invalid",l),p_(l,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":St("invalid",l);break;case"textarea":St("invalid",l),b_(l,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||m.suppressHydrationWarning===!0||vp(l.textContent,u)?(m.popover!=null&&(St("beforetoggle",l),St("toggle",l)),m.onScroll!=null&&St("scroll",l),m.onScrollEnd!=null&&St("scrollend",l),m.onClick!=null&&(l.onclick=gn),l=!0):l=!1,l||Kn(n,!0)}function rm(n){for(zi=n.return;zi;)switch(zi.tag){case 5:case 31:case 13:Fs=!1;return;case 27:case 3:Fs=!0;return;default:zi=zi.return}}function va(n){if(n!==zi)return!1;if(!It)return rm(n),It=!0,!1;var l=n.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=n.type,u=!(u!=="form"&&u!=="button")||Af(n.type,n.memoizedProps)),u=!u),u&&hi&&Kn(n),rm(n),l===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));hi=Ip(n)}else if(l===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));hi=Ip(n)}else l===27?(l=hi,cr(n.type)?(n=Df,Df=null,hi=n):hi=l):hi=zi?Ls(n.stateNode.nextSibling):null;return!0}function Or(){hi=zi=null,It=!1}function au(){var n=Yn;return n!==null&&(cs===null?cs=n:cs.push.apply(cs,n),Yn=null),n}function bo(n){Yn===null?Yn=[n]:Yn.push(n)}var ou=w(null),Fr=null,xn=null;function Zn(n,l,u){U(ou,l._currentValue),l._currentValue=u}function vn(n){n._currentValue=ou.current,O(ou)}function lu(n,l,u){for(;n!==null;){var m=n.alternate;if((n.childLanes&l)!==l?(n.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),n===u)break;n=n.return}}function cu(n,l,u,m){var y=n.child;for(y!==null&&(y.return=n);y!==null;){var v=y.dependencies;if(v!==null){var P=y.child;v=v.firstContext;e:for(;v!==null;){var V=v;v=y;for(var ee=0;ee<l.length;ee++)if(V.context===l[ee]){v.lanes|=u,V=v.alternate,V!==null&&(V.lanes|=u),lu(v.return,u,n),m||(P=null);break e}v=V.next}}else if(y.tag===18){if(P=y.return,P===null)throw Error(i(341));P.lanes|=u,v=P.alternate,v!==null&&(v.lanes|=u),lu(P,u,n),P=null}else P=y.child;if(P!==null)P.return=y;else for(P=y;P!==null;){if(P===n){P=null;break}if(y=P.sibling,y!==null){y.return=P.return,P=y;break}P=P.return}y=P}}function Ta(n,l,u,m){n=null;for(var y=l,v=!1;y!==null;){if(!v){if((y.flags&524288)!==0)v=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var P=y.alternate;if(P===null)throw Error(i(387));if(P=P.memoizedProps,P!==null){var V=y.type;_s(y.pendingProps.value,P.value)||(n!==null?n.push(V):n=[V])}}else if(y===be.current){if(P=y.alternate,P===null)throw Error(i(387));P.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(n!==null?n.push(qo):n=[qo])}y=y.return}n!==null&&cu(l,n,u,m),l.flags|=262144}function kl(n){for(n=n.firstContext;n!==null;){if(!_s(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Br(n){Fr=n,xn=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Vi(n){return am(Fr,n)}function Nl(n,l){return Fr===null&&Br(n),am(n,l)}function am(n,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},xn===null){if(n===null)throw Error(i(308));xn=l,n.dependencies={lanes:0,firstContext:l},n.flags|=524288}else xn=xn.next=l;return u}var mR=typeof AbortController<"u"?AbortController:function(){var n=[],l=this.signal={aborted:!1,addEventListener:function(u,m){n.push(m)}};this.abort=function(){l.aborted=!0,n.forEach(function(u){return u()})}},gR=a.unstable_scheduleCallback,pR=a.unstable_NormalPriority,Ei={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hu(){return{controller:new mR,data:new Map,refCount:0}}function xo(n){n.refCount--,n.refCount===0&&gR(pR,function(){n.controller.abort()})}var vo=null,uu=0,Ra=0,Aa=null;function yR(n,l){if(vo===null){var u=vo=[];uu=0,Ra=mf(),Aa={status:"pending",value:void 0,then:function(m){u.push(m)}}}return uu++,l.then(om,om),l}function om(){if(--uu===0&&vo!==null){Aa!==null&&(Aa.status="fulfilled");var n=vo;vo=null,Ra=0,Aa=null;for(var l=0;l<n.length;l++)(0,n[l])()}}function bR(n,l){var u=[],m={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return n.then(function(){m.status="fulfilled",m.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(m.status="rejected",m.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),m}var lm=z.S;z.S=function(n,l){Xg=Pe(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&yR(n,l),lm!==null&&lm(n,l)};var Lr=w(null);function fu(){var n=Lr.current;return n!==null?n:si.pooledCache}function zl(n,l){l===null?U(Lr,Lr.current):U(Lr,l.pool)}function cm(){var n=fu();return n===null?null:{parent:Ei._currentValue,pool:n}}var Ma=Error(i(460)),du=Error(i(474)),Vl=Error(i(542)),Gl={then:function(){}};function hm(n){return n=n.status,n==="fulfilled"||n==="rejected"}function um(n,l,u){switch(u=n[u],u===void 0?n.push(l):u!==l&&(l.then(gn,gn),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw n=l.reason,dm(n),n;default:if(typeof l.status=="string")l.then(gn,gn);else{if(n=si,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=l,n.status="pending",n.then(function(m){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=m}},function(m){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=m}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw n=l.reason,dm(n),n}throw kr=l,Ma}}function Ur(n){try{var l=n._init;return l(n._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(kr=u,Ma):u}}var kr=null;function fm(){if(kr===null)throw Error(i(459));var n=kr;return kr=null,n}function dm(n){if(n===Ma||n===Vl)throw Error(i(483))}var Sa=null,To=0;function Hl(n){var l=To;return To+=1,Sa===null&&(Sa=[]),um(Sa,n,l)}function Ro(n,l){l=l.props.ref,n.ref=l!==void 0?l:null}function Wl(n,l){throw l.$$typeof===g?Error(i(525)):(n=Object.prototype.toString.call(l),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":n)))}function _m(n){function l(ce,re){if(n){var _e=ce.deletions;_e===null?(ce.deletions=[re],ce.flags|=16):_e.push(re)}}function u(ce,re){if(!n)return null;for(;re!==null;)l(ce,re),re=re.sibling;return null}function m(ce){for(var re=new Map;ce!==null;)ce.key!==null?re.set(ce.key,ce):re.set(ce.index,ce),ce=ce.sibling;return re}function y(ce,re){return ce=yn(ce,re),ce.index=0,ce.sibling=null,ce}function v(ce,re,_e){return ce.index=_e,n?(_e=ce.alternate,_e!==null?(_e=_e.index,_e<re?(ce.flags|=67108866,re):_e):(ce.flags|=67108866,re)):(ce.flags|=1048576,re)}function P(ce){return n&&ce.alternate===null&&(ce.flags|=67108866),ce}function V(ce,re,_e,Se){return re===null||re.tag!==6?(re=tu(_e,ce.mode,Se),re.return=ce,re):(re=y(re,_e),re.return=ce,re)}function ee(ce,re,_e,Se){var rt=_e.type;return rt===b?Re(ce,re,_e.props.children,Se,_e.key):re!==null&&(re.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===k&&Ur(rt)===re.type)?(re=y(re,_e.props),Ro(re,_e),re.return=ce,re):(re=Ll(_e.type,_e.key,_e.props,null,ce.mode,Se),Ro(re,_e),re.return=ce,re)}function ge(ce,re,_e,Se){return re===null||re.tag!==4||re.stateNode.containerInfo!==_e.containerInfo||re.stateNode.implementation!==_e.implementation?(re=iu(_e,ce.mode,Se),re.return=ce,re):(re=y(re,_e.children||[]),re.return=ce,re)}function Re(ce,re,_e,Se,rt){return re===null||re.tag!==7?(re=Pr(_e,ce.mode,Se,rt),re.return=ce,re):(re=y(re,_e),re.return=ce,re)}function Ce(ce,re,_e){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=tu(""+re,ce.mode,_e),re.return=ce,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case p:return _e=Ll(re.type,re.key,re.props,null,ce.mode,_e),Ro(_e,re),_e.return=ce,_e;case x:return re=iu(re,ce.mode,_e),re.return=ce,re;case k:return re=Ur(re),Ce(ce,re,_e)}if($(re)||te(re))return re=Pr(re,ce.mode,_e,null),re.return=ce,re;if(typeof re.then=="function")return Ce(ce,Hl(re),_e);if(re.$$typeof===M)return Ce(ce,Nl(ce,re),_e);Wl(ce,re)}return null}function ye(ce,re,_e,Se){var rt=re!==null?re.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return rt!==null?null:V(ce,re,""+_e,Se);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case p:return _e.key===rt?ee(ce,re,_e,Se):null;case x:return _e.key===rt?ge(ce,re,_e,Se):null;case k:return _e=Ur(_e),ye(ce,re,_e,Se)}if($(_e)||te(_e))return rt!==null?null:Re(ce,re,_e,Se,null);if(typeof _e.then=="function")return ye(ce,re,Hl(_e),Se);if(_e.$$typeof===M)return ye(ce,re,Nl(ce,_e),Se);Wl(ce,_e)}return null}function ve(ce,re,_e,Se,rt){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return ce=ce.get(_e)||null,V(re,ce,""+Se,rt);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case p:return ce=ce.get(Se.key===null?_e:Se.key)||null,ee(re,ce,Se,rt);case x:return ce=ce.get(Se.key===null?_e:Se.key)||null,ge(re,ce,Se,rt);case k:return Se=Ur(Se),ve(ce,re,_e,Se,rt)}if($(Se)||te(Se))return ce=ce.get(_e)||null,Re(re,ce,Se,rt,null);if(typeof Se.then=="function")return ve(ce,re,_e,Hl(Se),rt);if(Se.$$typeof===M)return ve(ce,re,_e,Nl(re,Se),rt);Wl(re,Se)}return null}function Qe(ce,re,_e,Se){for(var rt=null,Ut=null,tt=re,bt=re=0,Ct=null;tt!==null&&bt<_e.length;bt++){tt.index>bt?(Ct=tt,tt=null):Ct=tt.sibling;var kt=ye(ce,tt,_e[bt],Se);if(kt===null){tt===null&&(tt=Ct);break}n&&tt&&kt.alternate===null&&l(ce,tt),re=v(kt,re,bt),Ut===null?rt=kt:Ut.sibling=kt,Ut=kt,tt=Ct}if(bt===_e.length)return u(ce,tt),It&&bn(ce,bt),rt;if(tt===null){for(;bt<_e.length;bt++)tt=Ce(ce,_e[bt],Se),tt!==null&&(re=v(tt,re,bt),Ut===null?rt=tt:Ut.sibling=tt,Ut=tt);return It&&bn(ce,bt),rt}for(tt=m(tt);bt<_e.length;bt++)Ct=ve(tt,ce,bt,_e[bt],Se),Ct!==null&&(n&&Ct.alternate!==null&&tt.delete(Ct.key===null?bt:Ct.key),re=v(Ct,re,bt),Ut===null?rt=Ct:Ut.sibling=Ct,Ut=Ct);return n&&tt.forEach(function(_r){return l(ce,_r)}),It&&bn(ce,bt),rt}function ct(ce,re,_e,Se){if(_e==null)throw Error(i(151));for(var rt=null,Ut=null,tt=re,bt=re=0,Ct=null,kt=_e.next();tt!==null&&!kt.done;bt++,kt=_e.next()){tt.index>bt?(Ct=tt,tt=null):Ct=tt.sibling;var _r=ye(ce,tt,kt.value,Se);if(_r===null){tt===null&&(tt=Ct);break}n&&tt&&_r.alternate===null&&l(ce,tt),re=v(_r,re,bt),Ut===null?rt=_r:Ut.sibling=_r,Ut=_r,tt=Ct}if(kt.done)return u(ce,tt),It&&bn(ce,bt),rt;if(tt===null){for(;!kt.done;bt++,kt=_e.next())kt=Ce(ce,kt.value,Se),kt!==null&&(re=v(kt,re,bt),Ut===null?rt=kt:Ut.sibling=kt,Ut=kt);return It&&bn(ce,bt),rt}for(tt=m(tt);!kt.done;bt++,kt=_e.next())kt=ve(tt,ce,bt,kt.value,Se),kt!==null&&(n&&kt.alternate!==null&&tt.delete(kt.key===null?bt:kt.key),re=v(kt,re,bt),Ut===null?rt=kt:Ut.sibling=kt,Ut=kt);return n&&tt.forEach(function(IA){return l(ce,IA)}),It&&bn(ce,bt),rt}function Jt(ce,re,_e,Se){if(typeof _e=="object"&&_e!==null&&_e.type===b&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case p:e:{for(var rt=_e.key;re!==null;){if(re.key===rt){if(rt=_e.type,rt===b){if(re.tag===7){u(ce,re.sibling),Se=y(re,_e.props.children),Se.return=ce,ce=Se;break e}}else if(re.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===k&&Ur(rt)===re.type){u(ce,re.sibling),Se=y(re,_e.props),Ro(Se,_e),Se.return=ce,ce=Se;break e}u(ce,re);break}else l(ce,re);re=re.sibling}_e.type===b?(Se=Pr(_e.props.children,ce.mode,Se,_e.key),Se.return=ce,ce=Se):(Se=Ll(_e.type,_e.key,_e.props,null,ce.mode,Se),Ro(Se,_e),Se.return=ce,ce=Se)}return P(ce);case x:e:{for(rt=_e.key;re!==null;){if(re.key===rt)if(re.tag===4&&re.stateNode.containerInfo===_e.containerInfo&&re.stateNode.implementation===_e.implementation){u(ce,re.sibling),Se=y(re,_e.children||[]),Se.return=ce,ce=Se;break e}else{u(ce,re);break}else l(ce,re);re=re.sibling}Se=iu(_e,ce.mode,Se),Se.return=ce,ce=Se}return P(ce);case k:return _e=Ur(_e),Jt(ce,re,_e,Se)}if($(_e))return Qe(ce,re,_e,Se);if(te(_e)){if(rt=te(_e),typeof rt!="function")throw Error(i(150));return _e=rt.call(_e),ct(ce,re,_e,Se)}if(typeof _e.then=="function")return Jt(ce,re,Hl(_e),Se);if(_e.$$typeof===M)return Jt(ce,re,Nl(ce,_e),Se);Wl(ce,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint"?(_e=""+_e,re!==null&&re.tag===6?(u(ce,re.sibling),Se=y(re,_e),Se.return=ce,ce=Se):(u(ce,re),Se=tu(_e,ce.mode,Se),Se.return=ce,ce=Se),P(ce)):u(ce,re)}return function(ce,re,_e,Se){try{To=0;var rt=Jt(ce,re,_e,Se);return Sa=null,rt}catch(tt){if(tt===Ma||tt===Vl)throw tt;var Ut=ms(29,tt,null,ce.mode);return Ut.lanes=Se,Ut.return=ce,Ut}finally{}}}var Nr=_m(!0),mm=_m(!1),Qn=!1;function _u(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mu(n,l){n=n.updateQueue,l.updateQueue===n&&(l.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function $n(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Jn(n,l,u){var m=n.updateQueue;if(m===null)return null;if(m=m.shared,(Vt&2)!==0){var y=m.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),m.pending=l,l=Bl(n),$_(n,null,u),l}return Fl(n,m,l,u),Bl(n)}function Ao(n,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var m=l.lanes;m&=n.pendingLanes,u|=m,l.lanes=u,Wt(n,u)}}function gu(n,l){var u=n.updateQueue,m=n.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var y=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var P={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?y=v=P:v=v.next=P,u=u.next}while(u!==null);v===null?y=v=l:v=v.next=l}else y=v=l;u={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:m.shared,callbacks:m.callbacks},n.updateQueue=u;return}n=u.lastBaseUpdate,n===null?u.firstBaseUpdate=l:n.next=l,u.lastBaseUpdate=l}var pu=!1;function Mo(){if(pu){var n=Aa;if(n!==null)throw n}}function So(n,l,u,m){pu=!1;var y=n.updateQueue;Qn=!1;var v=y.firstBaseUpdate,P=y.lastBaseUpdate,V=y.shared.pending;if(V!==null){y.shared.pending=null;var ee=V,ge=ee.next;ee.next=null,P===null?v=ge:P.next=ge,P=ee;var Re=n.alternate;Re!==null&&(Re=Re.updateQueue,V=Re.lastBaseUpdate,V!==P&&(V===null?Re.firstBaseUpdate=ge:V.next=ge,Re.lastBaseUpdate=ee))}if(v!==null){var Ce=y.baseState;P=0,Re=ge=ee=null,V=v;do{var ye=V.lane&-536870913,ve=ye!==V.lane;if(ve?(Et&ye)===ye:(m&ye)===ye){ye!==0&&ye===Ra&&(pu=!0),Re!==null&&(Re=Re.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var Qe=n,ct=V;ye=l;var Jt=u;switch(ct.tag){case 1:if(Qe=ct.payload,typeof Qe=="function"){Ce=Qe.call(Jt,Ce,ye);break e}Ce=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=ct.payload,ye=typeof Qe=="function"?Qe.call(Jt,Ce,ye):Qe,ye==null)break e;Ce=d({},Ce,ye);break e;case 2:Qn=!0}}ye=V.callback,ye!==null&&(n.flags|=64,ve&&(n.flags|=8192),ve=y.callbacks,ve===null?y.callbacks=[ye]:ve.push(ye))}else ve={lane:ye,tag:V.tag,payload:V.payload,callback:V.callback,next:null},Re===null?(ge=Re=ve,ee=Ce):Re=Re.next=ve,P|=ye;if(V=V.next,V===null){if(V=y.shared.pending,V===null)break;ve=V,V=ve.next,ve.next=null,y.lastBaseUpdate=ve,y.shared.pending=null}}while(!0);Re===null&&(ee=Ce),y.baseState=ee,y.firstBaseUpdate=ge,y.lastBaseUpdate=Re,v===null&&(y.shared.lanes=0),nr|=P,n.lanes=P,n.memoizedState=Ce}}function gm(n,l){if(typeof n!="function")throw Error(i(191,n));n.call(l)}function pm(n,l){var u=n.callbacks;
vendor: 4,085 bytes, line 49
49if(u!==null)for(n.callbacks=null,n=0;n<u.length;n++)gm(u[n],l)}var Ea=w(null),Xl=w(0);function ym(n,l){n=In,U(Xl,n),U(Ea,l),In=n|l.baseLanes}function yu(){U(Xl,In),U(Ea,Ea.current)}function bu(){In=Xl.current,O(Ea),O(Xl)}var gs=w(null),Bs=null;function er(n){var l=n.alternate;U(Ai,Ai.current&1),U(gs,n),Bs===null&&(l===null||Ea.current!==null||l.memoizedState!==null)&&(Bs=n)}function xu(n){U(Ai,Ai.current),U(gs,n),Bs===null&&(Bs=n)}function bm(n){n.tag===22?(U(Ai,Ai.current),U(gs,n),Bs===null&&(Bs=n)):tr()}function tr(){U(Ai,Ai.current),U(gs,gs.current)}function ps(n){O(gs),Bs===n&&(Bs=null),O(Ai)}var Ai=w(0);function ql(n){for(var l=n;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Ef(u)||Cf(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===n)break;for(;l.sibling===null;){if(l.return===null||l.return===n)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Tn=0,yt=null,Qt=null,Ci=null,jl=!1,Ca=!1,zr=!1,Yl=0,Eo=0,Da=null,xR=0;function xi(){throw Error(i(321))}function vu(n,l){if(l===null)return!1;for(var u=0;u<l.length&&u<n.length;u++)if(!_s(n[u],l[u]))return!1;return!0}function Tu(n,l,u,m,y,v){return Tn=v,yt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,z.H=n===null||n.memoizedState===null?ig:Uu,zr=!1,v=u(m,y),zr=!1,Ca&&(v=vm(l,u,m,y)),xm(n),v}function xm(n){z.H=Io;var l=Qt!==null&&Qt.next!==null;if(Tn=0,Ci=Qt=yt=null,jl=!1,Eo=0,Da=null,l)throw Error(i(300));n===null||Di||(n=n.dependencies,n!==null&&kl(n)&&(Di=!0))}function vm(n,l,u,m){yt=n;var y=0;do{if(Ca&&(Da=null),Eo=0,Ca=!1,25<=y)throw Error(i(301));if(y+=1,Ci=Qt=null,n.updateQueue!=null){var v=n.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}z.H=sg,v=l(u,m)}while(Ca);return v}function vR(){var n=z.H,l=n.useState()[0];return l=typeof l.then=="function"?Co(l):l,n=n.useState()[0],(Qt!==null?Qt.memoizedState:null)!==n&&(yt.flags|=1024),l}function Ru(){var n=Yl!==0;return Yl=0,n}function Au(n,l,u){l.updateQueue=n.updateQueue,l.flags&=-2053,n.lanes&=~u}function Mu(n){if(jl){for(n=n.memoizedState;n!==null;){var l=n.queue;l!==null&&(l.pending=null),n=n.next}jl=!1}Tn=0,Ci=Qt=yt=null,Ca=!1,Eo=Yl=0,Da=null}function Qi(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ci===null?yt.memoizedState=Ci=n:Ci=Ci.next=n,Ci}function Mi(){if(Qt===null){var n=yt.alternate;n=n!==null?n.memoizedState:null}else n=Qt.next;var l=Ci===null?yt.memoizedState:Ci.next;if(l!==null)Ci=l,Qt=n;else{if(n===null)throw yt.alternate===null?Error(i(467)):Error(i(310));Qt=n,n={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},Ci===null?yt.memoizedState=Ci=n:Ci=Ci.next=n}return Ci}function Kl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Co(n){var l=Eo;return Eo+=1,Da===null&&(Da=[]),n=um(Da,n,l),l=yt,(Ci===null?l.memoizedState:Ci.next)===null&&(l=l.alternate,z.H=l===null||l.memoizedState===null?ig:Uu),n}function Zl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Co(n);if(n.$$typeof===M)return Vi(n)}throw Error(i(438,String(n)))}function Su(n){var l=null,u=yt.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var m=yt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(l={data:m.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=Kl(),yt.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(n),m=0;m<n;m++)u[m]=L;return l.index++,u}function Rn(n,l){return typeof l=="function"?l(n):l}function Ql(n){var l=Mi();return Eu(l,Qt,n)}function Eu(n,l,u){var m=n.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=u;var y=n.baseQueue,v=m.pending;if(v!==null){if(y!==null){var P=y.next;
vendor: 10,839 bytes, line 49
49y.next=v.next,v.next=P}l.baseQueue=y=v,m.pending=null}if(v=n.baseState,y===null)n.memoizedState=v;else{l=y.next;var V=P=null,ee=null,ge=l,Re=!1;do{var Ce=ge.lane&-536870913;if(Ce!==ge.lane?(Et&Ce)===Ce:(Tn&Ce)===Ce){var ye=ge.revertLane;if(ye===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Ce===Ra&&(Re=!0);else if((Tn&ye)===ye){ge=ge.next,ye===Ra&&(Re=!0);continue}else Ce={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ee===null?(V=ee=Ce,P=v):ee=ee.next=Ce,yt.lanes|=ye,nr|=ye;Ce=ge.action,zr&&u(v,Ce),v=ge.hasEagerState?ge.eagerState:u(v,Ce)}else ye={lane:Ce,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ee===null?(V=ee=ye,P=v):ee=ee.next=ye,yt.lanes|=Ce,nr|=Ce;ge=ge.next}while(ge!==null&&ge!==l);if(ee===null?P=v:ee.next=V,!_s(v,n.memoizedState)&&(Di=!0,Re&&(u=Aa,u!==null)))throw u;n.memoizedState=v,n.baseState=P,n.baseQueue=ee,m.lastRenderedState=v}return y===null&&(m.lanes=0),[n.memoizedState,m.dispatch]}function Cu(n){var l=Mi(),u=l.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=n;var m=u.dispatch,y=u.pending,v=l.memoizedState;if(y!==null){u.pending=null;var P=y=y.next;do v=n(v,P.action),P=P.next;while(P!==y);_s(v,l.memoizedState)||(Di=!0),l.memoizedState=v,l.baseQueue===null&&(l.baseState=v),u.lastRenderedState=v}return[v,m]}function Tm(n,l,u){var m=yt,y=Mi(),v=It;if(v){if(u===void 0)throw Error(i(407));u=u()}else u=l();var P=!_s((Qt||y).memoizedState,u);if(P&&(y.memoizedState=u,Di=!0),y=y.queue,wu(Mm.bind(null,m,y,n),[n]),y.getSnapshot!==l||P||Ci!==null&&Ci.memoizedState.tag&1){if(m.flags|=2048,Ia(9,{destroy:void 0},Am.bind(null,m,y,u,l),null),si===null)throw Error(i(349));v||(Tn&127)!==0||Rm(m,l,u)}return u}function Rm(n,l,u){n.flags|=16384,n={getSnapshot:l,value:u},l=yt.updateQueue,l===null?(l=Kl(),yt.updateQueue=l,l.stores=[n]):(u=l.stores,u===null?l.stores=[n]:u.push(n))}function Am(n,l,u,m){l.value=u,l.getSnapshot=m,Sm(l)&&Em(n)}function Mm(n,l,u){return u(function(){Sm(l)&&Em(n)})}function Sm(n){var l=n.getSnapshot;n=n.value;try{var u=l();return!_s(n,u)}catch{return!0}}function Em(n){var l=wr(n,2);l!==null&&hs(l,n,2)}function Du(n){var l=Qi();if(typeof n=="function"){var u=n;if(n=u(),zr){mi(!0);try{u()}finally{mi(!1)}}}return l.memoizedState=l.baseState=n,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rn,lastRenderedState:n},l}function Cm(n,l,u,m){return n.baseState=u,Eu(n,Qt,typeof m=="function"?m:Rn)}function TR(n,l,u,m,y){if(ec(n))throw Error(i(485));if(n=l.action,n!==null){var v={payload:y,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(P){v.listeners.push(P)}};z.T!==null?u(!0):v.isTransition=!1,m(v),u=l.pending,u===null?(v.next=l.pending=v,Dm(l,v)):(v.next=u.next,l.pending=u.next=v)}}function Dm(n,l){var u=l.action,m=l.payload,y=n.state;if(l.isTransition){var v=z.T,P={};z.T=P;try{var V=u(y,m),ee=z.S;ee!==null&&ee(P,V),Im(n,l,V)}catch(ge){Iu(n,l,ge)}finally{v!==null&&P.types!==null&&(v.types=P.types),z.T=v}}else try{v=u(y,m),Im(n,l,v)}catch(ge){Iu(n,l,ge)}}function Im(n,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){wm(n,l,m)},function(m){return Iu(n,l,m)}):wm(n,l,u)}function wm(n,l,u){l.status="fulfilled",l.value=u,Pm(l),n.state=u,l=n.pending,l!==null&&(u=l.next,u===l?n.pending=null:(u=u.next,l.next=u,Dm(n,u)))}function Iu(n,l,u){var m=n.pending;if(n.pending=null,m!==null){m=m.next;do l.status="rejected",l.reason=u,Pm(l),l=l.next;while(l!==m)}n.action=null}function Pm(n){n=n.listeners;for(var l=0;l<n.length;l++)(0,n[l])()}function Om(n,l){return l}function Fm(n,l){if(It){var u=si.formState;if(u!==null){e:{var m=yt;if(It){if(hi){t:{for(var y=hi,v=Fs;y.nodeType!==8;){if(!v){y=null;break t}if(y=Ls(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){hi=Ls(y.nextSibling),m=y.data==="F!";break e}}Kn(m)}m=!1}m&&(l=u[0])}}return u=Qi(),u.memoizedState=u.baseState=l,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Om,lastRenderedState:l},u.queue=m,u=Jm.bind(null,yt,m),m.dispatch=u,m=Du(!1),v=Lu.bind(null,yt,!1,m.queue),m=Qi(),y={state:l,dispatch:null,action:n,pending:null},m.queue=y,u=TR.bind(null,yt,y,v,u),y.dispatch=u,m.memoizedState=n,[l,u,!1]}function Bm(n){var l=Mi();return Lm(l,Qt,n)}function Lm(n,l,u){if(l=Eu(n,l,Om)[0],n=Ql(Rn)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var m=Co(l)}catch(P){throw P===Ma?Vl:P}else m=l;l=Mi();var y=l.queue,v=y.dispatch;return u!==l.memoizedState&&(yt.flags|=2048,Ia(9,{destroy:void 0},RR.bind(null,y,u),null)),[m,v,n]}function RR(n,l){n.action=l}function Um(n){var l=Mi(),u=Qt;if(u!==null)return Lm(l,u,n);Mi(),l=l.memoizedState,u=Mi();var m=u.queue.dispatch;return u.memoizedState=n,[l,m,!1]}function Ia(n,l,u,m){return n={tag:n,create:u,deps:m,inst:l,next:null},l=yt.updateQueue,l===null&&(l=Kl(),yt.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=n.next=n:(m=u.next,u.next=n,n.next=m,l.lastEffect=n),n}function km(){return Mi().memoizedState}function $l(n,l,u,m){var y=Qi();yt.flags|=n,y.memoizedState=Ia(1|l,{destroy:void 0},u,m===void 0?null:m)}function Jl(n,l,u,m){var y=Mi();m=m===void 0?null:m;var v=y.memoizedState.inst;Qt!==null&&m!==null&&vu(m,Qt.memoizedState.deps)?y.memoizedState=Ia(l,v,u,m):(yt.flags|=n,y.memoizedState=Ia(1|l,v,u,m))}function Nm(n,l){$l(8390656,8,n,l)}function wu(n,l){Jl(2048,8,n,l)}function AR(n){yt.flags|=4;var l=yt.updateQueue;if(l===null)l=Kl(),yt.updateQueue=l,l.events=[n];else{var u=l.events;u===null?l.events=[n]:u.push(n)}}function zm(n){var l=Mi().memoizedState;return AR({ref:l,nextImpl:n}),function(){if((Vt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function Vm(n,l){return Jl(4,2,n,l)}function Gm(n,l){return Jl(4,4,n,l)}function Hm(n,l){if(typeof l=="function"){n=n();var u=l(n);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return n=n(),l.current=n,function(){l.current=null}}function Wm(n,l,u){u=u!=null?u.concat([n]):null,Jl(4,4,Hm.bind(null,l,n),u)}function Pu(){}function Xm(n,l){var u=Mi();l=l===void 0?null:l;var m=u.memoizedState;return l!==null&&vu(l,m[1])?m[0]:(u.memoizedState=[n,l],n)}function qm(n,l){var u=Mi();l=l===void 0?null:l;var m=u.memoizedState;if(l!==null&&vu(l,m[1]))return m[0];if(m=n(),zr){mi(!0);try{n()}finally{mi(!1)}}return u.memoizedState=[m,l],m}function Ou(n,l,u){return u===void 0||(Tn&1073741824)!==0&&(Et&261930)===0?n.memoizedState=l:(n.memoizedState=u,n=jg(),yt.lanes|=n,nr|=n,u)}function jm(n,l,u,m){return _s(u,l)?u:Ea.current!==null?(n=Ou(n,u,m),_s(n,l)||(Di=!0),n):(Tn&42)===0||(Tn&1073741824)!==0&&(Et&261930)===0?(Di=!0,n.memoizedState=u):(n=jg(),yt.lanes|=n,nr|=n,l)}function Ym(n,l,u,m,y){var v=X.p;X.p=v!==0&&8>v?v:8;var P=z.T,V={};z.T=V,Lu(n,!1,l,u);try{var ee=y(),ge=z.S;if(ge!==null&&ge(V,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var Re=bR(ee,m);Do(n,l,Re,xs(n))}else Do(n,l,m,xs(n))}catch(Ce){Do(n,l,{then:function(){},status:"rejected",reason:Ce},xs())}finally{X.p=v,P!==null&&V.types!==null&&(P.types=V.types),z.T=P}}function MR(){}function Fu(n,l,u,m){if(n.tag!==5)throw Error(i(476));var y=Km(n).queue;Ym(n,y,l,q,u===null?MR:function(){return Zm(n),u(m)})}function Km(n){var l=n.memoizedState;if(l!==null)return l;l={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rn,lastRenderedState:q},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rn,lastRenderedState:u},next:null},n.memoizedState=l,n=n.alternate,n!==null&&(n.memoizedState=l),l}function Zm(n){var l=Km(n);l.next===null&&(l=n.alternate.memoizedState),Do(n,l.next.queue,{},xs())}function Bu(){return Vi(qo)}function Qm(){return Mi().memoizedState}function $m(){return Mi().memoizedState}function SR(n){for(var l=n.return;l!==null;){switch(l.tag){case 24:case 3:var u=xs();n=$n(u);var m=Jn(l,n,u);m!==null&&(hs(m,l,u),Ao(m,l,u)),l={cache:hu()},n.payload=l;return}l=l.return}}function ER(n,l,u){var m=xs();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ec(n)?eg(l,u):(u=Jh(n,l,u,m),u!==null&&(hs(u,n,m),tg(u,l,m)))}function Jm(n,l,u){var m=xs();Do(n,l,u,m)}function Do(n,l,u,m){var y={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(ec(n))eg(l,y);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=l.lastRenderedReducer,v!==null))try{var P=l.lastRenderedState,V=v(P,u);if(y.hasEagerState=!0,y.eagerState=V,_s(V,P))return Fl(n,l,y,0),si===null&&Ol(),!1}catch{}finally{}if(u=Jh(n,l,y,m),u!==null)return hs(u,n,m),tg(u,l,m),!0}return!1}function Lu(n,l,u,m){if(m={lane:2,revertLane:mf(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},ec(n)){if(l)throw Error(i(479))}else l=Jh(n,u,m,2),l!==null&&hs(l,n,2)}function ec(n){var l=n.alternate;return n===yt||l!==null&&l===yt}function eg(n,l){Ca=jl=!0;var u=n.pending;u===null?l.next=l:(l.next=u.next,u.next=l),n.pending=l}function tg(n,l,u){if((u&4194048)!==0){var m=l.lanes;m&=n.pendingLanes,u|=m,l.lanes=u,Wt(n,u)}}var Io={readContext:Vi,use:Zl,useCallback:xi,useContext:xi,useEffect:xi,useImperativeHandle:xi,useLayoutEffect:xi,useInsertionEffect:xi,useMemo:xi,useReducer:xi,useRef:xi,useState:xi,useDebugValue:xi,useDeferredValue:xi,useTransition:xi,useSyncExternalStore:xi,useId:xi,useHostTransitionStatus:xi,useFormState:xi,useActionState:xi,useOptimistic:xi,useMemoCache:xi,useCacheRefresh:xi};Io.useEffectEvent=xi;var ig={readContext:Vi,use:Zl,useCallback:function(n,l){return Qi().memoizedState=[n,l===void 0?null:l],n},useContext:Vi,useEffect:Nm,useImperativeHandle:function(n,l,u){u=u!=null?u.concat([n]):null,$l(4194308,4,Hm.bind(null,l,n),u)},useLayoutEffect:function(n,l){return $l(4194308,4,n,l)},useInsertionEffect:function(n,l){$l(4,2,n,l)},useMemo:function(n,l){var u=Qi();l=l===void 0?null:l;var m=n();if(zr){mi(!0);try{n()}finally{mi(!1)}}return u.memoizedState=[m,l],m},useReducer:function(n,l,u){var m=Qi();if(u!==void 0){var y=u(l);if(zr){mi(!0);try{u(l)}finally{mi(!1)}}}else y=l;return m.memoizedState=m.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},m.queue=n,n=n.dispatch=ER.bind(null,yt,n),[m.memoizedState,n]},useRef:function(n){var l=Qi();return n={current:n},l.memoizedState=n},useState:function(n){n=Du(n);var l=n.queue,u=Jm.bind(null,yt,l);return l.dispatch=u,[n.memoizedState,u]},useDebugValue:Pu,useDeferredValue:function(n,l){var u=Qi();return Ou(u,n,l)},useTransition:function(){var n=Du(!1);return n=Ym.bind(null,yt,n.queue,!0,!1),Qi().memoizedState=n,[!1,n]}
vendor: 16,266 bytes, line 49
49,useSyncExternalStore:function(n,l,u){var m=yt,y=Qi();if(It){if(u===void 0)throw Error(i(407));u=u()}else{if(u=l(),si===null)throw Error(i(349));(Et&127)!==0||Rm(m,l,u)}y.memoizedState=u;var v={value:u,getSnapshot:l};return y.queue=v,Nm(Mm.bind(null,m,v,n),[n]),m.flags|=2048,Ia(9,{destroy:void 0},Am.bind(null,m,v,u,l),null),u},useId:function(){var n=Qi(),l=si.identifierPrefix;if(It){var u=Qs,m=Zs;u=(m&~(1<<32-gi(m)-1)).toString(32)+u,l="_"+l+"R_"+u,u=Yl++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=xR++,l="_"+l+"r_"+u.toString(32)+"_";return n.memoizedState=l},useHostTransitionStatus:Bu,useFormState:Fm,useActionState:Fm,useOptimistic:function(n){var l=Qi();l.memoizedState=l.baseState=n;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Lu.bind(null,yt,!0,u),u.dispatch=l,[n,l]},useMemoCache:Su,useCacheRefresh:function(){return Qi().memoizedState=SR.bind(null,yt)},useEffectEvent:function(n){var l=Qi(),u={impl:n};return l.memoizedState=u,function(){if((Vt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Uu={readContext:Vi,use:Zl,useCallback:Xm,useContext:Vi,useEffect:wu,useImperativeHandle:Wm,useInsertionEffect:Vm,useLayoutEffect:Gm,useMemo:qm,useReducer:Ql,useRef:km,useState:function(){return Ql(Rn)},useDebugValue:Pu,useDeferredValue:function(n,l){var u=Mi();return jm(u,Qt.memoizedState,n,l)},useTransition:function(){var n=Ql(Rn)[0],l=Mi().memoizedState;return[typeof n=="boolean"?n:Co(n),l]},useSyncExternalStore:Tm,useId:Qm,useHostTransitionStatus:Bu,useFormState:Bm,useActionState:Bm,useOptimistic:function(n,l){var u=Mi();return Cm(u,Qt,n,l)},useMemoCache:Su,useCacheRefresh:$m};Uu.useEffectEvent=zm;var sg={readContext:Vi,use:Zl,useCallback:Xm,useContext:Vi,useEffect:wu,useImperativeHandle:Wm,useInsertionEffect:Vm,useLayoutEffect:Gm,useMemo:qm,useReducer:Cu,useRef:km,useState:function(){return Cu(Rn)},useDebugValue:Pu,useDeferredValue:function(n,l){var u=Mi();return Qt===null?Ou(u,n,l):jm(u,Qt.memoizedState,n,l)},useTransition:function(){var n=Cu(Rn)[0],l=Mi().memoizedState;return[typeof n=="boolean"?n:Co(n),l]},useSyncExternalStore:Tm,useId:Qm,useHostTransitionStatus:Bu,useFormState:Um,useActionState:Um,useOptimistic:function(n,l){var u=Mi();return Qt!==null?Cm(u,Qt,n,l):(u.baseState=n,[n,u.queue.dispatch])},useMemoCache:Su,useCacheRefresh:$m};sg.useEffectEvent=zm;function ku(n,l,u,m){l=n.memoizedState,u=u(m,l),u=u==null?l:d({},l,u),n.memoizedState=u,n.lanes===0&&(n.updateQueue.baseState=u)}var Nu={enqueueSetState:function(n,l,u){n=n._reactInternals;var m=xs(),y=$n(m);y.payload=l,u!=null&&(y.callback=u),l=Jn(n,y,m),l!==null&&(hs(l,n,m),Ao(l,n,m))},enqueueReplaceState:function(n,l,u){n=n._reactInternals;var m=xs(),y=$n(m);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=Jn(n,y,m),l!==null&&(hs(l,n,m),Ao(l,n,m))},enqueueForceUpdate:function(n,l){n=n._reactInternals;var u=xs(),m=$n(u);m.tag=2,l!=null&&(m.callback=l),l=Jn(n,m,u),l!==null&&(hs(l,n,u),Ao(l,n,u))}};function ng(n,l,u,m,y,v,P){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(m,v,P):l.prototype&&l.prototype.isPureReactComponent?!go(u,m)||!go(y,v):!0}function rg(n,l,u,m){n=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,m),l.state!==n&&Nu.enqueueReplaceState(l,l.state,null)}function Vr(n,l){var u=l;if("ref"in l){u={};for(var m in l)m!=="ref"&&(u[m]=l[m])}if(n=n.defaultProps){u===l&&(u=d({},u));for(var y in n)u[y]===void 0&&(u[y]=n[y])}return u}function ag(n){Pl(n)}function og(n){console.error(n)}function lg(n){Pl(n)}function tc(n,l){try{var u=n.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(m){setTimeout(function(){throw m})}}function cg(n,l,u){try{var m=n.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function zu(n,l,u){return u=$n(u),u.tag=3,u.payload={element:null},u.callback=function(){tc(n,l)},u}function hg(n){return n=$n(n),n.tag=3,n}function ug(n,l,u,m){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var v=m.value;n.payload=function(){return y(v)},n.callback=function(){cg(l,u,m)}}var P=u.stateNode;P!==null&&typeof P.componentDidCatch=="function"&&(n.callback=function(){cg(l,u,m),typeof y!="function"&&(rr===null?rr=new Set([this]):rr.add(this));var V=m.stack;this.componentDidCatch(m.value,{componentStack:V!==null?V:""})})}function CR(n,l,u,m,y){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(l=u.alternate,l!==null&&Ta(l,u,y,!0),u=gs.current,u!==null){switch(u.tag){case 31:case 13:return Bs===null?dc():u.alternate===null&&vi===0&&(vi=3),u.flags&=-257,u.flags|=65536,u.lanes=y,m===Gl?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([m]):l.add(m),ff(n,m,y)),!1;case 22:return u.flags|=65536,m===Gl?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([m]):u.add(m)),ff(n,m,y)),!1}throw Error(i(435,u.tag))}return ff(n,m,y),dc(),!1}if(It)return l=gs.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,m!==ru&&(n=Error(i(422),{cause:m}),bo(ws(n,u)))):(m!==ru&&(l=Error(i(423),{cause:m}),bo(ws(l,u))),n=n.current.alternate,n.flags|=65536,y&=-y,n.lanes|=y,m=ws(m,u),y=zu(n.stateNode,m,y),gu(n,y),vi!==4&&(vi=2)),!1;var v=Error(i(520),{cause:m});if(v=ws(v,u),ko===null?ko=[v]:ko.push(v),vi!==4&&(vi=2),l===null)return!0;m=ws(m,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,n=y&-y,u.lanes|=n,n=zu(u.stateNode,m,n),gu(u,n),!1;case 1:if(l=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(rr===null||!rr.has(v))))return u.flags|=65536,y&=-y,u.lanes|=y,y=hg(y),ug(y,n,u,m),gu(u,y),!1}u=u.return}while(u!==null);return!1}var Vu=Error(i(461)),Di=!1;function Gi(n,l,u,m){l.child=n===null?mm(l,null,u,m):Nr(l,n.child,u,m)}function fg(n,l,u,m,y){u=u.render;var v=l.ref;if("ref"in m){var P={};for(var V in m)V!=="ref"&&(P[V]=m[V])}else P=m;return Br(l),m=Tu(n,l,u,P,v,y),V=Ru(),n!==null&&!Di?(Au(n,l,y),An(n,l,y)):(It&&V&&su(l),l.flags|=1,Gi(n,l,m,y),l.child)}function dg(n,l,u,m,y){if(n===null){var v=u.type;return typeof v=="function"&&!eu(v)&&v.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=v,_g(n,l,v,m,y)):(n=Ll(u.type,null,m,l,l.mode,y),n.ref=l.ref,n.return=l,l.child=n)}if(v=n.child,!Ku(n,y)){var P=v.memoizedProps;if(u=u.compare,u=u!==null?u:go,u(P,m)&&n.ref===l.ref)return An(n,l,y)}return l.flags|=1,n=yn(v,m),n.ref=l.ref,n.return=l,l.child=n}function _g(n,l,u,m,y){if(n!==null){var v=n.memoizedProps;if(go(v,m)&&n.ref===l.ref)if(Di=!1,l.pendingProps=m=v,Ku(n,y))(n.flags&131072)!==0&&(Di=!0);else return l.lanes=n.lanes,An(n,l,y)}return Gu(n,l,u,m,y)}function mg(n,l,u,m){var y=m.children,v=n!==null?n.memoizedState:null;if(n===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((l.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,n!==null){for(m=l.child=n.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~v}else m=0,l.child=null;return gg(n,l,v,u,m)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},n!==null&&zl(l,v!==null?v.cachePool:null),v!==null?ym(l,v):yu(),bm(l);else return m=l.lanes=536870912,gg(n,l,v!==null?v.baseLanes|u:u,u,m)}else v!==null?(zl(l,v.cachePool),ym(l,v),tr(),l.memoizedState=null):(n!==null&&zl(l,null),yu(),tr());return Gi(n,l,y,u),l.child}function wo(n,l){return n!==null&&n.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function gg(n,l,u,m,y){var v=fu();return v=v===null?null:{parent:Ei._currentValue,pool:v},l.memoizedState={baseLanes:u,cachePool:v},n!==null&&zl(l,null),yu(),bm(l),n!==null&&Ta(n,l,m,!0),l.childLanes=y,null}function ic(n,l){return l=nc({mode:l.mode,children:l.children},n.mode),l.ref=n.ref,n.child=l,l.return=n,l}function pg(n,l,u){return Nr(l,n.child,null,u),n=ic(l,l.pendingProps),n.flags|=2,ps(l),l.memoizedState=null,n}function DR(n,l,u){var m=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,n===null){if(It){if(m.mode==="hidden")return n=ic(l,m),l.lanes=536870912,wo(null,n);if(xu(l),(n=hi)?(n=Dp(n,Fs),n=n!==null&&n.data==="&"?n:null,n!==null&&(l.memoizedState={dehydrated:n,treeContext:jn!==null?{id:Zs,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},u=em(n),u.return=l,l.child=u,zi=l,hi=null)):n=null,n===null)throw Kn(l);return l.lanes=536870912,null}return ic(l,m)}var v=n.memoizedState;if(v!==null){var P=v.dehydrated;if(xu(l),y)if(l.flags&256)l.flags&=-257,l=pg(n,l,u);else if(l.memoizedState!==null)l.child=n.child,l.flags|=128,l=null;else throw Error(i(558));else if(Di||Ta(n,l,u,!1),y=(u&n.childLanes)!==0,Di||y){if(m=si,m!==null&&(P=bi(m,u),P!==0&&P!==v.retryLane))throw v.retryLane=P,wr(n,P),hs(m,n,P),Vu;dc(),l=pg(n,l,u)}else n=v.treeContext,hi=Ls(P.nextSibling),zi=l,It=!0,Yn=null,Fs=!1,n!==null&&sm(l,n),l=ic(l,m),l.flags|=4096;return l}return n=yn(n.child,{mode:m.mode,children:m.children}),n.ref=l.ref,l.child=n,n.return=l,n}function sc(n,l){var u=l.ref;if(u===null)n!==null&&n.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(n===null||n.ref!==u)&&(l.flags|=4194816)}}function Gu(n,l,u,m,y){return Br(l),u=Tu(n,l,u,m,void 0,y),m=Ru(),n!==null&&!Di?(Au(n,l,y),An(n,l,y)):(It&&m&&su(l),l.flags|=1,Gi(n,l,u,y),l.child)}function yg(n,l,u,m,y,v){return Br(l),l.updateQueue=null,u=vm(l,m,u,y),xm(n),m=Ru(),n!==null&&!Di?(Au(n,l,v),An(n,l,v)):(It&&m&&su(l),l.flags|=1,Gi(n,l,u,v),l.child)}function bg(n,l,u,m,y){if(Br(l),l.stateNode===null){var v=ya,P=u.contextType;typeof P=="object"&&P!==null&&(v=Vi(P)),v=new u(m,v),l.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Nu,l.stateNode=v,v._reactInternals=l,v=l.stateNode,v.props=m,v.state=l.memoizedState,v.refs={},_u(l),P=u.contextType,v.context=typeof P=="object"&&P!==null?Vi(P):ya,v.state=l.memoizedState,P=u.getDerivedStateFromProps,typeof P=="function"&&(ku(l,u,P,m),v.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(P=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),P!==v.state&&Nu.enqueueReplaceState(v,v.state,null),So(l,m,v,y),Mo(),v.state=l.memoizedState),typeof v.componentDidMount=="function"&&(l.flags|=4194308),m=!0}else if(n===null){v=l.stateNode;var V=l.memoizedProps,ee=Vr(u,V);v.props=ee;var ge=v.context,Re=u.contextType;P=ya,typeof Re=="object"&&Re!==null&&(P=Vi(Re));var Ce=u.getDerivedStateFromProps;Re=typeof Ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",V=l.pendingProps!==V,Re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(V||ge!==P)&&rg(l,v,m,P),Qn=!1;var ye=l.memoizedState;v.state=ye,So(l,m,v,y),Mo(),ge=l.memoizedState,V||ye!==ge||Qn?(typeof Ce=="function"&&(ku(l,u,Ce,m),ge=l.memoizedState),(ee=Qn||ng(l,u,ee,m,ye,ge,P))?(Re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(l.flags|=4194308)):(typeof v.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=ge),v.props=m,v.state=ge,v.context=P,m=ee):(typeof v.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{v=l.stateNode,mu(n,l),P=l.memoizedProps,Re=Vr(u,P),v.props=Re,Ce=l.pendingProps,ye=v.context,ge=u.contextType,ee=ya,typeof ge=="object"&&ge!==null&&(ee=Vi(ge)),V=u.getDerivedStateFromProps,(ge=typeof V=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P!==Ce||ye!==ee)&&rg(l,v,m,ee),Qn=!1,ye=l.memoizedState,v.state=ye,So(l,m,v,y),Mo();var ve=l.memoizedState;P!==Ce||ye!==ve||Qn||n!==null&&n.dependencies!==null&&kl(n.dependencies)?(typeof V=="function"&&(ku(l,u,V,m),ve=l.memoizedState),(Re=Qn||ng(l,u,Re,m,ye,ve,ee)||n!==null&&n.dependencies!==null&&kl(n.dependencies))?(ge||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(m,ve,ee),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(m,ve,ee)),typeof v.componentDidUpdate=="function"&&(l.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof v.componentDidUpdate!="function"||P===n.memoizedProps&&ye===n.memoizedState||(l.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||P===n.memoizedProps&&ye===n.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=ve),v.props=m,v.state=ve,v.context=ee,m=Re):(typeof v.componentDidUpdate!="function"||P===n.memoizedProps&&ye===n.memoizedState||(l.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||P===n.memoizedProps&&ye===n.memoizedState||(l.flags|=1024),m=!1)}return v=m,sc(n,l),m=(l.flags&128)!==0,v||m?(v=l.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:v.render(),l.flags|=1,n!==null&&m?(l.child=Nr(l,n.child,null,y),l.child=Nr(l,null,u,y)):Gi(n,l,u,y),l.memoizedState=v.state,n=l.child):n=An(n,l,y),n}function xg(n,l,u,m){return Or(),l.flags|=256,Gi(n,l,u,m),l.child}var Hu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wu(n){return{baseLanes:n,cachePool:cm()}}function Xu(n,l,u){return n=n!==null?n.childLanes&~u:0,l&&(n|=bs),n}function vg(n,l,u){var m=l.pendingProps,y=!1,v=(l.flags&128)!==0,P;if((P=v)||(P=n!==null&&n.memoizedState===null?!1:(Ai.current&2)!==0),P&&(y=!0,l.flags&=-129),P=(l.flags&32)!==0,l.flags&=-33,n===null){if(It){if(y?er(l):tr(),(n=hi)?(n=Dp(n,Fs),n=n!==null&&n.data!=="&"?n:null,n!==null&&(l.memoizedState={dehydrated:n,treeContext:jn!==null?{id:Zs,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},u=em(n),u.return=l,l.child=u,zi=l,hi=null)):n=null,n===null)throw Kn(l);return Cf(n)?l.lanes=32:l.lanes=536870912,null}var V=m.children;return m=m.fallback,y?(tr(),y=l.mode,V=nc({mode:"hidden",children:V},y),m=Pr(m,y,u,null),V.return=l,m.return=l,V.sibling=m,l.child=V,m=l.child,m.memoizedState=Wu(u),m.childLanes=Xu(n,P,u),l.memoizedState=Hu,wo(null,m)):(er(l),qu(l,V))}var ee=n.memoizedState;if(ee!==null&&(V=ee.dehydrated,V!==null)){if(v)l.flags&256?(er(l),l.flags&=-257,l=ju(n,l,u)):l.memoizedState!==null?(tr(),l.child=n.child,l.flags|=128,l=null):(tr(),V=m.fallback,y=l.mode,m=nc({mode:"visible",children:m.children},y),V=Pr(V,y,u,null),V.flags|=2,m.return=l,V.return=l,m.sibling=V,l.child=m,Nr(l,n.child,null,u),m=l.child,m.memoizedState=Wu(u),m.childLanes=Xu(n,P,u),l.memoizedState=Hu,l=wo(null,m));else if(er(l),Cf(V)){if(P=V.nextSibling&&V.nextSibling.dataset,P)var ge=P.dgst;P=ge,m=Error(i(419)),m.stack="",m.digest=P,bo({value:m,source:null,stack:null}),l=ju(n,l,u)}else if(Di||Ta(n,l,u,!1),P=(u&n.childLanes)!==0,Di||P){if(P=si,P!==null&&(m=bi(P,u),m!==0&&m!==ee.retryLane))throw ee.retryLane=m,wr(n,m),hs(P,n,m),Vu;Ef(V)||dc(),l=ju(n,l,u)}else Ef(V)?(l.flags|=192,l.child=n.child,l=null):(n=ee.treeContext,hi=Ls(V.nextSibling),zi=l,It=!0,Yn=null,Fs=!1,n!==null&&sm(l,n),l=qu(l,m.children),l.flags|=4096);return l}return y?(tr(),V=m.fallback,y=l.mode,ee=n.child,ge=ee.sibling,m=yn(ee,{mode:"hidden",children:m.children}),m.subtreeFlags=ee.subtreeFlags&65011712,ge!==null?V=yn(ge,V):(V=Pr(V,y,u,null),V.flags|=2),V.return=l,m.return=l,m.sibling=V,l.child=m,wo(null,m),m=l.child,V=n.child.memoizedState,V===null?V=Wu(u):(y=V.cachePool,y!==null?(ee=Ei._currentValue,y=y.parent!==ee?{parent:ee,pool:ee}:y):y=cm(),V={baseLanes:V.baseLanes|u,cachePool:y}),m.memoizedState=V,m.childLanes=Xu(n,P,u),l.memoizedState=Hu,wo(n.child,m)):(er(l),u=n.child,n=u.sibling,u=yn(u,{mode:"visible",children:m.children}
vendor: 6,075 bytes, line 49
49),u.return=l,u.sibling=null,n!==null&&(P=l.deletions,P===null?(l.deletions=[n],l.flags|=16):P.push(n)),l.child=u,l.memoizedState=null,u)}function qu(n,l){return l=nc({mode:"visible",children:l},n.mode),l.return=n,n.child=l}function nc(n,l){return n=ms(22,n,null,l),n.lanes=0,n}function ju(n,l,u){return Nr(l,n.child,null,u),n=qu(l,l.pendingProps.children),n.flags|=2,l.memoizedState=null,n}function Tg(n,l,u){n.lanes|=l;var m=n.alternate;m!==null&&(m.lanes|=l),lu(n.return,l,u)}function Yu(n,l,u,m,y,v){var P=n.memoizedState;P===null?n.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:y,treeForkCount:v}:(P.isBackwards=l,P.rendering=null,P.renderingStartTime=0,P.last=m,P.tail=u,P.tailMode=y,P.treeForkCount=v)}function Rg(n,l,u){var m=l.pendingProps,y=m.revealOrder,v=m.tail;m=m.children;var P=Ai.current,V=(P&2)!==0;if(V?(P=P&1|2,l.flags|=128):P&=1,U(Ai,P),Gi(n,l,m,u),m=It?yo:0,!V&&n!==null&&(n.flags&128)!==0)e:for(n=l.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Tg(n,u,l);else if(n.tag===19)Tg(n,u,l);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===l)break e;for(;n.sibling===null;){if(n.return===null||n.return===l)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)n=u.alternate,n!==null&&ql(n)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),Yu(l,!1,y,u,v,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(n=y.alternate,n!==null&&ql(n)===null){l.child=y;break}n=y.sibling,y.sibling=u,u=y,y=n}Yu(l,!0,u,null,v,m);break;case"together":Yu(l,!1,null,null,void 0,m);break;default:l.memoizedState=null}return l.child}function An(n,l,u){if(n!==null&&(l.dependencies=n.dependencies),nr|=l.lanes,(u&l.childLanes)===0)if(n!==null){if(Ta(n,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(n!==null&&l.child!==n.child)throw Error(i(153));if(l.child!==null){for(n=l.child,u=yn(n,n.pendingProps),l.child=u,u.return=l;n.sibling!==null;)n=n.sibling,u=u.sibling=yn(n,n.pendingProps),u.return=l;u.sibling=null}return l.child}function Ku(n,l){return(n.lanes&l)!==0?!0:(n=n.dependencies,!!(n!==null&&kl(n)))}function IR(n,l,u){switch(l.tag){case 3:Ee(l,l.stateNode.containerInfo),Zn(l,Ei,n.memoizedState.cache),Or();break;case 27:case 5:Y(l);break;case 4:Ee(l,l.stateNode.containerInfo);break;case 10:Zn(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,xu(l),null;break;case 13:var m=l.memoizedState;if(m!==null)return m.dehydrated!==null?(er(l),l.flags|=128,null):(u&l.child.childLanes)!==0?vg(n,l,u):(er(l),n=An(n,l,u),n!==null?n.sibling:null);er(l);break;case 19:var y=(n.flags&128)!==0;if(m=(u&l.childLanes)!==0,m||(Ta(n,l,u,!1),m=(u&l.childLanes)!==0),y){if(m)return Rg(n,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),U(Ai,Ai.current),m)break;return null;case 22:return l.lanes=0,mg(n,l,u,l.pendingProps);case 24:Zn(l,Ei,n.memoizedState.cache)}return An(n,l,u)}function Ag(n,l,u){if(n!==null)if(n.memoizedProps!==l.pendingProps)Di=!0;else{if(!Ku(n,u)&&(l.flags&128)===0)return Di=!1,IR(n,l,u);Di=(n.flags&131072)!==0}else Di=!1,It&&(l.flags&1048576)!==0&&im(l,yo,l.index);switch(l.lanes=0,l.tag){case 16:e:{var m=l.pendingProps;if(n=Ur(l.elementType),l.type=n,typeof n=="function")eu(n)?(m=Vr(n,m),l.tag=1,l=bg(null,l,n,m,u)):(l.tag=0,l=Gu(null,l,n,m,u));else{if(n!=null){var y=n.$$typeof;if(y===I){l.tag=11,l=fg(null,l,n,m,u);break e}else if(y===C){l.tag=14,l=dg(null,l,n,m,u);break e}}throw l=B(n)||n,Error(i(306,l,""))}}return l;case 0:return Gu(n,l,l.type,l.pendingProps,u);case 1:return m=l.type,y=Vr(m,l.pendingProps),bg(n,l,m,y,u);case 3:e:{if(Ee(l,l.stateNode.containerInfo),n===null)throw Error(i(387));m=l.pendingProps;var v=l.memoizedState;y=v.element,mu(n,l),So(l,m,null,u);var P=l.memoizedState;if(m=P.cache,Zn(l,Ei,m),m!==v.cache&&cu(l,[Ei],u,!0),Mo(),m=P.element,v.isDehydrated)if(v={element:m,isDehydrated:!1,cache:P.cache},l.updateQueue.baseState=v,l.memoizedState=v,l.flags&256){l=xg(n,l,m,u);break e}else if(m!==y){y=ws(Error(i(424)),l),bo(y),l=xg(n,l,m,u);break e}else{switch(n=l.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(hi=Ls(n.firstChild),zi=l,It=!0,Yn=null,Fs=!0,u=mm(l,null,m,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Or(),m===y){l=An(n,l,u);break e}Gi(n,l,m,u)}l=l.child}return l;case 26:return sc(n,l),n===null?(u=Bp(l.type,null,l.pendingProps,null))?l.memoizedState=u:It||(u=l.type,n=l.pendingProps,m=xc(le.current).createElement(u),m[Ni]=l,m[ns]=n,Hi(m,u,n),Ui(m),l.stateNode=m):l.memoizedState=Bp(l.type,n.memoizedProps,l.pendingProps,n.memoizedState),null;case 27:return Y(l),n===null&&It&&(m=l.stateNode=Pp(l.type,l.pendingProps,le.current),zi=l,Fs=!0,y=hi,cr(l.type)?(Df=y,hi=Ls(m.firstChild)):hi=y),Gi(n,l,l.pendingProps.children,u),sc(n,l),n===null&&(l.flags|=4194304),l.child;case 5:return n===null&&It&&((y=m=hi)&&(m=aA(m,l.type,l.pendingProps,Fs),m!==null?(l.stateNode=m,zi=l,hi=Ls(m.firstChild),Fs=!1,y=!0):y=!1),y||Kn(l)),Y(l),y=l.type,v=l.pendingProps,P=n!==null?n.memoizedProps:null,m=v.children,Af(y,v)?m=null:P!==null&&Af(y,P)&&(l.flags|=32),l.memoizedState!==null&&(y=Tu(n,l,vR,null,null,u),qo._currentValue=y),sc(n,l),Gi(n,l,m,u),l.child;case 6:return n===null&&It&&((n=u=hi)&&(u=oA(u,l.pendingProps,Fs),u!==null?(l.stateNode=u,zi=l,hi=null,n=!0):n=!1),n||Kn(l)),null;case 13:return vg(n,l,u);case 4:return Ee(l,l.stateNode.containerInfo),m=l.pendingProps,n===null?l.child=Nr(l,null,m,u):Gi(n,l,m,u),l.child;case 11:return fg(n,l,l.type,l.pendingProps,u);case 7:return Gi(n,l,l.pendingProps,u),l.child;case 8:return Gi(n,l,l.pendingProps.children,u),l.child;case 12:return Gi(n,l,l.pendingProps.children,u),l.child;case 10:return m=l.pendingProps,Zn(l,l.type,m.value),Gi(n,l,m.children,u),l.child;case 9:return y=l.type._context,m=l.pendingProps.children,Br(l),y=Vi(y),m=m(y),l.flags|=1,Gi(n,l,m,u),l.child;
vendor: 4,422 bytes, line 49
49case 14:return dg(n,l,l.type,l.pendingProps,u);case 15:return _g(n,l,l.type,l.pendingProps,u);case 19:return Rg(n,l,u);case 31:return DR(n,l,u);case 22:return mg(n,l,u,l.pendingProps);case 24:return Br(l),m=Vi(Ei),n===null?(y=fu(),y===null&&(y=si,v=hu(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=u),y=v),l.memoizedState={parent:m,cache:y},_u(l),Zn(l,Ei,y)):((n.lanes&u)!==0&&(mu(n,l),So(l,null,null,u),Mo()),y=n.memoizedState,v=l.memoizedState,y.parent!==m?(y={parent:m,cache:m},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),Zn(l,Ei,m)):(m=v.cache,Zn(l,Ei,m),m!==y.cache&&cu(l,[Ei],u,!0))),Gi(n,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function Mn(n){n.flags|=4}function Zu(n,l,u,m,y){if((l=(n.mode&32)!==0)&&(l=!1),l){if(n.flags|=16777216,(y&335544128)===y)if(n.stateNode.complete)n.flags|=8192;else if(Qg())n.flags|=8192;else throw kr=Gl,du}else n.flags&=-16777217}function Mg(n,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!zp(l))if(Qg())n.flags|=8192;else throw kr=Gl,du}function rc(n,l){l!==null&&(n.flags|=4),n.flags&16384&&(l=n.tag!==22?xe():536870912,n.lanes|=l,Fa|=l)}function Po(n,l){if(!It)switch(n.tailMode){case"hidden":l=n.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?n.tail=null:u.sibling=null;break;case"collapsed":u=n.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l||n.tail===null?n.tail=null:n.tail.sibling=null:m.sibling=null}}function ui(n){var l=n.alternate!==null&&n.alternate.child===n.child,u=0,m=0;if(l)for(var y=n.child;y!==null;)u|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)u|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=m,n.childLanes=u,l}function wR(n,l,u){var m=l.pendingProps;switch(nu(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ui(l),null;case 1:return ui(l),null;case 3:return u=l.stateNode,m=null,n!==null&&(m=n.memoizedState.cache),l.memoizedState.cache!==m&&(l.flags|=2048),vn(Ei),Fe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(n===null||n.child===null)&&(va(l)?Mn(l):n===null||n.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,au())),ui(l),null;case 26:var y=l.type,v=l.memoizedState;return n===null?(Mn(l),v!==null?(ui(l),Mg(l,v)):(ui(l),Zu(l,y,null,m,u))):v?v!==n.memoizedState?(Mn(l),ui(l),Mg(l,v)):(ui(l),l.flags&=-16777217):(n=n.memoizedProps,n!==m&&Mn(l),ui(l),Zu(l,y,n,m,u)),null;case 27:if(ue(l),u=le.current,y=l.type,n!==null&&l.stateNode!=null)n.memoizedProps!==m&&Mn(l);else{if(!m){if(l.stateNode===null)throw Error(i(166));return ui(l),null}n=W.current,va(l)?nm(l):(n=Pp(y,m,u),l.stateNode=n,Mn(l))}return ui(l),null;case 5:if(ue(l),y=l.type,n!==null&&l.stateNode!=null)n.memoizedProps!==m&&Mn(l);else{if(!m){if(l.stateNode===null)throw Error(i(166));return ui(l),null}if(v=W.current,va(l))nm(l);else{var P=xc(le.current);switch(v){case 1:v=P.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:v=P.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":v=P.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":v=P.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":v=P.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof m.is=="string"?P.createElement("select",{is:m.is}):P.createElement("select"),m.multiple?v.multiple=!0:m.size&&(v.size=m.size);break;default:v=typeof m.is=="string"?P.createElement(y,{is:m.is}):P.createElement(y)}}v[Ni]=l,v[ns]=m;e:for(P=l.child;P!==null;){if(P.tag===5||P.tag===6)v.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===l)break e;for(;P.sibling===null;){if(P.return===null||P.return===l)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}l.stateNode=v;e:switch(Hi(v,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Mn(l)}}return ui(l),Zu(l,l.type,n===null?null:n.memoizedProps,l.pendingProps,u),null;case 6:if(n&&l.stateNode!=null)n.memoizedProps!==m&&Mn(l);else{if(typeof m!="string"&&l.stateNode===null)throw Error(i(166));
vendor: 22,798 bytes, line 49
49if(n=le.current,va(l)){if(n=l.stateNode,u=l.memoizedProps,m=null,y=zi,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}n[Ni]=l,n=!!(n.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||vp(n.nodeValue,u)),n||Kn(l,!0)}else n=xc(n).createTextNode(m),n[Ni]=l,l.stateNode=n}return ui(l),null;case 31:if(u=l.memoizedState,n===null||n.memoizedState!==null){if(m=va(l),u!==null){if(n===null){if(!m)throw Error(i(318));if(n=l.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Ni]=l}else Or(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;ui(l),n=!1}else u=au(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=u),n=!0;if(!n)return l.flags&256?(ps(l),l):(ps(l),null);if((l.flags&128)!==0)throw Error(i(558))}return ui(l),null;case 13:if(m=l.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=va(l),m!==null&&m.dehydrated!==null){if(n===null){if(!y)throw Error(i(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Ni]=l}else Or(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;ui(l),y=!1}else y=au(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(ps(l),l):(ps(l),null)}return ps(l),(l.flags&128)!==0?(l.lanes=u,l):(u=m!==null,n=n!==null&&n.memoizedState!==null,u&&(m=l.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),v=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(v=m.memoizedState.cachePool.pool),v!==y&&(m.flags|=2048)),u!==n&&u&&(l.child.flags|=8192),rc(l,l.updateQueue),ui(l),null);case 4:return Fe(),n===null&&bf(l.stateNode.containerInfo),ui(l),null;case 10:return vn(l.type),ui(l),null;case 19:if(O(Ai),m=l.memoizedState,m===null)return ui(l),null;if(y=(l.flags&128)!==0,v=m.rendering,v===null)if(y)Po(m,!1);else{if(vi!==0||n!==null&&(n.flags&128)!==0)for(n=l.child;n!==null;){if(v=ql(n),v!==null){for(l.flags|=128,Po(m,!1),n=v.updateQueue,l.updateQueue=n,rc(l,n),l.subtreeFlags=0,n=u,u=l.child;u!==null;)J_(u,n),u=u.sibling;return U(Ai,Ai.current&1|2),It&&bn(l,m.treeForkCount),l.child}n=n.sibling}m.tail!==null&&Pe()>hc&&(l.flags|=128,y=!0,Po(m,!1),l.lanes=4194304)}else{if(!y)if(n=ql(v),n!==null){if(l.flags|=128,y=!0,n=n.updateQueue,l.updateQueue=n,rc(l,n),Po(m,!0),m.tail===null&&m.tailMode==="hidden"&&!v.alternate&&!It)return ui(l),null}else 2*Pe()-m.renderingStartTime>hc&&u!==536870912&&(l.flags|=128,y=!0,Po(m,!1),l.lanes=4194304);m.isBackwards?(v.sibling=l.child,l.child=v):(n=m.last,n!==null?n.sibling=v:l.child=v,m.last=v)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=Pe(),n.sibling=null,u=Ai.current,U(Ai,y?u&1|2:u&1),It&&bn(l,m.treeForkCount),n):(ui(l),null);case 22:case 23:return ps(l),bu(),m=l.memoizedState!==null,n!==null?n.memoizedState!==null!==m&&(l.flags|=8192):m&&(l.flags|=8192),m?(u&536870912)!==0&&(l.flags&128)===0&&(ui(l),l.subtreeFlags&6&&(l.flags|=8192)):ui(l),u=l.updateQueue,u!==null&&rc(l,u.retryQueue),u=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==u&&(l.flags|=2048),n!==null&&O(Lr),null;case 24:return u=null,n!==null&&(u=n.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),vn(Ei),ui(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function PR(n,l){switch(nu(l),l.tag){case 1:return n=l.flags,n&65536?(l.flags=n&-65537|128,l):null;case 3:return vn(Ei),Fe(),n=l.flags,(n&65536)!==0&&(n&128)===0?(l.flags=n&-65537|128,l):null;case 26:case 27:case 5:return ue(l),null;case 31:if(l.memoizedState!==null){if(ps(l),l.alternate===null)throw Error(i(340));Or()}return n=l.flags,n&65536?(l.flags=n&-65537|128,l):null;case 13:if(ps(l),n=l.memoizedState,n!==null&&n.dehydrated!==null){if(l.alternate===null)throw Error(i(340));Or()}return n=l.flags,n&65536?(l.flags=n&-65537|128,l):null;case 19:return O(Ai),null;case 4:return Fe(),null;case 10:return vn(l.type),null;case 22:case 23:return ps(l),bu(),n!==null&&O(Lr),n=l.flags,n&65536?(l.flags=n&-65537|128,l):null;case 24:return vn(Ei),null;case 25:return null;default:return null}}function Sg(n,l){switch(nu(l),l.tag){case 3:vn(Ei),Fe();break;case 26:case 27:case 5:ue(l);break;case 4:Fe();break;case 31:l.memoizedState!==null&&ps(l);break;case 13:ps(l);break;case 19:O(Ai);break;case 10:vn(l.type);break;case 22:case 23:ps(l),bu(),n!==null&&O(Lr);break;case 24:vn(Ei)}}function Oo(n,l){try{var u=l.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var y=m.next;u=y;do{if((u.tag&n)===n){m=void 0;var v=u.create,P=u.inst;m=v(),P.destroy=m}u=u.next}while(u!==y)}}catch(V){jt(l,l.return,V)}}function ir(n,l,u){try{var m=l.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var v=y.next;m=v;do{if((m.tag&n)===n){var P=m.inst,V=P.destroy;if(V!==void 0){P.destroy=void 0,y=l;var ee=u,ge=V;try{ge()}catch(Re){jt(y,ee,Re)}}}m=m.next}while(m!==v)}}catch(Re){jt(l,l.return,Re)}}function Eg(n){var l=n.updateQueue;if(l!==null){var u=n.stateNode;try{pm(l,u)}catch(m){jt(n,n.return,m)}}}function Cg(n,l,u){u.props=Vr(n.type,n.memoizedProps),u.state=n.memoizedState;try{u.componentWillUnmount()}catch(m){jt(n,l,m)}}function Fo(n,l){try{var u=n.ref;if(u!==null){switch(n.tag){case 26:case 27:case 5:var m=n.stateNode;break;case 30:m=n.stateNode;break;default:m=n.stateNode}typeof u=="function"?n.refCleanup=u(m):u.current=m}}catch(y){jt(n,l,y)}}function $s(n,l){var u=n.ref,m=n.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(y){jt(n,l,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){jt(n,l,y)}else u.current=null}function Dg(n){var l=n.type,u=n.memoizedProps,m=n.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(y){jt(n,n.return,y)}}function Qu(n,l,u){try{var m=n.stateNode;eA(m,n.type,u,l),m[ns]=l}catch(y){jt(n,n.return,y)}}function Ig(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&cr(n.type)||n.tag===4}function $u(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ig(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&cr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Ju(n,l,u){var m=n.tag;if(m===5||m===6)n=n.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(n,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(n),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=gn));else if(m!==4&&(m===27&&cr(n.type)&&(u=n.stateNode,l=null),n=n.child,n!==null))for(Ju(n,l,u),n=n.sibling;n!==null;)Ju(n,l,u),n=n.sibling}function ac(n,l,u){var m=n.tag;if(m===5||m===6)n=n.stateNode,l?u.insertBefore(n,l):u.appendChild(n);else if(m!==4&&(m===27&&cr(n.type)&&(u=n.stateNode),n=n.child,n!==null))for(ac(n,l,u),n=n.sibling;n!==null;)ac(n,l,u),n=n.sibling}function wg(n){var l=n.stateNode,u=n.memoizedProps;try{for(var m=n.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Hi(l,m,u),l[Ni]=n,l[ns]=u}catch(v){jt(n,n.return,v)}}var Sn=!1,Ii=!1,ef=!1,Pg=typeof WeakSet=="function"?WeakSet:Set,ki=null;function OR(n,l){if(n=n.containerInfo,Tf=Ec,n=W_(n),jh(n)){if("selectionStart"in n)var u={start:n.selectionStart,end:n.selectionEnd};else e:{u=(u=n.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var y=m.anchorOffset,v=m.focusNode;m=m.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var P=0,V=-1,ee=-1,ge=0,Re=0,Ce=n,ye=null;t:for(;;){for(var ve;Ce!==u||y!==0&&Ce.nodeType!==3||(V=P+y),Ce!==v||m!==0&&Ce.nodeType!==3||(ee=P+m),Ce.nodeType===3&&(P+=Ce.nodeValue.length),(ve=Ce.firstChild)!==null;)ye=Ce,Ce=ve;for(;;){if(Ce===n)break t;if(ye===u&&++ge===y&&(V=P),ye===v&&++Re===m&&(ee=P),(ve=Ce.nextSibling)!==null)break;Ce=ye,ye=Ce.parentNode}Ce=ve}u=V===-1||ee===-1?null:{start:V,end:ee}}else u=null}u=u||{start:0,end:0}}else u=null;for(Rf={focusedElem:n,selectionRange:u},Ec=!1,ki=l;ki!==null;)if(l=ki,n=l.child,(l.subtreeFlags&1028)!==0&&n!==null)n.return=l,ki=n;else for(;ki!==null;){switch(l=ki,v=l.alternate,n=l.flags,l.tag){case 0:if((n&4)!==0&&(n=l.updateQueue,n=n!==null?n.events:null,n!==null))for(u=0;u<n.length;u++)y=n[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&v!==null){n=void 0,u=l,y=v.memoizedProps,v=v.memoizedState,m=u.stateNode;try{var Qe=Vr(u.type,y);n=m.getSnapshotBeforeUpdate(Qe,v),m.__reactInternalSnapshotBeforeUpdate=n}catch(ct){jt(u,u.return,ct)}}break;case 3:if((n&1024)!==0){if(n=l.stateNode.containerInfo,u=n.nodeType,u===9)Sf(n);else if(u===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Sf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=l.sibling,n!==null){n.return=l.return,ki=n;break}ki=l.return}}function Og(n,l,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:Cn(n,u),m&4&&Oo(5,u);break;case 1:if(Cn(n,u),m&4)if(n=u.stateNode,l===null)try{n.componentDidMount()}catch(P){jt(u,u.return,P)}else{var y=Vr(u.type,l.memoizedProps);l=l.memoizedState;try{n.componentDidUpdate(y,l,n.__reactInternalSnapshotBeforeUpdate)}catch(P){jt(u,u.return,P)}}m&64&&Eg(u),m&512&&Fo(u,u.return);break;case 3:if(Cn(n,u),m&64&&(n=u.updateQueue,n!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{pm(n,l)}catch(P){jt(u,u.return,P)}}break;case 27:l===null&&m&4&&wg(u);case 26:case 5:Cn(n,u),l===null&&m&4&&Dg(u),m&512&&Fo(u,u.return);break;case 12:Cn(n,u);break;case 31:Cn(n,u),m&4&&Lg(n,u);break;case 13:Cn(n,u),m&4&&Ug(n,u),m&64&&(n=u.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(u=GR.bind(null,u),lA(n,u))));break;case 22:if(m=u.memoizedState!==null||Sn,!m){l=l!==null&&l.memoizedState!==null||Ii,y=Sn;var v=Ii;Sn=m,(Ii=l)&&!v?Dn(n,u,(u.subtreeFlags&8772)!==0):Cn(n,u),Sn=y,Ii=v}break;case 30:break;default:Cn(n,u)}}function Fg(n){var l=n.alternate;l!==null&&(n.alternate=null,Fg(l)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(l=n.stateNode,l!==null&&Ih(l)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var fi=null,as=!1;function En(n,l,u){for(u=u.child;u!==null;)Bg(n,l,u),u=u.sibling}function Bg(n,l,u){if(ii&&typeof ii.onCommitFiberUnmount=="function")try{ii.onCommitFiberUnmount(zt,u)}catch{}switch(u.tag){case 26:Ii||$s(u,l),En(n,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Ii||$s(u,l);var m=fi,y=as;cr(u.type)&&(fi=u.stateNode,as=!1),En(n,l,u),Ho(u.stateNode),fi=m,as=y;break;case 5:Ii||$s(u,l);case 6:if(m=fi,y=as,fi=null,En(n,l,u),fi=m,as=y,fi!==null)if(as)try{(fi.nodeType===9?fi.body:fi.nodeName==="HTML"?fi.ownerDocument.body:fi).removeChild(u.stateNode)}catch(v){jt(u,l,v)}else try{fi.removeChild(u.stateNode)}catch(v){jt(u,l,v)}break;case 18:fi!==null&&(as?(n=fi,Ep(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,u.stateNode),Ga(n)):Ep(fi,u.stateNode));break;case 4:m=fi,y=as,fi=u.stateNode.containerInfo,as=!0,En(n,l,u),fi=m,as=y;break;case 0:case 11:case 14:case 15:ir(2,u,l),Ii||ir(4,u,l),En(n,l,u);break;case 1:Ii||($s(u,l),m=u.stateNode,typeof m.componentWillUnmount=="function"&&Cg(u,l,m)),En(n,l,u);break;case 21:En(n,l,u);break;case 22:Ii=(m=Ii)||u.memoizedState!==null,En(n,l,u),Ii=m;break;default:En(n,l,u)}}function Lg(n,l){if(l.memoizedState===null&&(n=l.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Ga(n)}catch(u){jt(l,l.return,u)}}}function Ug(n,l){if(l.memoizedState===null&&(n=l.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Ga(n)}catch(u){jt(l,l.return,u)}}function FR(n){switch(n.tag){case 31:case 13:case 19:var l=n.stateNode;return l===null&&(l=n.stateNode=new Pg),l;case 22:return n=n.stateNode,l=n._retryCache,l===null&&(l=n._retryCache=new Pg),l;default:throw Error(i(435,n.tag))}}function oc(n,l){var u=FR(n);l.forEach(function(m){if(!u.has(m)){u.add(m);var y=HR.bind(null,n,m);m.then(y,y)}})}function os(n,l){var u=l.deletions;if(u!==null)for(var m=0;m<u.length;m++){var y=u[m],v=n,P=l,V=P;e:for(;V!==null;){switch(V.tag){case 27:if(cr(V.type)){fi=V.stateNode,as=!1;break e}break;case 5:fi=V.stateNode,as=!1;break e;case 3:case 4:fi=V.stateNode.containerInfo,as=!0;break e}V=V.return}if(fi===null)throw Error(i(160));Bg(v,P,y),fi=null,as=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)kg(l,n),l=l.sibling}var Gs=null;function kg(n,l){var u=n.alternate,m=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:os(l,n),ls(n),m&4&&(ir(3,n,n.return),Oo(3,n),ir(5,n,n.return));break;case 1:os(l,n),ls(n),m&512&&(Ii||u===null||$s(u,u.return)),m&64&&Sn&&(n=n.updateQueue,n!==null&&(m=n.callbacks,m!==null&&(u=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var y=Gs;if(os(l,n),ls(n),m&512&&(Ii||u===null||$s(u,u.return)),m&4){var v=u!==null?u.memoizedState:null;if(m=n.memoizedState,u===null)if(m===null)if(n.stateNode===null){e:{m=n.type,u=n.memoizedProps,y=y.ownerDocument||y;t:switch(m){case"title":v=y.getElementsByTagName("title")[0],(!v||v[ao]||v[Ni]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(m),y.head.insertBefore(v,y.querySelector("head > title"))),Hi(v,m,u),v[Ni]=n,Ui(v),m=v;break e;case"link":var P=kp("link","href",y).get(m+(u.href||""));if(P){for(var V=0;V<P.length;V++)if(v=P[V],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){P.splice(V,1);break t}}v=y.createElement(m),Hi(v,m,u),y.head.appendChild(v);break;case"meta":if(P=kp("meta","content",y).get(m+(u.content||""))){for(V=0;V<P.length;V++)if(v=P[V],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){P.splice(V,1);break t}}v=y.createElement(m),Hi(v,m,u),y.head.appendChild(v);break;default:throw Error(i(468,m))}v[Ni]=n,Ui(v),m=v}n.stateNode=m}else Np(y,n.type,n.stateNode);else n.stateNode=Up(y,m,n.memoizedProps);else v!==m?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,m===null?Np(y,n.type,n.stateNode):Up(y,m,n.memoizedProps)):m===null&&n.stateNode!==null&&Qu(n,n.memoizedProps,u.memoizedProps)}break;case 27:os(l,n),ls(n),m&512&&(Ii||u===null||$s(u,u.return)),u!==null&&m&4&&Qu(n,n.memoizedProps,u.memoizedProps);break;case 5:if(os(l,n),ls(n),m&512&&(Ii||u===null||$s(u,u.return)),n.flags&32){y=n.stateNode;try{ua(y,"")}catch(Qe){jt(n,n.return,Qe)}}m&4&&n.stateNode!=null&&(y=n.memoizedProps,Qu(n,y,u!==null?u.memoizedProps:y)),m&1024&&(ef=!0);break;case 6:if(os(l,n),ls(n),m&4){if(n.stateNode===null)throw Error(i(162));m=n.memoizedProps,u=n.stateNode;try{u.nodeValue=m}catch(Qe){jt(n,n.return,Qe)}}break;case 3:if(Rc=null,y=Gs,Gs=vc(l.containerInfo),os(l,n),Gs=y,ls(n),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Ga(l.containerInfo)}catch(Qe){jt(n,n.return,Qe)}ef&&(ef=!1,Ng(n));break;case 4:m=Gs,Gs=vc(n.stateNode.containerInfo),os(l,n),ls(n),Gs=m;break;case 12:os(l,n),ls(n);break;case 31:os(l,n),ls(n),m&4&&(m=n.updateQueue,m!==null&&(n.updateQueue=null,oc(n,m)));break;case 13:os(l,n),ls(n),n.child.flags&8192&&n.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(cc=Pe()),m&4&&(m=n.updateQueue,m!==null&&(n.updateQueue=null,oc(n,m)));break;case 22:y=n.memoizedState!==null;var ee=u!==null&&u.memoizedState!==null,ge=Sn,Re=Ii;if(Sn=ge||y,Ii=Re||ee,os(l,n),Ii=Re,Sn=ge,ls(n),m&8192)e:for(l=n.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||ee||Sn||Ii||Gr(n)),u=null,l=n;;){if(l.tag===5||l.tag===26){if(u===null){ee=u=l;try{if(v=ee.stateNode,y)P=v.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none";else{V=ee.stateNode;var Ce=ee.memoizedProps.style,ye=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;V.style.display=ye==null||typeof ye=="boolean"?"":(""+ye).trim()}}catch(Qe){jt(ee,ee.return,Qe)}}}else if(l.tag===6){if(u===null){ee=l;try{ee.stateNode.nodeValue=y?"":ee.memoizedProps}catch(Qe){jt(ee,ee.return,Qe)}}}else if(l.tag===18){if(u===null){ee=l;try{var ve=ee.stateNode;y?Cp(ve,!0):Cp(ee.stateNode,!1)}catch(Qe){jt(ee,ee.return,Qe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===n)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===n)break e;for(;l.sibling===null;){if(l.return===null||l.return===n)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}m&4&&(m=n.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,oc(n,u))));break;case 19:os(l,n),ls(n),m&4&&(m=n.updateQueue,m!==null&&(n.updateQueue=null,oc(n,m)));break;case 30:break;case 21:break;default:os(l,n),ls(n)}}function ls(n){var l=n.flags;if(l&2){try{for(var u,m=n.return;m!==null;){if(Ig(m)){u=m;break}m=m.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var y=u.stateNode,v=$u(n);ac(n,v,y);break;case 5:var P=u.stateNode;u.flags&32&&(ua(P,""),u.flags&=-33);var V=$u(n);ac(n,V,P);break;case 3:case 4:var ee=u.stateNode.containerInfo,ge=$u(n);Ju(n,ge,ee);break;default:throw Error(i(161))}}catch(Re){jt(n,n.return,Re)}n.flags&=-3}l&4096&&(n.flags&=-4097)}function Ng(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var l=n;Ng(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),n=n.sibling}}function Cn(n,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Og(n,l.alternate,l),l=l.sibling}function Gr(n){for(n=n.child;n!==null;){var l=n;switch(l.tag){case 0:case 11:case 14:case 15:ir(4,l,l.return),Gr(l);break;case 1:$s(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&Cg(l,l.return,u),Gr(l);break;case 27:Ho(l.stateNode);case 26:case 5:$s(l,l.return),Gr(l);break;case 22:l.memoizedState===null&&Gr(l);break;case 30:Gr(l);break;default:Gr(l)}n=n.sibling}}function Dn(n,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var m=l.alternate,y=n,v=l,P=v.flags;switch(v.tag){case 0:case 11:case 15:Dn(y,v,u),Oo(4,v);break;case 1:if(Dn(y,v,u),m=v,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ge){jt(m,m.return,ge)}if(m=v,y=m.updateQueue,y!==null){var V=m.stateNode;try{var ee=y.shared.hiddenCallbacks;if(ee!==null)for(y.shared.hiddenCallbacks=null,y=0;y<ee.length;y++)gm(ee[y],V)}catch(ge){jt(m,m.return,ge)}}u&&P&64&&Eg(v),Fo(v,v.return);break;case 27:wg(v);case 26:case 5:Dn(y,v,u),u&&m===null&&P&4&&Dg(v),Fo(v,v.return);break;case 12:Dn(y,v,u);break;case 31:Dn(y,v,u),u&&P&4&&Lg(y,v);break;case 13:Dn(y,v,u),u&&P&4&&Ug(y,v);break;case 22:v.memoizedState===null&&Dn(y,v,u),Fo(v,v.return);break;case 30:break;default:Dn(y,v,u)}l=l.sibling}}function tf(n,l){var u=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),n=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(n=l.memoizedState.cachePool.pool),n!==u&&(n!=null&&n.refCount++,u!=null&&xo(u))}function sf(n,l){n=null,l.alternate!==null&&(n=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==n&&(l.refCount++,n!=null&&xo(n))}function Hs(n,l,u,m){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)zg(n,l,u,m),l=l.sibling}function zg(n,l,u,m){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Hs(n,l,u,m),y&2048&&Oo(9,l);break;case 1:Hs(n,l,u,m);break;case 3:Hs(n,l,u,m),y&2048&&(n=null,l.alternate!==null&&(n=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==n&&(l.refCount++,n!=null&&xo(n)));break;case 12:if(y&2048){Hs(n,l,u,m),n=l.stateNode;try{var v=l.memoizedProps,P=v.id,V=v.onPostCommit;typeof V=="function"&&V(P,l.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(ee){jt(l,l.return,ee)}}else Hs(n,l,u,m);break;case 31:Hs(n,l,u,m);break;case 13:Hs(n,l,u,m);break;case 23:break;case 22:v=l.stateNode,P=l.alternate,l.memoizedState!==null?v._visibility&2?Hs(n,l,u,m):Bo(n,l):v._visibility&2?Hs(n,l,u,m):(v._visibility|=2,wa(n,l,u,m,(l.subtreeFlags&10256)!==0||!1)),y&2048&&tf(P,l);break;case 24:Hs(n,l,u,m),y&2048&&sf(l.alternate,l);break;default:Hs(n,l,u,m)}}function wa(n,l,u,m,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var v=n,P=l,V=u,ee=m,ge=P.flags;switch(P.tag){case 0:case 11:case 15:wa(v,P,V,ee,y),Oo(8,P);break;case 23:break;case 22:var Re=P.stateNode;P.memoizedState!==null?Re._visibility&2?wa(v,P,V,ee,y):Bo(v,P):(Re._visibility|=2,wa(v,P,V,ee,y)),y&&ge&2048&&tf(P.alternate,P);break;case 24:wa(v,P,V,ee,y),y&&ge&2048&&sf(P.alternate,P);break;default:wa(v,P,V,ee,y)}l=l.sibling}}function Bo(n,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=n,m=l,y=m.flags;switch(m.tag){case 22:Bo(u,m),y&2048&&tf(m.alternate,m);break;case 24:Bo(u,m),y&2048&&sf(m.alternate,m);break;default:Bo(u,m)}l=l.sibling}}var Lo=8192;function Pa(n,l,u){if(n.subtreeFlags&Lo)for(n=n.child;n!==null;)Vg(n,l,u),n=n.sibling}function Vg(n,l,u){switch(n.tag){case 26:Pa(n,l,u),n.flags&Lo&&n.memoizedState!==null&&xA(u,Gs,n.memoizedState,n.memoizedProps);break;case 5:Pa(n,l,u);break;case 3:case 4:var m=Gs;Gs=vc(n.stateNode.containerInfo),Pa(n,l,u),Gs=m;break;case 22:n.memoizedState===null&&(m=n.alternate,m!==null&&m.memoizedState!==null?(m=Lo,Lo=16777216,Pa(n,l,u),Lo=m):Pa(n,l,u));break;default:Pa(n,l,u)}}function Gg(n){var l=n.alternate;if(l!==null&&(n=l.child,n!==null)){l.child=null;do l=n.sibling,n.sibling=null,n=l;while(n!==null)}}function Uo(n){var l=n.deletions;if((n.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];ki=m,Wg(m,n)}Gg(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Hg(n),n=n.sibling}function Hg(n){switch(n.tag){case 0:case 11:case 15:Uo(n),n.flags&2048&&ir(9,n,n.return);break;case 3:Uo(n);break;case 12:Uo(n);break;case 22:var l=n.stateNode;n.memoizedState!==null&&l._visibility&2&&(n.return===null||n.return.tag!==13)?(l._visibility&=-3,lc(n)):Uo(n);break;default:Uo(n)}}function lc(n){var l=n.deletions;if((n.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];ki=m,Wg(m,n)}Gg(n)}for(n=n.child;n!==null;
vendor: 15,732 bytes, line 49
49){switch(l=n,l.tag){case 0:case 11:case 15:ir(8,l,l.return),lc(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,lc(l));break;default:lc(l)}n=n.sibling}}function Wg(n,l){for(;ki!==null;){var u=ki;switch(u.tag){case 0:case 11:case 15:ir(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:xo(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,ki=m;else e:for(u=n;ki!==null;){m=ki;var y=m.sibling,v=m.return;if(Fg(m),m===u){ki=null;break e}if(y!==null){y.return=v,ki=y;break e}ki=v}}}var BR={getCacheForType:function(n){var l=Vi(Ei),u=l.data.get(n);return u===void 0&&(u=n(),l.data.set(n,u)),u},cacheSignal:function(){return Vi(Ei).controller.signal}},LR=typeof WeakMap=="function"?WeakMap:Map,Vt=0,si=null,Mt=null,Et=0,qt=0,ys=null,sr=!1,Oa=!1,nf=!1,In=0,vi=0,nr=0,Hr=0,rf=0,bs=0,Fa=0,ko=null,cs=null,af=!1,cc=0,Xg=0,hc=1/0,uc=null,rr=null,Oi=0,ar=null,Ba=null,wn=0,of=0,lf=null,qg=null,No=0,cf=null;function xs(){return(Vt&2)!==0&&Et!==0?Et&-Et:z.T!==null?mf():Sr()}function jg(){if(bs===0)if((Et&536870912)===0||It){var n=Q;Q<<=1,(Q&3932160)===0&&(Q=262144),bs=n}else bs=536870912;return n=gs.current,n!==null&&(n.flags|=32),bs}function hs(n,l,u){(n===si&&(qt===2||qt===9)||n.cancelPendingCommit!==null)&&(La(n,0),or(n,Et,bs,!1)),Ye(n,u),((Vt&2)===0||n!==si)&&(n===si&&((Vt&2)===0&&(Hr|=u),vi===4&&or(n,Et,bs,!1)),Js(n))}function Yg(n,l,u){if((Vt&6)!==0)throw Error(i(327));var m=!u&&(l&127)===0&&(l&n.expiredLanes)===0||ze(n,l),y=m?NR(n,l):uf(n,l,!0),v=m;do{if(y===0){Oa&&!m&&or(n,l,0,!1);break}else{if(u=n.current.alternate,v&&!UR(u)){y=uf(n,l,!1),v=!1;continue}if(y===2){if(v=l,n.errorRecoveryDisabledLanes&v)var P=0;else P=n.pendingLanes&-536870913,P=P!==0?P:P&536870912?536870912:0;if(P!==0){l=P;e:{var V=n;y=ko;var ee=V.current.memoizedState.isDehydrated;if(ee&&(La(V,P).flags|=256),P=uf(V,P,!1),P!==2){if(nf&&!ee){V.errorRecoveryDisabledLanes|=v,Hr|=v,y=4;break e}v=cs,cs=y,v!==null&&(cs===null?cs=v:cs.push.apply(cs,v))}y=P}if(v=!1,y!==2)continue}}if(y===1){La(n,0),or(n,l,0,!0);break}e:{switch(m=n,v=y,v){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:or(m,l,bs,!sr);break e;case 2:cs=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(y=cc+300-Pe(),10<y)){if(or(m,l,bs,!sr),ot(m,0,!0)!==0)break e;wn=l,m.timeoutHandle=Mp(Kg.bind(null,m,u,cs,uc,af,l,bs,Hr,Fa,sr,v,"Throttled",-0,0),y);break e}Kg(m,u,cs,uc,af,l,bs,Hr,Fa,sr,v,null,-0,0)}}break}while(!0);Js(n)}function Kg(n,l,u,m,y,v,P,V,ee,ge,Re,Ce,ye,ve){if(n.timeoutHandle=-1,Ce=l.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gn},Vg(l,v,Ce);var Qe=(v&62914560)===v?cc-Pe():(v&4194048)===v?Xg-Pe():0;if(Qe=vA(Ce,Qe),Qe!==null){wn=v,n.cancelPendingCommit=Qe(sp.bind(null,n,l,v,u,m,y,P,V,ee,Re,Ce,null,ye,ve)),or(n,v,P,!ge);return}}sp(n,l,v,u,m,y,P,V,ee)}function UR(n){for(var l=n;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var y=u[m],v=y.getSnapshot;y=y.value;try{if(!_s(v(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===n)break;for(;l.sibling===null;){if(l.return===null||l.return===n)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function or(n,l,u,m){l&=~rf,l&=~Hr,n.suspendedLanes|=l,n.pingedLanes&=~l,m&&(n.warmLanes|=l),m=n.expirationTimes;for(var y=l;0<y;){var v=31-gi(y),P=1<<v;m[v]=-1,y&=~P}u!==0&&Ht(n,u,l)}function fc(){return(Vt&6)===0?(zo(0),!1):!0}function hf(){if(Mt!==null){if(qt===0)var n=Mt.return;else n=Mt,xn=Fr=null,Mu(n),Sa=null,To=0,n=Mt;for(;n!==null;)Sg(n.alternate,n),n=n.return;Mt=null}}function La(n,l){var u=n.timeoutHandle;u!==-1&&(n.timeoutHandle=-1,sA(u)),u=n.cancelPendingCommit,u!==null&&(n.cancelPendingCommit=null,u()),wn=0,hf(),si=n,Mt=u=yn(n.current,null),Et=l,qt=0,ys=null,sr=!1,Oa=ze(n,l),nf=!1,Fa=bs=rf=Hr=nr=vi=0,cs=ko=null,af=!1,(l&8)!==0&&(l|=l&32);var m=n.entangledLanes;if(m!==0)for(n=n.entanglements,m&=l;0<m;){var y=31-gi(m),v=1<<y;l|=n[y],m&=~v}return In=l,Ol(),u}function Zg(n,l){yt=null,z.H=Io,l===Ma||l===Vl?(l=fm(),qt=3):l===du?(l=fm(),qt=4):qt=l===Vu?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ys=l,Mt===null&&(vi=1,tc(n,ws(l,n.current)))}function Qg(){var n=gs.current;return n===null?!0:(Et&4194048)===Et?Bs===null:(Et&62914560)===Et||(Et&536870912)!==0?n===Bs:!1}function $g(){var n=z.H;return z.H=Io,n===null?Io:n}function Jg(){var n=z.A;return z.A=BR,n}function dc(){vi=4,sr||(Et&4194048)!==Et&&gs.current!==null||(Oa=!0),(nr&134217727)===0&&(Hr&134217727)===0||si===null||or(si,Et,bs,!1)}function uf(n,l,u){var m=Vt;Vt|=2;var y=$g(),v=Jg();(si!==n||Et!==l)&&(uc=null,La(n,l)),l=!1;var P=vi;e:do try{if(qt!==0&&Mt!==null){var V=Mt,ee=ys;switch(qt){case 8:hf(),P=6;break e;case 3:case 2:case 9:case 6:gs.current===null&&(l=!0);var ge=qt;if(qt=0,ys=null,Ua(n,V,ee,ge),u&&Oa){P=0;break e}break;default:ge=qt,qt=0,ys=null,Ua(n,V,ee,ge)}}kR(),P=vi;break}catch(Re){Zg(n,Re)}while(!0);return l&&n.shellSuspendCounter++,xn=Fr=null,Vt=m,z.H=y,z.A=v,Mt===null&&(si=null,Et=0,Ol()),P}function kR(){for(;Mt!==null;)ep(Mt)}function NR(n,l){var u=Vt;Vt|=2;var m=$g(),y=Jg();si!==n||Et!==l?(uc=null,hc=Pe()+500,La(n,l)):Oa=ze(n,l);e:do try{if(qt!==0&&Mt!==null){l=Mt;var v=ys;t:switch(qt){case 1:qt=0,ys=null,Ua(n,l,v,1);break;case 2:case 9:if(hm(v)){qt=0,ys=null,tp(l);break}l=function(){qt!==2&&qt!==9||si!==n||(qt=7),Js(n)},v.then(l,l);break e;case 3:qt=7;break e;case 4:qt=5;break e;case 7:hm(v)?(qt=0,ys=null,tp(l)):(qt=0,ys=null,Ua(n,l,v,7));break;case 5:var P=null;switch(Mt.tag){case 26:P=Mt.memoizedState;case 5:case 27:var V=Mt;if(P?zp(P):V.stateNode.complete){qt=0,ys=null;var ee=V.sibling;if(ee!==null)Mt=ee;else{var ge=V.return;ge!==null?(Mt=ge,_c(ge)):Mt=null}break t}}qt=0,ys=null,Ua(n,l,v,5);break;case 6:qt=0,ys=null,Ua(n,l,v,6);break;case 8:hf(),vi=6;break e;default:throw Error(i(462))}}zR();break}catch(Re){Zg(n,Re)}while(!0);return xn=Fr=null,z.H=m,z.A=y,Vt=u,Mt!==null?0:(si=null,Et=0,Ol(),vi)}function zR(){for(;Mt!==null&&!$e();)ep(Mt)}function ep(n){var l=Ag(n.alternate,n,In);n.memoizedProps=n.pendingProps,l===null?_c(n):Mt=l}function tp(n){var l=n,u=l.alternate;switch(l.tag){case 15:case 0:l=yg(u,l,l.pendingProps,l.type,void 0,Et);break;case 11:l=yg(u,l,l.pendingProps,l.type.render,l.ref,Et);break;case 5:Mu(l);default:Sg(u,l),l=Mt=J_(l,In),l=Ag(u,l,In)}n.memoizedProps=n.pendingProps,l===null?_c(n):Mt=l}function Ua(n,l,u,m){xn=Fr=null,Mu(l),Sa=null,To=0;var y=l.return;try{if(CR(n,y,l,u,Et)){vi=1,tc(n,ws(u,n.current)),Mt=null;return}}catch(v){if(y!==null)throw Mt=y,v;vi=1,tc(n,ws(u,n.current)),Mt=null;return}l.flags&32768?(It||m===1?n=!0:Oa||(Et&536870912)!==0?n=!1:(sr=n=!0,(m===2||m===9||m===3||m===6)&&(m=gs.current,m!==null&&m.tag===13&&(m.flags|=16384))),ip(l,n)):_c(l)}function _c(n){var l=n;do{if((l.flags&32768)!==0){ip(l,sr);return}n=l.return;var u=wR(l.alternate,l,In);if(u!==null){Mt=u;return}if(l=l.sibling,l!==null){Mt=l;return}Mt=l=n}while(l!==null);vi===0&&(vi=5)}function ip(n,l){do{var u=PR(n.alternate,n);if(u!==null){u.flags&=32767,Mt=u;return}if(u=n.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(n=n.sibling,n!==null)){Mt=n;return}Mt=n=u}while(n!==null);vi=6,Mt=null}function sp(n,l,u,m,y,v,P,V,ee){n.cancelPendingCommit=null;do mc();while(Oi!==0);if((Vt&6)!==0)throw Error(i(327));if(l!==null){if(l===n.current)throw Error(i(177));if(v=l.lanes|l.childLanes,v|=$h,nt(n,u,v,P,V,ee),n===si&&(Mt=si=null,Et=0),Ba=l,ar=n,wn=u,of=v,lf=y,qg=m,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,WR(Kt,function(){return lp(),null})):(n.callbackNode=null,n.callbackPriority=0),m=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||m){m=z.T,z.T=null,y=X.p,X.p=2,P=Vt,Vt|=4;try{OR(n,l,u)}finally{Vt=P,X.p=y,z.T=m}}Oi=1,np(),rp(),ap()}}function np(){if(Oi===1){Oi=0;var n=ar,l=Ba,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=z.T,z.T=null;var m=X.p;X.p=2;var y=Vt;Vt|=4;try{kg(l,n);var v=Rf,P=W_(n.containerInfo),V=v.focusedElem,ee=v.selectionRange;if(P!==V&&V&&V.ownerDocument&&H_(V.ownerDocument.documentElement,V)){if(ee!==null&&jh(V)){var ge=ee.start,Re=ee.end;if(Re===void 0&&(Re=ge),"selectionStart"in V)V.selectionStart=ge,V.selectionEnd=Math.min(Re,V.value.length);else{var Ce=V.ownerDocument||document,ye=Ce&&Ce.defaultView||window;if(ye.getSelection){var ve=ye.getSelection(),Qe=V.textContent.length,ct=Math.min(ee.start,Qe),Jt=ee.end===void 0?ct:Math.min(ee.end,Qe);!ve.extend&&ct>Jt&&(P=Jt,Jt=ct,ct=P);var ce=G_(V,ct),re=G_(V,Jt);if(ce&&re&&(ve.rangeCount!==1||ve.anchorNode!==ce.node||ve.anchorOffset!==ce.offset||ve.focusNode!==re.node||ve.focusOffset!==re.offset)){var _e=Ce.createRange();_e.setStart(ce.node,ce.offset),ve.removeAllRanges(),ct>Jt?(ve.addRange(_e),ve.extend(re.node,re.offset)):(_e.setEnd(re.node,re.offset),ve.addRange(_e))}}}}for(Ce=[],ve=V;ve=ve.parentNode;)ve.nodeType===1&&Ce.push({element:ve,left:ve.scrollLeft,top:ve.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Ce.length;V++){var Se=Ce[V];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}Ec=!!Tf,Rf=Tf=null}finally{Vt=y,X.p=m,z.T=u}}n.current=l,Oi=2}}function rp(){if(Oi===2){Oi=0;var n=ar,l=Ba,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=z.T,z.T=null;var m=X.p;X.p=2;var y=Vt;Vt|=4;try{Og(n,l.alternate,l)}finally{Vt=y,X.p=m,z.T=u}}Oi=3}}function ap(){if(Oi===4||Oi===3){Oi=0,ie();var n=ar,l=Ba,u=wn,m=qg;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Oi=5:(Oi=0,Ba=ar=null,op(n,n.pendingLanes));var y=n.pendingLanes;if(y===0&&(rr=null),ss(u),l=l.stateNode,ii&&typeof ii.onCommitFiberRoot=="function")try{ii.onCommitFiberRoot(zt,l,void 0,(l.current.flags&128)===128)}catch{}if(m!==null){l=z.T,y=X.p,X.p=2,z.T=null;try{for(var v=n.onRecoverableError,P=0;P<m.length;P++){var V=m[P];v(V.value,{componentStack:V.stack})}}finally{z.T=l,X.p=y}}(wn&3)!==0&&mc(),Js(n),y=n.pendingLanes,(u&261930)!==0&&(y&42)!==0?n===cf?No++:(No=0,cf=n):No=0,zo(0)}}function op(n,l){(n.pooledCacheLanes&=l)===0&&(l=n.pooledCache,l!=null&&(n.pooledCache=null,xo(l)))}function mc(){return np(),rp(),ap(),lp()}function lp(){if(Oi!==5)return!1;var n=ar,l=of;of=0;var u=ss(wn),m=z.T,y=X.p;try{X.p=32>u?32:u,z.T=null,u=lf,lf=null;var v=ar,P=wn;if(Oi=0,Ba=ar=null,wn=0,(Vt&6)!==0)throw Error(i(331));var V=Vt;if(Vt|=4,Hg(v.current),zg(v,v.current,P,u),Vt=V,zo(0,!1),ii&&typeof ii.onPostCommitFiberRoot=="function")try{ii.onPostCommitFiberRoot(zt,v)}catch{}return!0}finally{X.p=y,z.T=m,op(n,l)}}function cp(n,l,u){l=ws(u,l),l=zu(n.stateNode,l,2),n=Jn(n,l,2),n!==null&&(Ye(n,2),Js(n))}function jt(n,l,u){if(n.tag===3)cp(n,n,u);else for(;l!==null;){if(l.tag===3){cp(l,n,u);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(rr===null||!rr.has(m))){n=ws(u,n),u=hg(2),m=Jn(l,u,2),m!==null&&(ug(u,m,l,n),Ye(m,2),Js(m));break}}l=l.return}}function ff(n,l,u){var m=n.pingCache;if(m===null){m=n.pingCache=new LR;var y=new Set;m.set(l,y)}else y=m.get(l),y===void 0&&(y=new Set,m.set(l,y));y.has(u)||(nf=!0,y.add(u),n=VR.bind(null,n,l,u),l.then(n,n))}function VR(n,l,u){var m=n.pingCache;m!==null&&m.delete(l),n.pingedLanes|=n.suspendedLanes&u,n.warmLanes&=~u,si===n&&(Et&u)===u&&(vi===4||vi===3&&(Et&62914560)===Et&&300>Pe()-cc?(Vt&2)===0&&La(n,0):rf|=u,Fa===Et&&(Fa=0)),Js(n)}function hp(n,l){l===0&&(l=xe()),n=wr(n,l),n!==null&&(Ye(n,l),Js(n))}function GR(n){var l=n.memoizedState,u=0;l!==null&&(u=l.retryLane),hp(n,u)}function HR(n,l){var u=0;switch(n.tag){case 31:case 13:var m=n.stateNode,y=n.memoizedState;y!==null&&(u=y.retryLane);break;case 19:m=n.stateNode;break;case 22:m=n.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(l),hp(n,u)}function WR(n,l){return Nt(n,l)}var gc=null,ka=null,df=!1,pc=!1,_f=!1,lr=0;function Js(n){n!==ka&&n.next===null&&(ka===null?gc=ka=n:ka=ka.next=n),pc=!0,df||(df=!0,qR())}function zo(n,l){if(!_f&&pc){_f=!0;do for(var u=!1,m=gc;m!==null;){if(n!==0){var y=m.pendingLanes;if(y===0)var v=0;else{var P=m.suspendedLanes,V=m.pingedLanes;v=(1<<31-gi(42|n)+1)-1,v&=y&~(P&~V),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,_p(m,v))}else v=Et,v=ot(m,m===si?v:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(v&3)===0||ze(m,v)||(u=!0,_p(m,v));m=m.next}while(u);_f=!1}}function XR(){up()}function up(){pc=df=!1;var n=0;lr!==0&&iA()&&(n=lr);for(var l=Pe(),u=null,m=gc;m!==null;){var y=m.next,v=fp(m,l);v===0?(m.next=null,u===null?gc=y:u.next=y,y===null&&(ka=u)):(u=m,(n!==0||(v&3)!==0)&&(pc=!0)),m=y}Oi!==0&&Oi!==5||zo(n),lr!==0&&(lr=0)}function fp(n,l){for(var u=n.suspendedLanes,m=n.pingedLanes,y=n.expirationTimes,v=n.pendingLanes&-62914561;0<v;){var P=31-gi(v),V=1<<P,ee=y[P];ee===-1?((V&u)===0||(V&m)!==0)&&(y[P]=N(V,l)):ee<=l&&(n.expiredLanes|=V),v&=~V}if(l=si,u=Et,u=ot(n,n===l?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),m=n.callbackNode,u===0||n===l&&(qt===2||qt===9)||n.cancelPendingCommit!==null)return m!==null&&m!==null&&Ft(m),n.callbackNode=null,n.callbackPriority=0;if((u&3)===0||ze(n,u)){if(l=u&-u,l===n.callbackPriority)return l;switch(m!==null&&Ft(m),ss(u)){case 2:case 8:u=ai;break;case 32:u=Kt;break;case 268435456:u=At;break;default:u=Kt}return m=dp.bind(null,n),u=Nt(u,m),n.callbackPriority=l,n.callbackNode=u,l}return m!==null&&m!==null&&Ft(m),n.callbackPriority=2,n.callbackNode=null,2}function dp(n,l){if(Oi!==0&&Oi!==5)return n.callbackNode=null,n.callbackPriority=0,null;var u=n.callbackNode;if(mc()&&n.callbackNode!==u)return null;var m=Et;return m=ot(n,n===si?m:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),m===0?null:(Yg(n,m,l),fp(n,Pe()),n.callbackNode!=null&&n.callbackNode===u?dp.bind(null,n):null)}function _p(n,l){if(mc())return null;Yg(n,l,!0)}function qR(){nA(function(){(Vt&6)!==0?Nt(Xt,XR):up()})}function mf(){if(lr===0){var n=Ra;n===0&&(n=Tt,Tt<<=1,(Tt&261888)===0&&(Tt=256)),lr=n}return lr}function mp(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ml(""+n)}function gp(n,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,n.id&&u.setAttribute("form",n.id),l.parentNode.insertBefore(u,l),n=new FormData(n),u.parentNode.removeChild(u),n}function jR(n,l,u,m,y){if(l==="submit"&&u&&u.stateNode===y){var v=mp((y[ns]||null).action),P=m.submitter;P&&(l=(l=P[ns]||null)?mp(l.formAction):P.getAttribute("formAction"),l!==null&&(v=l,P=null));var V=new Dl("action","action",null,m,y);n.push({event:V,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(lr!==0){var ee=P?gp(y,P):new FormData(y);Fu(u,{pending:!0,data:ee,method:y.method,action:v},null,ee)}}else typeof v=="function"&&(V.preventDefault(),ee=P?gp(y,P):new FormData(y),Fu(u,{pending:!0,data:ee,method:y.method,action:v},v,ee))},currentTarget:y}]})}}for(var gf=0;gf<Qh.length;gf++){var pf=Qh[gf],YR=pf.toLowerCase(),KR=pf[0].toUpperCase()+pf.slice(1);Vs(YR,"on"+KR)}Vs(j_,"onAnimationEnd"),Vs(Y_,"onAnimationIteration"),Vs(K_,"onAnimationStart"),Vs("dblclick","onDoubleClick"),Vs("focusin","onFocus"),Vs("focusout","onBlur"),Vs(uR,"onTransitionRun"),Vs(fR,"onTransitionStart"),Vs(dR,"onTransitionCancel"),Vs(Z_,"onTransitionEnd"),ca("onMouseEnter",["mouseout","mouseover"]),ca("onMouseLeave",["mouseout","mouseover"]),ca("onPointerEnter",["pointerout","pointerover"]),ca("onPointerLeave",["pointerout","pointerover"]),Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Er("onSelect","focusout contextmenu dragend focu
49sin keydown keyup mousedown mouseup selectionchange".split(" ")),Er("onBeforeInput",["compositionend","keypress","textInput","paste"]),Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vo="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(" "),ZR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vo));function pp(n,l){l=(l&4)!==0;for(var u=0;u<n.length;u++){var m=n[u],y=m.event;m=m.listeners;e:{var v=void 0;if(l)for(var P=m.length-1;0<=P;P--){var V=m[P],ee=V.instance,ge=V.currentTarget;if(V=V.listener,ee!==v&&y.isPropagationStopped())break e;v=V,y.currentTarget=ge;try{v(y)}catch(Re){Pl(Re)}y.currentTarget=null,v=ee}else for(P=0;P<m.length;P++){if(V=m[P],ee=V.instance,ge=V.currentTarget,V=V.listener,ee!==v&&y.isPropagationStopped())break e;v=V,y.currentTarget=ge;try{v(y)}catch(Re){Pl(Re)}y.currentTarget=null,v=ee}}}}function St(n,l){var u=l[Dh];u===void 0&&(u=l[Dh]=new Set);var m=n+"__bubble";u.has(m)||(yp(l,n,2,!1),u.add(m))}function yf(n,l,u){var m=0;l&&(m|=4),yp(u,n,m,l)}var yc="_reactListening"+Math.random().toString(36).slice(2);function bf(n){if(!n[yc]){n[yc]=!0,u_.forEach(function(u){u!=="selectionchange"&&(ZR.has(u)||yf(u,!1,n),yf(u,!0,n))});var l=n.nodeType===9?n:n.ownerDocument;l===null||l[yc]||(l[yc]=!0,yf("selectionchange",!1,l))}}function yp(n,l,u,m){switch(jp(l)){case 2:var y=AA;break;case 8:y=MA;break;default:y=Ff}u=y.bind(null,l,u,n),y=void 0,!kh||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),m?y!==void 0?n.addEventListener(l,u,{capture:!0,passive:y}):n.addEventListener(l,u,!0):y!==void 0?n.addEventListener(l,u,{passive:y}):n.addEventListener(l,u,!1)}function xf(n,l,u,m,y){var v=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var P=m.tag;if(P===3||P===4){var V=m.stateNode.containerInfo;if(V===y)break;if(P===4)for(P=m.return;P!==null;){var ee=P.tag;if((ee===3||ee===4)&&P.stateNode.containerInfo===y)return;P=P.return}for(;V!==null;){if(P=aa(V),P===null)return;if(ee=P.tag,ee===5||ee===6||ee===26||ee===27){m=v=P;continue e}V=V.parentNode}}m=m.return}R_(function(){var ge=v,Re=Lh(u),Ce=[];e:{var ye=Q_.get(n);if(ye!==void 0){var ve=Dl,Qe=n;switch(n){case"keypress":if(El(u)===0)break e;case"keydown":case"keyup":ve=HT;break;case"focusin":Qe="focus",ve=Gh;break;case"focusout":Qe="blur",ve=Gh;break;case"beforeblur":case"afterblur":ve=Gh;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=S_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=wT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=qT;break;case j_:case Y_:case K_:ve=FT;break;case Z_:ve=YT;break;case"scroll":case"scrollend":ve=DT;break;case"wheel":ve=ZT;break;case"copy":case"cut":case"paste":ve=LT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=C_;break;case"toggle":case"beforetoggle":ve=$T}var ct=(l&4)!==0,Jt=!ct&&(n==="scroll"||n==="scrollend"),ce=ct?ye!==null?ye+"Capture":null:ye;ct=[];for(var re=ge,_e;re!==null;){var Se=re;if(_e=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||_e===null||ce===null||(Se=lo(re,ce),Se!=null&&ct.push(Go(re,Se,_e))),Jt)break;re=re.return}0<ct.length&&(ye=new ve(ye,Qe,null,u,Re),Ce.push({event:ye,listeners:ct}))}}if((l&7)===0){e:{if(ye=n==="mouseover"||n==="pointerover",ve=n==="mouseout"||n==="pointerout",ye&&u!==Bh&&(Qe=u.relatedTarget||u.fromElement)&&(aa(Qe)||Qe[ra]))break e;if((ve||ye)&&(ye=Re.window===Re?Re:(ye=Re.ownerDocument)?ye.defaultView||ye.parentWindow:window,ve?(Qe=u.relatedTarget||u.toElement,ve=ge,Qe=Qe?aa(Qe):null,Qe!==null&&(Jt=r(Qe),ct=Qe.tag,Qe!==Jt||ct!==5&&ct!==27&&ct!==6)&&(Qe=null)):(ve=null,Qe=ge),ve!==Qe)){if(ct=S_,Se="onMouseLeave",ce="onMouseEnter",re="mouse",(n==="pointerout"||n==="pointerover")&&(ct=C_,Se="onPointerLeave",ce="onPointerEnter",re="pointer"),Jt=ve==null?ye:oo(ve),_e=Qe==null?ye:oo(Qe),ye=new ct(Se,re+"leave",ve,u,Re),ye.target=Jt,ye.relatedTarget=_e,Se=null,aa(Re)===ge&&(ct=new ct(ce,re+"enter",Qe,u,Re),ct.target=_e,ct.relatedTarget=Jt,Se=ct),Jt=Se,ve&&Qe)t:{for(ct=QR,ce=ve,re=Qe,_e=0,Se=ce;Se;Se=ct(Se))_e++;Se=0;for(var rt=re;rt;rt=ct(rt))Se++;for(;0<_e-Se;)ce=ct(ce),_e--;for(;0<Se-_e;)re=ct(re),Se--;for(;_e--;){if(ce===re||re!==null&&ce===re.alternate){ct=ce;break t}ce=ct(ce),re=ct(re)}ct=null}else ct=null;ve!==null&&bp(Ce,ye,ve,ct,!1),Qe!==null&&Jt!==null&&bp(Ce,Jt,Qe,ct,!0)}}
vendor: 5,250 bytes, lines 49-50
49e:{if(ye=ge?oo(ge):window,ve=ye.nodeName&&ye.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ye.type==="file")var Ut=L_;else if(F_(ye))if(U_)Ut=lR;else{Ut=aR;var tt=rR}else ve=ye.nodeName,!ve||ve.toLowerCase()!=="input"||ye.type!=="checkbox"&&ye.type!=="radio"?ge&&Fh(ge.elementType)&&(Ut=L_):Ut=oR;if(Ut&&(Ut=Ut(n,ge))){B_(Ce,Ut,u,Re);break e}tt&&tt(n,ye,ge),n==="focusout"&&ge&&ye.type==="number"&&ge.memoizedProps.value!=null&&Oh(ye,"number",ye.value)}switch(tt=ge?oo(ge):window,n){case"focusin":(F_(tt)||tt.contentEditable==="true")&&(ma=tt,Yh=ge,po=null);break;case"focusout":po=Yh=ma=null;break;case"mousedown":Kh=!0;break;case"contextmenu":case"mouseup":case"dragend":Kh=!1,X_(Ce,u,Re);break;case"selectionchange":if(hR)break;case"keydown":case"keyup":X_(Ce,u,Re)}var bt;if(Wh)e:{switch(n){case"compositionstart":var Ct="onCompositionStart";break e;case"compositionend":Ct="onCompositionEnd";break e;case"compositionupdate":Ct="onCompositionUpdate";break e}Ct=void 0}else _a?P_(n,u)&&(Ct="onCompositionEnd"):n==="keydown"&&u.keyCode===229&&(Ct="onCompositionStart");Ct&&(D_&&u.locale!=="ko"&&(_a||Ct!=="onCompositionStart"?Ct==="onCompositionEnd"&&_a&&(bt=A_()):(qn=Re,Nh="value"in qn?qn.value:qn.textContent,_a=!0)),tt=bc(ge,Ct),0<tt.length&&(Ct=new E_(Ct,n,null,u,Re),Ce.push({event:Ct,listeners:tt}),bt?Ct.data=bt:(bt=O_(u),bt!==null&&(Ct.data=bt)))),(bt=eR?tR(n,u):iR(n,u))&&(Ct=bc(ge,"onBeforeInput"),0<Ct.length&&(tt=new E_("onBeforeInput","beforeinput",null,u,Re),Ce.push({event:tt,listeners:Ct}),tt.data=bt)),jR(Ce,n,ge,u,Re)}pp(Ce,l)})}function Go(n,l,u){return{instance:n,listener:l,currentTarget:u}}function bc(n,l){for(var u=l+"Capture",m=[];n!==null;){var y=n,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=lo(n,u),y!=null&&m.unshift(Go(n,y,v)),y=lo(n,l),y!=null&&m.push(Go(n,y,v))),n.tag===3)return m;n=n.return}return[]}function QR(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function bp(n,l,u,m,y){for(var v=l._reactName,P=[];u!==null&&u!==m;){var V=u,ee=V.alternate,ge=V.stateNode;if(V=V.tag,ee!==null&&ee===m)break;V!==5&&V!==26&&V!==27||ge===null||(ee=ge,y?(ge=lo(u,v),ge!=null&&P.unshift(Go(u,ge,ee))):y||(ge=lo(u,v),ge!=null&&P.push(Go(u,ge,ee)))),u=u.return}P.length!==0&&n.push({event:l,listeners:P})}var $R=/\r\n?/g,JR=/\u0000|\uFFFD/g;function xp(n){return(typeof n=="string"?n:""+n).replace($R,`
50`).replace(JR,"")}function vp(n,l){return l=xp(l),xp(n)===l}function $t(n,l,u,m,y,v){switch(u){case"children":typeof m=="string"?l==="body"||l==="textarea"&&m===""||ua(n,m):(typeof m=="number"||typeof m=="bigint")&&l!=="body"&&ua(n,""+m);break;case"className":Rl(n,"class",m);break;case"tabIndex":Rl(n,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(n,u,m);break;case"style":v_(n,m,v);break;case"data":if(l!=="object"){Rl(n,"data",m);break}case"src":case"href":if(m===""&&(l!=="a"||u!=="href")){n.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){n.removeAttribute(u);break}m=Ml(""+m),n.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){n.setAttribute(u,"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 v=="function"&&(u==="formAction"?(l!=="input"&&$t(n,l,"name",y.name,y,null),$t(n,l,"formEncType",y.formEncType,y,null),$t(n,l,"formMethod",y.formMethod,y,null),$t(n,l,"formTarget",y.formTarget,y,null)):($t(n,l,"encType",y.encType,y,null),$t(n,l,"method",y.method,y,null),$t(n,l,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){n.removeAttribute(u);break}m=Ml(""+m),n.setAttribute(u,m);break;case"onClick":m!=null&&(n.onclick=gn);break;case"onScroll":m!=null&&St("scroll",n);break;case"onScrollEnd":m!=null&&St("scrollend",n);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(u=m.__html,u!=null){if(y.children!=null)throw Error(i(60));n.innerHTML=u}}break;case"multiple":n.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":n.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){n.removeAttribute("xlink:href");break}u=Ml(""+m),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?n.setAttribute(u,""+m):n.removeAttribute(u);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
50ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?n.setAttribute(u,""):n.removeAttribute(u);break;case"capture":case"download":m===!0?n.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?n.setAttribute(u,m):n.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?n.setAttribute(u,m):n.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?n.removeAttribute(u):n.setAttribute(u,m);break;case"popover":St("beforetoggle",n),St("toggle",n),Tl(n,"popover",m);break;case"xlinkActuate":mn(n,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":mn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":mn(n,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":mn(n,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":mn(n,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":mn(n,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":mn(n,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":mn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":mn(n,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Tl(n,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=ET.get(u)||u,Tl(n,u,m))}}function vf(n,l,u,m,y,v){switch(u){case"style":v_(n,m,v);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(u=m.__html,u!=null){if(y.children!=null)throw Error(i(60));n.innerHTML=u}}break;case"children":typeof m=="string"?ua(n,m):(typeof m=="number"||typeof m=="bigint")&&ua(n,""+m);break;case"onScroll":m!=null&&St("scroll",n);break;case"onScrollEnd":m!=null&&St("scrollend",n);break;case"onClick":m!=null&&(n.onclick=gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!f_.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),v=n[ns]||null,v=v!=null?v[u]:null,typeof v=="function"&&n.removeEventListener(l,v,y),typeof m=="function")){typeof v!="function"&&v!==null&&(u in n?n[u]=null:n.hasAttribute(u)&&n.removeAttribute(u)),n.addEventListener(l,m,y);break e}u in n?n[u]=m:m===!0?n.setAttribute(u,""):Tl(n,u,m)}}}function Hi(n,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",n),St("load",n);var m=!1,y=!1,v;for(v in u)if(u.hasOwnProperty(v)){var P=u[v];if(P!=null)switch(v){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:$t(n,l,v,P,u,null)}}y&&$t(n,l,"srcSet",u.srcSet,u,null),m&&$t(n,l,"src",u.src,u,null);return;case"input":St("invalid",n);var V=v=P=y=null,ee=null,ge=null;for(m in u)if(u.hasOwnProperty(m)){var Re=u[m];if(Re!=null)switch(m){case"name":y=Re;break;case"type":P=Re;break;case"checked":ee=Re;break;case"defaultChecked":ge=Re;break;case"value":v=Re;break;case"defaultValue":V=Re;break;case"children":case"dangerouslySetInnerHTML":if(Re!=null)throw Error(i(137,l));break;default:$t(n,l,m,Re,u,null)}}p_(n,v,V,ee,ge,P,y,!1);return;case"select":St("invalid",n),m=P=v=null;for(y in u)if(u.hasOwnProperty(y)&&(V=u[y],V!=null))switch(y){case"value":v=V;break;case"defaultValue":P=V;break;case"multiple":m=V;default:$t(n,l,y,V,u,null)}l=v,u=P,n.multiple=!!m,l!=null?ha(n,!!m,l,!1):u!=null&&ha(n,!!m,u,!0);return;case"textarea":St("invalid",n),v=y=m=null;for(P in u)if(u.hasOwnProperty(P)&&(V=u[P],V!=null))switch(P){case"value":m=V;break;case"defaultValue":y=V;break;case"children":v=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(91));break;default:$t(n,l,P,V,u,null)}b_(n,m,y,v);return;case"option":for(ee in u)if(u.hasOwnProperty(ee)&&(m=u[ee],m!=null))switch(ee){case"selected":n.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:$t(n,l,ee,m,u,null)}return;case"dialog":St("beforetoggle",n),St("toggle",n),St("cancel",n),St("close",n);break;case"iframe":case"object":St("load",n);break;case"video":case"audio":for(m=0;m<Vo.length;m++)St(Vo[m],n);break;case"image":St("error",n),St("load",n);break;case"details":St("toggle",n);break;case"embed":case"source":case"link":St("error",n),St("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ge in u)if(u.hasOwnProperty(ge)&&(m=u[ge],m!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:$t(n,l,ge,m,u,null)}return;default:if(Fh(l)){for(Re in u)u.hasOwnProperty(Re)&&(m=u[Re],m!==void 0&&vf(n,l,Re,m,u,void 0));return}}for(V in u)u.hasOwnProperty(V)&&(m=u[V],m!=null&&$t(n,l,V,m,u,null))}function eA(n,l,u,m){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,v=null,P=null,V=null,ee=null,ge=null,Re=null;for(ve in u){var Ce=u[ve];if(u.hasOwnProperty(ve)&&Ce!=null)switch(ve){case"checked":break;case"value":break;case"defaultValue":ee=Ce;default:m.hasOwnProperty(ve)||$t(n,l,ve,null,m,Ce)}}for(var ye in m){var ve=m[ye];if(Ce=u[ye],m.hasOwnProperty(ye)&&(ve!=null||Ce!=null))switch(ye){case"type":v=ve;break;case"name":y=ve;break;case"checked":ge=ve;break;case"defaultChecked":Re=ve;break;case"value":P=ve;break;case"defaultValue":V=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(i(137,l));break;default:ve!==Ce&&$t(n,l,ye,ve,m,Ce)}}Ph(n,P,V,ee,ge,Re,v,y);return;case"select":ve=P=V=ye=null;for(v in u)if(ee=u[v],u.hasOwnProperty(v)&&ee!=null)switch(v){case"value":break;case"multiple":ve=ee;default:m.hasOwnProperty(v)||$t(n,l,v,null,m,ee)}for(y in m)if(v=m[y],ee=u[y],m.hasOwnProperty(y)&&(v!=null||ee!=null))switch(y){case"value":ye=v;break;case"defaultValue":V=v;break;case"multiple":P=v;default:v!==ee&&$t(n,l,y,v,m,ee)}l=V,u=P,m=ve,ye!=null?ha(n,!!u,ye,!1):!!m!=!!u&&(l!=null?ha(n,!!u,l,!0):ha(n,!!u,u?[]:"",!1));return;case"textarea":ve=ye=null;for(V in u)if(y=u[V],u.hasOwnProperty(V)&&y!=null&&!m.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:$t(n,l,V,null,m,y)}for(P in m)if(y=m[P],v=u[P],m.hasOwnProperty(P)&&(y!=null||v!=null))switch(P){case"value":ye=y;break;case"defaultValue":ve=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==v&&$t(n,l,P,y,m,v)}y_(n,ye,ve);return;case"option":for(var Qe in u)if(ye=u[Qe],u.hasOwnProperty(Qe)&&ye!=null&&!m.hasOwnProperty(Qe))switch(Qe){case"selected":n.selected=!1;break;default:$t(n,l,Qe,null,m,ye)}for(ee in m)if(ye=m[ee],ve=u[ee],m.hasOwnProperty(ee)&&ye!==ve&&(ye!=null||ve!=null))switch(ee){case"selected":n.selected=ye&&typeof ye!="function"&&typeof ye!="symbol";break;default:$t(n,l,ee,ye,m,ve)}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 ct in u)ye=u[ct],u.hasOwnProperty(ct)&&ye!=null&&!m.hasOwnProperty(ct)&&$t(n,l,ct,null,m,ye);for(ge in m)if(ye=m[ge],ve=u[ge],m.hasOwnProperty(ge)&&ye!==ve&&(ye!=null||ve!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(i(137,l));break;default:$t(n,l,ge,ye,m,ve)}return;default:if(Fh(l)){for(var Jt in u)ye=u[Jt],u.hasOwnProperty(Jt)&&ye!==void 0&&!m.hasOwnProperty(Jt)&&vf(n,l,Jt,void 0,m,ye);for(Re in m)ye=m[Re],ve=u[Re],!m.hasOwnProperty(Re)||ye===ve||ye===void 0&&ve===void 0||vf(n,l,Re,ye,m,ve);return}}for(var ce in u)ye=u[ce],u.hasOwnProperty(ce)&&ye!=null&&!m.hasOwnProperty(ce)&&$t(n,l,ce,null,m,ye);for(Ce in m)ye=m[Ce],ve=u[Ce],!m.hasOwnProperty(Ce)||ye===ve||ye==null&&ve==null||$t(n,l,Ce,ye,m,ve)}function Tp(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tA(){if(typeof performance.getEntriesByType=="function"){for(var n=0,l=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var y=u[m],v=y.transferSize,P=y.initiatorType,V=y.duration;if(v&&V&&Tp(P)){for(P=0,V=y.responseEnd,m+=1;m<u.length;m++){var ee=u[m],ge=ee.startTime;if(ge>V)break;var Re=ee.transferSize,Ce=ee.initiatorType;Re&&Tp(Ce)&&(ee=ee.responseEnd,P+=Re*(ee<V?1:(V-ge)/(ee-ge)))}if(--m,l+=8*(v+P)/(y.duration/1e3),n++,10<n)break}}if(0<n)return l/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?
vendor: 16,420 bytes, line 50
50n:5}var Tf=null,Rf=null;function xc(n){return n.nodeType===9?n:n.ownerDocument}function Rp(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ap(n,l){if(n===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&l==="foreignObject"?0:n}function Af(n,l){return n==="textarea"||n==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Mf=null;function iA(){var n=window.event;return n&&n.type==="popstate"?n===Mf?!1:(Mf=n,!0):(Mf=null,!1)}var Mp=typeof setTimeout=="function"?setTimeout:void 0,sA=typeof clearTimeout=="function"?clearTimeout:void 0,Sp=typeof Promise=="function"?Promise:void 0,nA=typeof queueMicrotask=="function"?queueMicrotask:typeof Sp<"u"?function(n){return Sp.resolve(null).then(n).catch(rA)}:Mp;function rA(n){setTimeout(function(){throw n})}function cr(n){return n==="head"}function Ep(n,l){var u=l,m=0;do{var y=u.nextSibling;if(n.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(m===0){n.removeChild(y),Ga(l);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")Ho(n.ownerDocument.documentElement);else if(u==="head"){u=n.ownerDocument.head,Ho(u);for(var v=u.firstChild;v;){var P=v.nextSibling,V=v.nodeName;v[ao]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=P}}else u==="body"&&Ho(n.ownerDocument.body);u=y}while(u);Ga(l)}function Cp(n,l){var u=n;n=0;do{var m=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(n===0)break;n--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||n++;u=m}while(u)}function Sf(n){var l=n.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Sf(u),Ih(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}n.removeChild(u)}}function aA(n,l,u,m){for(;n.nodeType===1;){var y=u;if(n.nodeName.toLowerCase()!==l.toLowerCase()){if(!m&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(m){if(!n[ao])switch(l){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(v=n.getAttribute("rel"),v==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(v!==y.rel||n.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||n.getAttribute("title")!==(y.title==null?null:y.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(v=n.getAttribute("src"),(v!==(y.src==null?null:y.src)||n.getAttribute("type")!==(y.type==null?null:y.type)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&v&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(l==="input"&&n.type==="hidden"){var v=y.name==null?null:""+y.name;if(y.type==="hidden"&&n.getAttribute("name")===v)return n}else return n;if(n=Ls(n.nextSibling),n===null)break}return null}function oA(n,l,u){if(l==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!u||(n=Ls(n.nextSibling),n===null))return null;return n}function Dp(n,l){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Ls(n.nextSibling),n===null))return null;return n}function Ef(n){return n.data==="$?"||n.data==="$~"}function Cf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function lA(n,l){var u=n.ownerDocument;if(n.data==="$~")n._reactRetry=l;else if(n.data!=="$?"||u.readyState!=="loading")l();else{var m=function(){l(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),n._reactRetry=m}}function Ls(n){for(;n!=null;n=n.nextSibling){var l=n.nodeType;if(l===1||l===3)break;if(l===8){if(l=n.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return n}var Df=null;function Ip(n){n=n.nextSibling;for(var l=0;n;){if(n.nodeType===8){var u=n.data;if(u==="/$"||u==="/&"){if(l===0)return Ls(n.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}n=n.nextSibling}return null}function wp(n){n=n.previousSibling;for(var l=0;n;){if(n.nodeType===8){var u=n.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return n;l--}else u!=="/$"&&u!=="/&"||l++}n=n.previousSibling}return null}function Pp(n,l,u){switch(l=xc(u),n){case"html":if(n=l.documentElement,!n)throw Error(i(452));return n;case"head":if(n=l.head,!n)throw Error(i(453));return n;case"body":if(n=l.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function Ho(n){for(var l=n.attributes;l.length;)n.removeAttributeNode(l[0]);Ih(n)}var Us=new Map,Op=new Set;function vc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Pn=X.d;X.d={f:cA,r:hA,D:uA,C:fA,L:dA,m:_A,X:gA,S:mA,M:pA};function cA(){var n=Pn.f(),l=fc();return n||l}function hA(n){var l=oa(n);l!==null&&l.tag===5&&l.type==="form"?Zm(l):Pn.r(n)}var Na=typeof document>"u"?null:document;function Fp(n,l,u){var m=Na;if(m&&typeof l=="string"&&l){var y=Ds(l);y='link[rel="'+n+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Op.has(y)||(Op.add(y),n={rel:n,crossOrigin:u,href:l},m.querySelector(y)===null&&(l=m.createElement("link"),Hi(l,"link",n),Ui(l),m.head.appendChild(l)))}}function uA(n){Pn.D(n),Fp("dns-prefetch",n,null)}function fA(n,l){Pn.C(n,l),Fp("preconnect",n,l)}function dA(n,l,u){Pn.L(n,l,u);var m=Na;if(m&&n&&l){var y='link[rel="preload"][as="'+Ds(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Ds(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Ds(u.imageSizes)+'"]')):y+='[href="'+Ds(n)+'"]';var v=y;switch(l){case"style":v=za(n);break;case"script":v=Va(n)}Us.has(v)||(n=d({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:n,as:l},u),Us.set(v,n),m.querySelector(y)!==null||l==="style"&&m.querySelector(Wo(v))||l==="script"&&m.querySelector(Xo(v))||(l=m.createElement("link"),Hi(l,"link",n),Ui(l),m.head.appendChild(l)))}}function _A(n,l){Pn.m(n,l);var u=Na;if(u&&n){var m=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+Ds(m)+'"][href="'+Ds(n)+'"]',v=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Va(n)}if(!Us.has(v)&&(n=d({rel:"modulepreload",href:n},l),Us.set(v,n),u.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Xo(v)))return}m=u.createElement("link"),Hi(m,"link",n),Ui(m),u.head.appendChild(m)}}}function mA(n,l,u){Pn.S(n,l,u);var m=Na;if(m&&n){var y=la(m).hoistableStyles,v=za(n);l=l||"default";var P=y.get(v);if(!P){var V={loading:0,preload:null};if(P=m.querySelector(Wo(v)))V.loading=5;else{n=d({rel:"stylesheet",href:n,"data-precedence":l},u),(u=Us.get(v))&&If(n,u);var ee=P=m.createElement("link");Ui(ee),Hi(ee,"link",n),ee._p=new Promise(function(ge,Re){ee.onload=ge,ee.onerror=Re}),ee.addEventListener("load",function(){V.loading|=1}),ee.addEventListener("error",function(){V.loading|=2}),V.loading|=4,Tc(P,l,m)}P={type:"stylesheet",instance:P,count:1,state:V},y.set(v,P)}}}function gA(n,l){Pn.X(n,l);var u=Na;if(u&&n){var m=la(u).hoistableScripts,y=Va(n),v=m.get(y);v||(v=u.querySelector(Xo(y)),v||(n=d({src:n,async:!0},l),(l=Us.get(y))&&wf(n,l),v=u.createElement("script"),Ui(v),Hi(v,"link",n),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(y,v))}}function pA(n,l){Pn.M(n,l);var u=Na;if(u&&n){var m=la(u).hoistableScripts,y=Va(n),v=m.get(y);v||(v=u.querySelector(Xo(y)),v||(n=d({src:n,async:!0,type:"module"},l),(l=Us.get(y))&&wf(n,l),v=u.createElement("script"),Ui(v),Hi(v,"link",n),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(y,v))}}function Bp(n,l,u,m){var y=(y=le.current)?vc(y):null;if(!y)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=za(u.href),u=la(y).hoistableStyles,m=u.get(l),m||(m={type:"style",instance:null,count:0,state:null},u.set(l,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){n=za(u.href);var v=la(y).hoistableStyles,P=v.get(n);if(P||(y=y.ownerDocument||y,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(n,P),(v=y.querySelector(Wo(n)))&&!v._p&&(P.instance=v,P.state.loading=5),Us.has(n)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Us.set(n,u),v||yA(y,n,u,P.state))),l&&m===null)throw Error(i(528,""));return P}if(l&&m!==null)throw Error(i(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Va(u),u=la(y).hoistableScripts,m=u.get(l),m||(m={type:"script",instance:null,count:0,state:null},u.set(l,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function za(n){return'href="'+Ds(n)+'"'}function Wo(n){return'link[rel="stylesheet"]['+n+"]"}function Lp(n){return d({},n,{"data-precedence":n.precedence,precedence:null})}function yA(n,l,u,m){n.querySelector('link[rel="preload"][as="style"]['+l+"]")?m.loading=1:(l=n.createElement("link"),m.preload=l,l.addEventListener("load",function(){return m.loading|=1}),l.addEventListener("error",function(){return m.loading|=2}),Hi(l,"link",u),Ui(l),n.head.appendChild(l))}function Va(n){return'[src="'+Ds(n)+'"]'}function Xo(n){return"script[async]"+n}function Up(n,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var m=n.querySelector('style[data-href~="'+Ds(u.href)+'"]');if(m)return l.instance=m,Ui(m),m;var y=d({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(n.ownerDocument||n).createElement("style"),Ui(m),Hi(m,"style",y),Tc(m,u.precedence,n),l.instance=m;case"stylesheet":y=za(u.href);var v=n.querySelector(Wo(y));if(v)return l.state.loading|=4,l.instance=v,Ui(v),v;m=Lp(u),(y=Us.get(y))&&If(m,y),v=(n.ownerDocument||n).createElement("link"),Ui(v);var P=v;return P._p=new Promise(function(V,ee){P.onload=V,P.onerror=ee}),Hi(v,"link",m),l.state.loading|=4,Tc(v,u.precedence,n),l.instance=v;case"script":return v=Va(u.src),(y=n.querySelector(Xo(v)))?(l.instance=y,Ui(y),y):(m=u,(y=Us.get(v))&&(m=d({},u),wf(m,y)),n=n.ownerDocument||n,y=n.createElement("script"),Ui(y),Hi(y,"link",m),n.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(m=l.instance,l.state.loading|=4,Tc(m,u.precedence,n));return l.instance}function Tc(n,l,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,v=y,P=0;P<m.length;P++){var V=m[P];if(V.dataset.precedence===l)v=V;else if(v!==y)break}v?v.parentNode.insertBefore(n,v.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(n,l.firstChild))}function If(n,l){n.crossOrigin==null&&(n.crossOrigin=l.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=l.referrerPolicy),n.title==null&&(n.title=l.title)}function wf(n,l){n.crossOrigin==null&&(n.crossOrigin=l.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=l.referrerPolicy),n.integrity==null&&(n.integrity=l.integrity)}var Rc=null;function kp(n,l,u){if(Rc===null){var m=new Map,y=Rc=new Map;y.set(u,m)}else y=Rc,m=y.get(u),m||(m=new Map,y.set(u,m));if(m.has(n))return m;for(m.set(n,null),u=u.getElementsByTagName(n),y=0;y<u.length;y++){var v=u[y];if(!(v[ao]||v[Ni]||n==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var P=v.getAttribute(l)||"";P=n+P;var V=m.get(P);V?V.push(v):m.set(P,[v])}}return m}function Np(n,l,u){n=n.ownerDocument||n,n.head.insertBefore(u,l==="title"?n.querySelector("head > title"):null)}function bA(n,l,u){if(u===1||l.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return n=l.disabled,typeof l.precedence=="string"&&n==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function zp(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function xA(n,l,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=za(m.href),v=l.querySelector(Wo(y));if(v){l=v._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(n.count++,n=Ac.bind(n),l.then(n,n)),u.state.loading|=4,u.instance=v,Ui(v);return}v=l.ownerDocument||l,m=Lp(m),(y=Us.get(y))&&If(m,y),v=v.createElement("link"),Ui(v);var P=v;P._p=new Promise(function(V,ee){P.onload=V,P.onerror=ee}),Hi(v,"link",m),u.instance=v}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(n.count++,u=Ac.bind(n),l.addEventListener("load",u),l.addEventListener("error",u))}}var Pf=0;function vA(n,l){return n.stylesheets&&n.count===0&&Sc(n,n.stylesheets),0<n.count||0<n.imgCount?function(u){var m=setTimeout(function(){if(n.stylesheets&&Sc(n,n.stylesheets),n.unsuspend){var v=n.unsuspend;n.unsuspend=null,v()}},6e4+l);0<n.imgBytes&&Pf===0&&(Pf=62500*tA());var y=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Sc(n,n.stylesheets),n.unsuspend)){var v=n.unsuspend;n.unsuspend=null,v()}},(n.imgBytes>Pf?50:800)+l);return n.unsuspend=u,function(){n.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Mc=null;function Sc(n,l){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Mc=new Map,l.forEach(TA,n),Mc=null,Ac.call(n))}function TA(n,l){if(!(l.state.loading&4)){var u=Mc.get(n);if(u)var m=u.get(null);else{u=new Map,Mc.set(n,u);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var P=y[v];(P.nodeName==="LINK"||P.getAttribute("media")!=="not all")&&(u.set(P.dataset.precedence,P),m=P)}m&&u.set(null,m)}y=l.instance,P=y.getAttribute("data-precedence"),v=u.get(P)||m,v===m&&u.set(null,y),u.set(P,y),this.count++,m=Ac.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),v?v.parentNode.insertBefore(y,v.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(y,n.firstChild)),l.state.loading|=4}}var qo={$$typeof:M,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function RA(n,l,u,m,y,v,P,V,ee){this.tag=1,this.containerInfo=n,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=ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.hiddenUpdates=ht(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=P,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function Vp(n,l,u,m,y,v,P,V,ee,ge,Re,Ce){return n=new RA(n,l,u,P,ee,ge,Re,Ce,V),l=1,v===!0&&(l|=24),v=ms(3,null,null,l),n.current=v,v.stateNode=n,l=hu(),l.refCount++,n.pooledCache=l,l.refCount++,v.memoizedState={element:m,isDehydrated:u,cac
vendor: 4,219 bytes, line 50
50he:l},_u(v),n}function Gp(n){return n?(n=ya,n):ya}function Hp(n,l,u,m,y,v){y=Gp(y),m.context===null?m.context=y:m.pendingContext=y,m=$n(l),m.payload={element:u},v=v===void 0?null:v,v!==null&&(m.callback=v),u=Jn(n,m,l),u!==null&&(hs(u,n,l),Ao(u,n,l))}function Wp(n,l){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var u=n.retryLane;n.retryLane=u!==0&&u<l?u:l}}function Of(n,l){Wp(n,l),(n=n.alternate)&&Wp(n,l)}function Xp(n){if(n.tag===13||n.tag===31){var l=wr(n,67108864);l!==null&&hs(l,n,67108864),Of(n,67108864)}}function qp(n){if(n.tag===13||n.tag===31){var l=xs();l=Wn(l);var u=wr(n,l);u!==null&&hs(u,n,l),Of(n,l)}}var Ec=!0;function AA(n,l,u,m){var y=z.T;z.T=null;var v=X.p;try{X.p=2,Ff(n,l,u,m)}finally{X.p=v,z.T=y}}function MA(n,l,u,m){var y=z.T;z.T=null;var v=X.p;try{X.p=8,Ff(n,l,u,m)}finally{X.p=v,z.T=y}}function Ff(n,l,u,m){if(Ec){var y=Bf(m);if(y===null)xf(n,l,m,Cc,u),Yp(n,m);else if(EA(y,n,l,u,m))m.stopPropagation();else if(Yp(n,m),l&4&&-1<SA.indexOf(n)){for(;y!==null;){var v=oa(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var P=Ri(v.pendingLanes);if(P!==0){var V=v;for(V.pendingLanes|=2,V.entangledLanes|=2;P;){var ee=1<<31-gi(P);V.entanglements[1]|=ee,P&=~ee}Js(v),(Vt&6)===0&&(hc=Pe()+500,zo(0))}}break;case 31:case 13:V=wr(v,2),V!==null&&hs(V,v,2),fc(),Of(v,2)}if(v=Bf(m),v===null&&xf(n,l,m,Cc,u),v===y)break;y=v}y!==null&&m.stopPropagation()}else xf(n,l,m,null,u)}}function Bf(n){return n=Lh(n),Lf(n)}var Cc=null;function Lf(n){if(Cc=null,n=aa(n),n!==null){var l=r(n);if(l===null)n=null;else{var u=l.tag;if(u===13){if(n=o(l),n!==null)return n;n=null}else if(u===31){if(n=c(l),n!==null)return n;n=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;n=null}else l!==n&&(n=null)}}return Cc=n,null}function jp(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ei()){case Xt:return 2;case ai:return 8;case Kt:case Zt:return 32;case At:return 268435456;default:return 32}default:return 32}}var Uf=!1,hr=null,ur=null,fr=null,jo=new Map,Yo=new Map,dr=[],SA="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 Yp(n,l){switch(n){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":ur=null;break;case"mouseover":case"mouseout":fr=null;break;case"pointerover":case"pointerout":jo.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yo.delete(l.pointerId)}}function Ko(n,l,u,m,y,v){return n===null||n.nativeEvent!==v?(n={blockedOn:l,domEventName:u,eventSystemFlags:m,nativeEvent:v,targetContainers:[y]},l!==null&&(l=oa(l),l!==null&&Xp(l)),n):(n.eventSystemFlags|=m,l=n.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),n)}function EA(n,l,u,m,y){switch(l){case"focusin":return hr=Ko(hr,n,l,u,m,y),!0;case"dragenter":return ur=Ko(ur,n,l,u,m,y),!0;case"mouseover":return fr=Ko(fr,n,l,u,m,y),!0;case"pointerover":var v=y.pointerId;
vendor: 5,533 bytes, line 50
50return jo.set(v,Ko(jo.get(v)||null,n,l,u,m,y)),!0;case"gotpointercapture":return v=y.pointerId,Yo.set(v,Ko(Yo.get(v)||null,n,l,u,m,y)),!0}return!1}function Kp(n){var l=aa(n.target);if(l!==null){var u=r(l);if(u!==null){if(l=u.tag,l===13){if(l=o(u),l!==null){n.blockedOn=l,Ks(n.priority,function(){qp(u)});return}}else if(l===31){if(l=c(u),l!==null){n.blockedOn=l,Ks(n.priority,function(){qp(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){n.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Dc(n){if(n.blockedOn!==null)return!1;for(var l=n.targetContainers;0<l.length;){var u=Bf(n.nativeEvent);if(u===null){u=n.nativeEvent;var m=new u.constructor(u.type,u);Bh=m,u.target.dispatchEvent(m),Bh=null}else return l=oa(u),l!==null&&Xp(l),n.blockedOn=u,!1;l.shift()}return!0}function Zp(n,l,u){Dc(n)&&u.delete(l)}function CA(){Uf=!1,hr!==null&&Dc(hr)&&(hr=null),ur!==null&&Dc(ur)&&(ur=null),fr!==null&&Dc(fr)&&(fr=null),jo.forEach(Zp),Yo.forEach(Zp)}function Ic(n,l){n.blockedOn===l&&(n.blockedOn=null,Uf||(Uf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,CA)))}var wc=null;function Qp(n){wc!==n&&(wc=n,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){wc===n&&(wc=null);for(var l=0;l<n.length;l+=3){var u=n[l],m=n[l+1],y=n[l+2];if(typeof m!="function"){if(Lf(m||u)===null)continue;break}var v=oa(u);v!==null&&(n.splice(l,3),l-=3,Fu(v,{pending:!0,data:y,method:u.method,action:m},m,y))}}))}function Ga(n){function l(ee){return Ic(ee,n)}hr!==null&&Ic(hr,n),ur!==null&&Ic(ur,n),fr!==null&&Ic(fr,n),jo.forEach(l),Yo.forEach(l);for(var u=0;u<dr.length;u++){var m=dr[u];m.blockedOn===n&&(m.blockedOn=null)}for(;0<dr.length&&(u=dr[0],u.blockedOn===null);)Kp(u),u.blockedOn===null&&dr.shift();if(u=(n.ownerDocument||n).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var y=u[m],v=u[m+1],P=y[ns]||null;if(typeof v=="function")P||Qp(u);else if(P){var V=null;if(v&&v.hasAttribute("formAction")){if(y=v,P=v[ns]||null)V=P.formAction;else if(Lf(y)!==null)continue}else V=P.action;typeof V=="function"?u[m+1]=V:(u.splice(m,3),m-=3),Qp(u)}}}function $p(){function n(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(P){return y=P})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function kf(n){this._internalRoot=n}Pc.prototype.render=kf.prototype.render=function(n){var l=this._internalRoot;if(l===null)throw Error(i(409));var u=l.current,m=xs();Hp(u,m,n,l,null,null)},Pc.prototype.unmount=kf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var l=n.containerInfo;Hp(n.current,2,null,n,null,null),fc(),l[ra]=null}};function Pc(n){this._internalRoot=n}Pc.prototype.unstable_scheduleHydration=function(n){if(n){var l=Sr();n={blockedOn:null,target:n,priority:l};for(var u=0;u<dr.length&&l!==0&&l<dr[u].priority;u++);dr.splice(u,0,n),u===0&&Kp(n)}};var Jp=e.version;if(Jp!=="19.2.1")throw Error(i(527,Jp,"19.2.1"));X.findDOMNode=function(n){var l=n._reactInternals;if(l===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=f(l),n=n!==null?_(n):null,n=n===null?null:n.stateNode,n};var DA={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oc.isDisabled&&Oc.supportsFiber)try{zt=Oc.inject(DA),ii=Oc}catch{}}return Qo.createRoot=function(n,l){if(!s(n))throw Error(i(299));var u=!1,m="",y=ag,v=og,P=lg;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(P=l.onRecoverableError)),l=Vp(n,1,!1,null,null,u,m,null,y,v,P,$p),n[ra]=l.current,bf(n),new kf(l)},Qo.hydrateRoot=function(n,l,u){if(!s(n))throw Error(i(299));var m=!1,y="",v=ag,P=og,V=lg,ee=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(P=u.onCaughtError),u.onRecoverableError!==void 0&&(V=u.onRecoverableError),u.formState!==void 0&&(ee=u.formState)),l=Vp(n,1,!0,l,u??null,m,y,ee,v,P,V,$p),l.context=Gp(null),u=l.current,m=xs(),m=Wn(m),y=$n(m),y.callback=null,Jn(u,y,m),u=m,l.current.lanes=u,Ye(l,u),Js(l),n[ra]=l.current,bf(n),new Pc(l)},Qo.version="19.2.1",Qo}var cy;function kA(){if(cy)return zf.exports;cy=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(e){console.error(e)}}return a(),zf.exports=UA(),zf.exports}var NA=kA(),Te=Ld();const Ge=zx(Te);var zA=(a,e,t,i,s,r,o,c)=>{let h=document.documentElement,f=["light","dark"];
vendor: 7,466 bytes, line 50
50function _(p){(Array.isArray(a)?a:[a]).forEach(x=>{let b=x==="class",T=b&&r?s.map(R=>r[R]||R):s;b?(h.classList.remove(...T),h.classList.add(r&&r[p]?r[p]:p)):h.setAttribute(x,p)}),d(p)}function d(p){c&&f.includes(p)&&(h.style.colorScheme=p)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)_(i);else try{let p=localStorage.getItem(e)||t,x=o&&p==="system"?g():p;_(x)}catch{}},VA=Te.createContext(void 0),GA={setTheme:a=>{},themes:[]},HA=()=>{var a;return(a=Te.useContext(VA))!=null?a:GA};Te.memo(({forcedTheme:a,storageKey:e,attribute:t,enableSystem:i,enableColorScheme:s,defaultTheme:r,value:o,themes:c,nonce:h,scriptProps:f})=>{let _=JSON.stringify([t,e,r,a,c,o,i,s]).slice(1,-1);return Te.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${zA.toString()})(${_})`}})});var Ud=Vx();const WA=zx(Ud);function XA(a){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",e.appendChild(t),t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}const qA=a=>{switch(a){case"success":return KA;case"info":return QA;case"warning":return ZA;case"error":return $A;default:return null}},jA=Array(12).fill(0),YA=({visible:a,className:e})=>Ge.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":a},Ge.createElement("div",{className:"sonner-spinner"},jA.map((t,i)=>Ge.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),KA=Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ge.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ZA=Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ge.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),QA=Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$A=Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),JA=Ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ge.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ge.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),eM=()=>{const[a,e]=Ge.useState(document.hidden);return Ge.useEffect(()=>{const t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),a};let hd=1,tM=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:i,...s}=e,r=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:hd++,o=this.toasts.find(h=>h.id===r),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),o?this.toasts=this.toasts.map(h=>h.id===r?(this.publish({...h,...e,id:r,title:i}),{...h,...e,id:r,dismissible:c,title:i}):h):this.addToast({title:i,...s,dismissible:c,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(i=>i({id:t.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let i;t.loading!==void 0&&(i=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let r=i!==void 0,o;const c=s.then(async f=>{if(o=["resolve",f],Ge.isValidElement(f))r=!1,this.create({id:i,type:"default",message:f});else if(sM(f)&&!f.ok){r=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,g=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description,x=typeof d=="object"&&!Ge.isValidElement(d)?d:{message:d};this.create({id:i,type:"error",description:g,...x})}else if(f instanceof Error){r=!1;const d=typeof t.error=="function"?await t.error(f):t.error,g=typeof t.description=="function"?await t.description(f):t.description,x=typeof d=="object"&&!Ge.isValidElement(d)?d:{message:d};this.create({id:i,type:"error",description:g,...x})}else if(t.success!==void 0){r=!1;const d=typeof t.success=="function"?await t.success(f):t.success,g=typeof t.description=="function"?await t.description(f):t.description,x=typeof d=="object"&&!Ge.isValidElement(d)?d:{message:d};this.create({id:i,type:"success",description:g,...x})}}).catch(async f=>{if(o=["reject",f],t.error!==void 0){r=!1;const _=typeof t.error=="function"?await t.error(f):t.error,d=typeof t.description=="function"?await t.description(f):t.description,p=typeof _=="object"&&!Ge.isValidElement(_)?_:{message:_};this.create({id:i,type:"error",description:d,...p})}}).finally(()=>{r&&(this.dismiss(i),i=void 0),t.finally==null||t.finally.call(t)}),h=()=>new Promise((f,_)=>c.then(()=>o[0]==="reject"?_(o[1]):f(o[1])).catch(_));return typeof i!="string"&&typeof i!="number"?{unwrap:h}:Object.assign(i,{unwrap:h})},this.custom=(e,t)=>{const i=t?.id||hd++;return this.create({jsx:e(i),id:i,...t}),i},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}};const us=new tM,iM=(a,e)=>{const t=e?.id||hd++;return us.addToast({title:a,...e,id:t}),t},sM=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",nM=iM,rM=()=>us.toasts,aM=()=>us.getActiveToasts();Object.assign(nM,{success:us.success,info:us.info,warning:us.warning,error:us.error,custom:us.custom,message:us.message,promise:us.promise,dismiss:us.dismiss,loading:us.loading},{getHistory:rM,getToasts:aM});XA
vendor: 14,873 bytes, line 50
50("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function 
50Fc(a){return a.label!==void 0}const oM=3,lM="24px",cM="16px",hy=4e3,hM=356,uM=14,fM=45,dM=200;
vendor: 15,041 bytes, line 50
50function en(...a){return a.filter(Boolean).join(" ")}function _M(a){const[e,t]=a.split("-"),i=[];return e&&i.push(e),t&&i.push(t),i}const mM=a=>{var e,t,i,s,r,o,c,h,f;const{invert:_,toast:d,unstyled:g,interacting:p,setHeights:x,visibleToasts:b,heights:T,index:R,toasts:S,expanded:M,removeToast:I,defaultRichColors:A,closeButton:D,style:C,cancelButtonStyle:k,actionButtonStyle:H,className:L="",descriptionClassName:J="",duration:te,position:ae,gap:B,expandByDefault:$,classNames:z,icons:X,closeButtonAriaLabel:q="Close toast"}=a,[G,j]=Ge.useState(null),[w,O]=Ge.useState(null),[U,W]=Ge.useState(!1),[oe,le]=Ge.useState(!1),[be,Ee]=Ge.useState(!1),[Fe,Y]=Ge.useState(!1),[ue,de]=Ge.useState(!1),[we,qe]=Ge.useState(0),[ke,ut]=Ge.useState(0),Gt=Ge.useRef(d.duration||te||hy),Ot=Ge.useRef(null),pt=Ge.useRef(null),Nt=R===0,Ft=R+1<=b,$e=d.type,ie=d.dismissible!==!1,Pe=d.className||"",ei=d.descriptionClassName||"",Xt=Ge.useMemo(()=>T.findIndex(ot=>ot.toastId===d.id)||0,[T,d.id]),ai=Ge.useMemo(()=>{var ot;return(ot=d.closeButton)!=null?ot:D},[d.closeButton,D]),Kt=Ge.useMemo(()=>d.duration||te||hy,[d.duration,te]),Zt=Ge.useRef(0),At=Ge.useRef(0),ti=Ge.useRef(0),Dt=Ge.useRef(null),[zt,ii]=ae.split("-"),mi=Ge.useMemo(()=>T.reduce((ot,ze,N)=>N>=Xt?ot:ot+ze.height,0),[T,Xt]),gi=eM(),_n=d.invert||_,zs=$e==="loading";At.current=Ge.useMemo(()=>Xt*B+mi,[Xt,mi]),Ge.useEffect(()=>{Gt.current=Kt},[Kt]),Ge.useEffect(()=>{W(!0)},[]),Ge.useEffect(()=>{const ot=pt.current;if(ot){const ze=ot.getBoundingClientRect().height;return ut(ze),x(N=>[{toastId:d.id,height:ze,position:d.position},...N]),()=>x(N=>N.filter(xe=>xe.toastId!==d.id))}},[x,d.id]),Ge.useLayoutEffect(()=>{if(!U)return;const ot=pt.current,ze=ot.style.height;ot.style.height="auto";const N=ot.getBoundingClientRect().height;ot.style.height=ze,ut(N),x(xe=>xe.find(Ye=>Ye.toastId===d.id)?xe.map(Ye=>Ye.toastId===d.id?{...Ye,height:N}:Ye):[{toastId:d.id,height:N,position:d.position},...xe])},[U,d.title,d.description,x,d.id,d.jsx,d.action,d.cancel]);const ji=Ge.useCallback(()=>{le(!0),qe(At.current),x(ot=>ot.filter(ze=>ze.toastId!==d.id)),setTimeout(()=>{I(d)},dM)},[d,I,x,At]);Ge.useEffect(()=>{if(d.promise&&$e==="loading"||d.duration===1/0||d.type==="loading")return;let ot;return M||p||gi?(()=>{if(ti.current<Zt.current){const xe=new Date().getTime()-Zt.current;Gt.current=Gt.current-xe}ti.current=new Date().getTime()})():(()=>{Gt.current!==1/0&&(Zt.current=new Date().getTime(),ot=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),ji()},Gt.current))})(),()=>clearTimeout(ot)},[M,p,d,$e,gi,ji]),Ge.useEffect(()=>{d.delete&&(ji(),d.onDismiss==null||d.onDismiss.call(d,d))},[ji,d.delete]);function Tt(){var ot;if(X?.loading){var ze;return Ge.createElement("div",{className:en(z?.loader,d==null||(ze=d.classNames)==null?void 0:ze.loader,"sonner-loader"),"data-visible":$e==="loading"},X.loading)}return Ge.createElement(YA,{className:en(z?.loader,d==null||(ot=d.classNames)==null?void 0:ot.loader),visible:$e==="loading"})}const Q=d.icon||X?.[$e]||qA($e);var Ze,Ri;return Ge.createElement("li",{tabIndex:0,ref:pt,className:en(L,Pe,z?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,z?.default,z?.[$e],d==null||(t=d.classNames)==null?void 0:t[$e]),"data-sonner-toast":"","data-rich-colors":(Ze=d.richColors)!=null?Ze:A,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":U,"data-promise":!!d.promise,"data-swiped":ue,"data-removed":oe,"data-visible":Ft,"data-y-position":zt,"data-x-position":ii,"data-index":R,"data-front":Nt,"data-swiping":be,"data-dismissible":ie,"data-type":$e,"data-invert":_n,"data-swipe-out":Fe,"data-swipe-direction":w,"data-expanded":!!(M||$&&U),"data-testid":d.testId,style:{"--index":R,"--toasts-before":R,"--z-index":S.length-R,"--offset":`${oe?we:At.current}px`,"--initial-height":$?"auto":`${ke}px`,...C,...d.style},onDragEnd:()=>{Ee(!1),j(null),Dt.current=null},onPointerDown:ot=>{ot.button!==2&&(zs||!ie||(Ot.current=new Date,qe(At.current),ot.target.setPointerCapture(ot.pointerId),ot.target.tagName!=="BUTTON"&&(Ee(!0),Dt.current={x:ot.clientX,y:ot.clientY})))},onPointerUp:()=>{var ot,ze,N;if(Fe||!ie)return;Dt.current=null;const xe=Number(((ot=pt.current)==null?void 0:ot.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ht=Number(((ze=pt.current)==null?void 0:ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ye=new Date().getTime()-((N=Ot.current)==null?void 0:N.getTime()),nt=G==="x"?xe:ht,Ht=Math.abs(nt)/Ye;if(Math.abs(nt)>=fM||Ht>.11){qe(At.current),d.onDismiss==null||d.onDismiss.call(d,d),O(G==="x"?xe>0?"right":"left":ht>0?"down":"up"),ji(),Y(!0);return}else{var Wt,bi;(Wt=pt.current)==null||Wt.style.setProperty("--swipe-amount-x","0px"),(bi=pt.current)==null||bi.style.setProperty("--swipe-amount-y","0px")}de(!1),Ee(!1),j(null)},onPointerMove:ot=>{var ze,N,xe;if(!Dt.current||!ie||((ze=window.getSelection())==null?void 0:ze.toString().length)>0)return;const Ye=ot.clientY-Dt.current.y,nt=ot.clientX-Dt.current.x;var Ht;const Wt=(Ht=a.swipeDirections)!=null?Ht:_M(ae);!G&&(Math.abs(nt)>1||Math.abs(Ye)>1)&&j(Math.abs(nt)>Math.abs(Ye)?"x":"y");let bi={x:0,y:0};const Wn=ss=>1/(1.5+Math.abs(ss)/20);if(G==="y"){if(Wt.includes("top")||Wt.includes("bottom"))if(Wt.includes("top")&&Ye<0||Wt.includes("bottom")&&Ye>0)bi.y=Ye;else{const ss=Ye*Wn(Ye);bi.y=Math.abs(ss)<Math.abs(Ye)?ss:Ye}}else if(G==="x"&&(Wt.includes("left")||Wt.includes("right")))if(Wt.includes("left")&&nt<0||Wt.includes("right")&&nt>0)bi.x=nt;else{const ss=nt*Wn(nt);bi.x=Math.abs(ss)<Math.abs(nt)?ss:nt}(Math.abs(bi.x)>0||Math.abs(bi.y)>0)&&de(!0),(N=pt.current)==null||N.style.setProperty("--swipe-amount-x",`${bi.x}px`),(xe=pt.current)==null||xe.style.setProperty("--swipe-amount-y",`${bi.y}px`)}},ai&&!d.jsx&&$e!=="loading"?Ge.createElement("button",{"aria-label":q,"data-disabled":zs,"data-close-button":!0,onClick:zs||!ie?()=>{}:()=>{ji(),d.onDismiss==null||d.onDismiss.call(d,d)},className:en(z?.closeButton,d==null||(i=d.classNames)==null?void 0:i.closeButton)},(Ri=X?.close)!=null?Ri:JA):null,($e||d.icon||d.promise)&&d.icon!==null&&(X?.[$e]!==null||d.icon)?Ge.createElement("div",{"data-icon":"",className:en(z?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Tt():null,d.type!=="loading"?Q:null):null,Ge.createElement("div",{"data-content":"",className:en(z?.content,d==null||(r=d.classNames)==null?void 0:r.content)},Ge.createElement("div",{"data-title":"",className:en(z?.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Ge.createElement("div",{"data-description":"",className:en(J,ei,z?.description,d==null||(c=d.classNames)==null?void 0:c.description)},typeof d.description=="function"?d.description():d.description):null),Ge.isValidElement(d.cancel)?d.cancel:d.cancel&&Fc(d.cancel)?Ge.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||k,onClick:ot=>{Fc(d.cancel)&&ie&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,ot),ji())},className:en(z?.cancelButton,d==null||(h=d.classNames)==null?void 0:h.cancelButton)},d.cancel.label):null,Ge.isValidElement(d.action)?d.action:d.action&&Fc(d.action)?Ge.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||H,onClick:ot=>{Fc(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,ot),!ot.defaultPrevented&&ji())},className:en(z?.actionButton,d==null||(f=d.classNames)==null?void 0:f.actionButton)},d.action.label):null)};function uy(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function gM(a,e){const t={};return[a,e].forEach((i,s)=>{const r=s===1,o=r?"--mobile-offset":"--offset",c=r?cM:lM;function h(f){["top","right","bottom","left"].forEach(_=>{t[`${o}-${_}`]=typeof f=="number"?`${f}px`:f})}typeof i=="number"||typeof i=="string"?h(i):typeof i=="object"?["top","right","bottom","left"].forEach(f=>{i[f]===void 0?t[`${o}-${f}`]=c:t[`${o}-${f}`]=typeof i[f]=="number"?`${i[f]}px`:i[f]}):h(c)}),t}const pM=Ge.forwardRef(function(e,t){const{id:i,invert:s,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:c,closeButton:h,className:f,offset:_,mobileOffset:d,theme:g="light",richColors:p,duration:x,style:b,visibleToasts:T=oM,toastOptions:R,dir:S=uy(),gap:M=uM,icons:I,containerAriaLabel:A="Notifications"}=e,[D,C]=Ge.useState([]),k=Ge.useMemo(()=>i?D.filter(U=>U.toasterId===i):D.filter(U=>!U.toasterId),[D,i]),H=Ge.useMemo(()=>Array.from(new Set([r].concat(k.filter(U=>U.position).map(U=>U.position)))),[k,r]),[L,J]=Ge.useState([]),[te,ae]=Ge.useState(!1),[B,$]=Ge.useState(!1),[z,X]=Ge.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=Ge.useRef(null),G=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=Ge.useRef(null),w=Ge.useRef(!1),O=Ge.useCallback(U=>{C(W=>{var oe;return(oe=W.find(le=>le.id===U.id))!=null&&oe.delete||us.dismiss(U.id),W.filter(({id:le})=>le!==U.id)})},[]);return Ge.useEffect(()=>us.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{C(W=>W.map(oe=>oe.id===U.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{WA.flushSync(()=>{C(W=>{const oe=W.findIndex(le=>le.id===U.id);return oe!==-1?[...W.slice(0,oe),{...W[oe],...U},...W.slice(oe+1)]:[U,...W]})})})}),[D]),Ge.useEffect(()=>{if(g!=="system"){X(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:W})=>{X(W?"dark":"light")})}catch{U.addListener(({matches:oe})=>{try{X(oe?"dark":"light")}catch(le){console.error(le)}})}},[g]),Ge.useEffect(()=>{D.length<=1&&ae(!1)},[D]),Ge.useEffect(()=>{const U=W=>{var oe;if(o.every(Ee=>W[Ee]||W.code===Ee)){var be;ae(!0),(be=q.current)==null||be.focus()}W.code==="Escape"&&(document.activeElement===q.current||(oe=q.current)!=null&&oe.contains(document.activeElement))&&ae(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[o]),Ge.useEffect(()=>{if(q.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,w.current=!1)}},[q.current]),Ge.createElement("section",{ref:t,"aria-label":`${A} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((U,W)=>{var oe;const[le,be]=U.split("-");return k.length?Ge.createElement("ol",{key:U,dir:S==="auto"?uy():S,tabIndex:-1,ref:q,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":le,"data-x-position":be,style:{"--front-toast-height":`${((oe=L[0])==null?void 0:oe.height)||0}px`,"--width":`${hM}px`,"--gap":`${M}px`,...b,...gM(_,d)},onBlur:Ee=>{w.current&&!Ee.currentTarget.contains(Ee.relatedTarget)&&(w.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:Ee=>{Ee.target instanceof HTMLElement&&Ee.target.dataset.dismissible==="false"||w.current||(w.current=!0,j.current=Ee.relatedTarget)},onMouseEnter:()=>ae(!0),onMouseMove:()=>ae(!0),onMouseLeave:()=>{B||ae(!1)},onDragEnd:()=>ae(!1),onPointerDown:Ee=>{Ee.target instanceof HTMLElement&&Ee.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},k.filter(Ee=>!Ee.position&&W===0||Ee.position===U).map((Ee,Fe)=>{var Y,ue;return Ge.createElement(mM,{key:Ee.id,icons:I,index:Fe,toast:Ee,defaultRichColors:p,duration:(Y=R?.duration)!=null?Y:x,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:s,visibleToasts:T,closeButton:(ue=R?.closeButton)!=null?ue:h,interacting:B,position:U,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:O,toasts:k.filter(de=>de.position==Ee.position),heights:L.filter(de=>de.position==Ee.position),setHeights:J,expandByDefault:c,gap:M,expanded:te,swipeDirections:e.swipeDirections})})):null}))}),yM=({...a})=>{const{theme:e="system"}=HA();return ne.jsx(pM,{"data-loc":"client/src/components/ui/sonner.tsx:8",theme:e,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...a})};function kn(a,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(a?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}function fy(a,e){if(typeof a=="function")return a(e);a!=null&&(a.current=e)}function Gx(...a){return e=>{let t=!1;const i=a.map(s=>{const r=fy(s,e);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let s=0;s<i.length;s++){const r=i[s];typeof r=="function"?r():fy(a[s],null)}}}}function ia(...a){return Te.useCallback(Gx(...a),a)}function Hx(a,e=[]){let t=[];function i(r,o){const c=Te.createContext(o),h=t.length;t=[...t,o];const f=d=>{const{scope:g,children:p,...x}=d,b=g?.[a]?.[h]||c,T=Te.useMemo(()=>x,Object.values(x));return ne.jsx(b.Provider,{value:T,children:p})};f.displayName=r+"Provider";function _(d,g){const p=g?.[a]?.[h]||c,x=Te.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[f,_]}const s=()=>{const r=t.map(o=>Te.createContext(o));return function(c){const h=c?.[a]||r;return Te.useMemo(()=>({[`__scope${a}`]:{...c,[a]:h}}),[c,h])}};return s.scopeName=a,[i,bM(s,...e)]}function bM(...a){const e=a[0];if(a.length===1)return e;const t=()=>{const i=a.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(r){const o=i.reduce((c,{useScope:h,scopeName:f})=>{const d=h(r)[`__scope${f}`];return{...c,...d}},{});return Te.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function xM(a){const e=vM(a),t=Te.forwardRef((i,s)=>{const{children:r,...o}=i,c=Te.Children.toArray(r),h=c.find(RM);if(h){const f=h.props.children,_=c.map(d=>d===h?Te.Children.count(f)>1?Te.Children.only(null):Te.isValidElement(f)?f.props.children:null:d);return ne.jsx(e,{...o,ref:s,children:Te.isValidElement(f)?Te.cloneElement(f,void 0,_):null})}return ne.jsx(e,{...o,ref:s,children:r})});return t.displayName=`${a}.Slot`,t}function vM(a){const e=Te.forwardRef((t,i)=>{const{children:s,...r}=t;if(Te.isValidElement(s)){const o=MM(s),c=AM(r,s.props);return s.type!==Te.Fragment&&(c.ref=i?Gx(i,o):o),Te.cloneElement(s,c)}return Te.Children.count(s)>1?Te.Children.only(null):null});return e.displayName=`${a}.SlotClone`,e}var Wx=Symbol("radix.slottable");function TM(a){const e=({children:t})=>ne.jsx(ne.Fragment,{children:t});return e.displayName=`${a}.Slottable`,e.__radixId=Wx,e}function RM(a){return Te.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===Wx}function AM(a,e){const t={...e};for(const i in e){const s=a[i],r=e[i];/^on[A-Z]/.test(i)?s&&r?t[i]=(...c)=>{const h=r(...c);return s(...c),h}:s&&(t[i]=s):i==="style"?t[i]={...s,...r}
vendor: 4,599 bytes, line 50
50:i==="className"&&(t[i]=[s,r].filter(Boolean).join(" "))}return{...a,...t}}function MM(a){let e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?a.ref:(e=Object.getOwnPropertyDescriptor(a,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?a.props.ref:a.props.ref||a.ref)}var SM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sa=SM.reduce((a,e)=>{const t=xM(`Primitive.${e}`),i=Te.forwardRef((s,r)=>{const{asChild:o,...c}=s,h=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ne.jsx(h,{...c,ref:r})});return i.displayName=`Primitive.${e}`,{...a,[e]:i}},{});function EM(a,e){a&&Ud.flushSync(()=>a.dispatchEvent(e))}function mh(a){const e=Te.useRef(a);return Te.useEffect(()=>{e.current=a}),Te.useMemo(()=>(...t)=>e.current?.(...t),[])}function CM(a,e=globalThis?.document){const t=mh(a);Te.useEffect(()=>{const i=s=>{s.key==="Escape"&&t(s)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[t,e])}var DM="DismissableLayer",ud="dismissableLayer.update",IM="dismissableLayer.pointerDownOutside",wM="dismissableLayer.focusOutside",dy,Xx=Te.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qx=Te.forwardRef((a,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:r,onInteractOutside:o,onDismiss:c,...h}=a,f=Te.useContext(Xx),[_,d]=Te.useState(null),g=_?.ownerDocument??globalThis?.document,[,p]=Te.useState({}),x=ia(e,C=>d(C)),b=Array.from(f.layers),[T]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),R=b.indexOf(T),S=_?b.indexOf(_):-1,M=f.layersWithOutsidePointerEventsDisabled.size>0,I=S>=R,A=FM(C=>{const k=C.target,H=[...f.branches].some(L=>L.contains(k));!I||H||(s?.(C),o?.(C),C.defaultPrevented||c?.())},g),D=BM(C=>{const k=C.target;[...f.branches].some(L=>L.contains(k))||(r?.(C),o?.(C),C.defaultPrevented||c?.())},g);return CM(C=>{S===f.layers.size-1&&(i?.(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},g),Te.useEffect(()=>{if(_)return t&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(dy=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(_)),f.layers.add(_),_y(),()=>{t&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=dy)}},[_,g,t,f]),Te.useEffect(()=>()=>{_&&(f.layers.delete(_),f.layersWithOutsidePointerEventsDisabled.delete(_),_y())},[_,f]),Te.useEffect(()=>{const C=()=>p({});return document.addEventListener(ud,C),()=>document.removeEventListener(ud,C)},[]),ne.jsx(sa.div,{...h,ref:x,style:{pointerEvents:M?I?"auto":"none":void 0,...a.style},onFocusCapture:kn(a.onFocusCapture,D.onFocusCapture),onBlurCapture:kn(a.onBlurCapture,D.onBlurCapture),onPointerDownCapture:kn(a.onPointerDownCapture,A.onPointerDownCapture)})});qx.displayName=DM;var PM="DismissableLayerBranch",OM=Te.forwardRef((a,e)=>{const t=Te.useContext(Xx),i=Te.useRef(null),s=ia(e,i);return Te.useEffect(()=>{const r=i.current;if(r)return t.branches.add(r),()=>{t.branches.delete(r)}},[t.branches]),ne.jsx(sa.div,{...a,ref:s})});OM.displayName=PM;function FM(a,e=globalThis?.document){const t=mh(a),i=Te.useRef(!1),s=Te.useRef(()=>{});return Te.useEffect(()=>{const r=c=>{if(c.target&&!i.current){let h=function(){jx(IM,t,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=h,e.addEventListener("click",s.current,{once:!0})):h()}else e.removeEventListener("click",s.current);i.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",r),e.removeEventListener("click",s.current)}},[e,t]),{onPointerDownCapture:()=>i.current=!0}}function BM(a,e=globalThis?.document){const t=mh(a),i=Te.useRef(!1);return Te.useEffect(()=>{const s=r=>{r.target&&!i.current&&jx(wM,t,{originalEvent:r},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,t]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function _y(){const a=new CustomEvent(ud);document.dispatchEvent(a)}function jx(a,e,t,{discrete:i}){const s=t.originalEvent.target,r=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:t});e&&s.addEventListener(a,e,{once:!0}),i?EM(s,r):s.dispatchEvent(r)}var nl=globalThis?.document?Te.useLayoutEffect:()=>{};const LM=["top","right","bottom","left"],Rr=Math.min,Rs=Math.max,Zc=Math.round,Bc=Math.floor,un=a=>({x:a,y:a}
vendor: 16,935 bytes, line 50
50),UM={left:"right",right:"left",bottom:"top",top:"bottom"},kM={start:"end",end:"start"};function fd(a,e,t){return Rs(a,Rr(e,t))}function Gn(a,e){return typeof a=="function"?a(e):a}function Hn(a){return a.split("-")[0]}function to(a){return a.split("-")[1]}function kd(a){return a==="x"?"y":"x"}function Nd(a){return a==="y"?"height":"width"}const NM=new Set(["top","bottom"]);function ln(a){return NM.has(Hn(a))?"y":"x"}function zd(a){return kd(ln(a))}function zM(a,e,t){t===void 0&&(t=!1);const i=to(a),s=zd(a),r=Nd(s);let o=s==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Qc(o)),[o,Qc(o)]}function VM(a){const e=Qc(a);return[dd(a),e,dd(e)]}function dd(a){return a.replace(/start|end/g,e=>kM[e])}const my=["left","right"],gy=["right","left"],GM=["top","bottom"],HM=["bottom","top"];function WM(a,e,t){switch(a){case"top":case"bottom":return t?e?gy:my:e?my:gy;case"left":case"right":return e?GM:HM;default:return[]}}function XM(a,e,t,i){const s=to(a);let r=WM(Hn(a),t==="start",i);return s&&(r=r.map(o=>o+"-"+s),e&&(r=r.concat(r.map(dd)))),r}function Qc(a){return a.replace(/left|right|bottom|top/g,e=>UM[e])}function qM(a){return{top:0,right:0,bottom:0,left:0,...a}}function Yx(a){return typeof a!="number"?qM(a):{top:a,right:a,bottom:a,left:a}}function $c(a){const{x:e,y:t,width:i,height:s}=a;return{width:i,height:s,top:t,left:e,right:e+i,bottom:t+s,x:e,y:t}}function py(a,e,t){let{reference:i,floating:s}=a;const r=ln(e),o=zd(e),c=Nd(o),h=Hn(e),f=r==="y",_=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,g=i[c]/2-s[c]/2;let p;switch(h){case"top":p={x:_,y:i.y-s.height};break;case"bottom":p={x:_,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-s.width,y:d};break;default:p={x:i.x,y:i.y}}switch(to(e)){case"start":p[o]-=g*(t&&f?-1:1);break;case"end":p[o]+=g*(t&&f?-1:1);break}return p}const jM=async(a,e,t)=>{const{placement:i="bottom",strategy:s="absolute",middleware:r=[],platform:o}=t,c=r.filter(Boolean),h=await(o.isRTL==null?void 0:o.isRTL(e));let f=await o.getElementRects({reference:a,floating:e,strategy:s}),{x:_,y:d}=py(f,i,h),g=i,p={},x=0;for(let b=0;b<c.length;b++){const{name:T,fn:R}=c[b],{x:S,y:M,data:I,reset:A}=await R({x:_,y:d,initialPlacement:i,placement:g,strategy:s,middlewareData:p,rects:f,platform:o,elements:{reference:a,floating:e}});_=S??_,d=M??d,p={...p,[T]:{...p[T],...I}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(f=A.rects===!0?await o.getElementRects({reference:a,floating:e,strategy:s}):A.rects),{x:_,y:d}=py(f,g,h)),b=-1)}return{x:_,y:d,placement:g,strategy:s,middlewareData:p}};async function rl(a,e){var t;e===void 0&&(e={});const{x:i,y:s,platform:r,rects:o,elements:c,strategy:h}=a,{boundary:f="clippingAncestors",rootBoundary:_="viewport",elementContext:d="floating",altBoundary:g=!1,padding:p=0}=Gn(e,a),x=Yx(p),T=c[g?d==="floating"?"reference":"floating":d],R=$c(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(T)))==null||t?T:T.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:_,strategy:h})),S=d==="floating"?{x:i,y:s,width:o.floating.width,height:o.floating.height}:o.reference,M=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),I=await(r.isElement==null?void 0:r.isElement(M))?await(r.getScale==null?void 0:r.getScale(M))||{x:1,y:1}:{x:1,y:1},A=$c(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:M,strategy:h}):S);return{top:(R.top-A.top+x.top)/I.y,bottom:(A.bottom-R.bottom+x.bottom)/I.y,left:(R.left-A.left+x.left)/I.x,right:(A.right-R.right+x.right)/I.x}}const YM=a=>({name:"arrow",options:a,async fn(e){const{x:t,y:i,placement:s,rects:r,platform:o,elements:c,middlewareData:h}=e,{element:f,padding:_=0}=Gn(a,e)||{};if(f==null)return{};const d=Yx(_),g={x:t,y:i},p=zd(s),x=Nd(p),b=await o.getDimensions(f),T=p==="y",R=T?"top":"left",S=T?"bottom":"right",M=T?"clientHeight":"clientWidth",I=r.reference[x]+r.reference[p]-g[p]-r.floating[x],A=g[p]-r.reference[p],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let C=D?D[M]:0;(!C||!await(o.isElement==null?void 0:o.isElement(D)))&&(C=c.floating[M]||r.floating[x]);const k=I/2-A/2,H=C/2-b[x]/2-1,L=Rr(d[R],H),J=Rr(d[S],H),te=L,ae=C-b[x]-J,B=C/2-b[x]/2+k,$=fd(te,B,ae),z=!h.arrow&&to(s)!=null&&B!==$&&r.reference[x]/2-(B<te?L:J)-b[x]/2<0,X=z?B<te?B-te:B-ae:0;return{[p]:g[p]+X,data:{[p]:$,centerOffset:B-$-X,...z&&{alignmentOffset:X}},reset:z}}}),KM=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(e){var t,i;const{placement:s,middlewareData:r,rects:o,initialPlacement:c,platform:h,elements:f}=e,{mainAxis:_=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...T}=Gn(a,e);if((t=r.arrow)!=null&&t.alignmentOffset)return{};const R=Hn(s),S=ln(c),M=Hn(c)===c,I=await(h.isRTL==null?void 0:h.isRTL(f.floating)),A=g||(M||!b?[Qc(c)]:VM(c)),D=x!=="none";!g&&D&&A.push(...XM(c,b,x,I));const C=[c,...A],k=await rl(e,T),H=[];let L=((i=r.flip)==null?void 0:i.overflows)||[];if(_&&H.push(k[R]),d){const B=zM(s,o,I);H.push(k[B[0]],k[B[1]])}if(L=[...L,{placement:s,overflows:H}],!H.every(B=>B<=0)){var J,te;const B=(((J=r.flip)==null?void 0:J.index)||0)+1,$=C[B];if($&&(!(d==="alignment"?S!==ln($):!1)||L.every(q=>ln(q.placement)===S?q.overflows[0]>0:!0)))return{data:{index:B,overflows:L},reset:{placement:$}};let z=(te=L.filter(X=>X.overflows[0]<=0).sort((X,q)=>X.overflows[1]-q.overflows[1])[0])==null?void 0:te.placement;if(!z)switch(p){case"bestFit":{var ae;const X=(ae=L.filter(q=>{if(D){const G=ln(q.placement);return G===S||G==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(G=>G>0).reduce((G,j)=>G+j,0)]).sort((q,G)=>q[1]-G[1])[0])==null?void 0:ae[0];X&&(z=X);break}case"initialPlacement":z=c;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function yy(a,e){return{top:a.top-e.height,right:a.right-e.width,bottom:a.bottom-e.height,left:a.left-e.width}}function by(a){return LM.some(e=>a[e]>=0)}const ZM=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...s}=Gn(a,e);switch(i){case"referenceHidden":{const r=await rl(e,{...s,elementContext:"reference"}),o=yy(r,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:by(o)}}}case"escaped":{const r=await rl(e,{...s,altBoundary:!0}),o=yy(r,t.floating);return{data:{escapedOffsets:o,escaped:by(o)}}}default:return{}}}}},Kx=new Set(["left","top"]);async function QM(a,e){const{placement:t,platform:i,elements:s}=a,r=await(i.isRTL==null?void 0:i.isRTL(s.floating)),o=Hn(t),c=to(t),h=ln(t)==="y",f=Kx.has(o)?-1:1,_=r&&h?-1:1,d=Gn(e,a);let{mainAxis:g,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof x=="number"&&(p=c==="end"?x*-1:x),h?{x:p*_,y:g*f}:{x:g*f,y:p*_}}const $M=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(e){var t,i;const{x:s,y:r,placement:o,middlewareData:c}=e,h=await QM(e,a);return o===((t=c.offset)==null?void 0:t.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:s+h.x,y:r+h.y,data:{...h,placement:o}}}}},JM=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:i,placement:s}=e,{mainAxis:r=!0,crossAxis:o=!1,limiter:c={fn:T=>{let{x:R,y:S}=T;return{x:R,y:S}}},...h}=Gn(a,e),f={x:t,y:i},_=await rl(e,h),d=ln(Hn(s)),g=kd(d);let p=f[g],x=f[d];if(r){const T=g==="y"?"top":"left",R=g==="y"?"bottom":"right",S=p+_[T],M=p-_[R];p=fd(S,p,M)}if(o){const T=d==="y"?"top":"left",R=d==="y"?"bottom":"right",S=x+_[T],M=x-_[R];x=fd(S,x,M)}const b=c.fn({...e,[g]:p,[d]:x});return{...b,data:{x:b.x-t,y:b.y-i,enabled:{[g]:r,[d]:o}}}}}},eS=function(a){return a===void 0&&(a={}),{options:a,fn(e){const{x:t,y:i,placement:s,rects:r,middlewareData:o}=e,{offset:c=0,mainAxis:h=!0,crossAxis:f=!0}=Gn(a,e),_={x:t,y:i},d=ln(s),g=kd(d);let p=_[g],x=_[d];const b=Gn(c,e),T=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(h){const M=g==="y"?"height":"width",I=r.reference[g]-r.floating[M]+T.mainAxis,A=r.reference[g]+r.reference[M]-T.mainAxis;p<I?p=I:p>A&&(p=A)}if(f){var R,S;const M=g==="y"?"width":"height",I=Kx.has(Hn(s)),A=r.reference[d]-r.floating[M]+(I&&((R=o.offset)==null?void 0:R[d])||0)+(I?0:T.crossAxis),D=r.reference[d]+r.reference[M]+(I?0:((S=o.offset)==null?void 0:S[d])||0)-(I?T.crossAxis:0);x<A?x=A:x>D&&(x=D)}return{[g]:p,[d]:x}}}},tS=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(e){var t,i;const{placement:s,rects:r,platform:o,elements:c}=e,{apply:h=()=>{},...f}=Gn(a,e),_=await rl(e,f),d=Hn(s),g=to(s),p=ln(s)==="y",{width:x,height:b}=r.floating;let T,R;d==="top"||d==="bottom"?(T=d,R=g===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(R=d,T=g==="end"?"top":"bottom");const S=b-_.top-_.bottom,M=x-_.left-_.right,I=Rr(b-_[T],S),A=Rr(x-_[R],M),D=!e.middlewareData.shift;let C=I,k=A;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(k=M),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(C=S),D&&!g){const L=Rs(_.left,0),J=Rs(_.right,0),te=Rs(_.top,0),ae=Rs(_.bottom,0);p?k=x-2*(L!==0||J!==0?L+J:Rs(_.left,_.right)):C=b-2*(te!==0||ae!==0?te+ae:Rs(_.top,_.bottom))}await h({...e,availableWidth:k,availableHeight:C});const H=await o.getDimensions(c.floating);return x!==H.width||b!==H.height?{reset:{rects:!0}}:{}}}};function gh(){return typeof window<"u"}function io(a){return Zx(a)?(a.nodeName||"").toLowerCase():"#document"}function Es(a){var e;return(a==null||(e=a.ownerDocument)==null?void 0:e.defaultView)||window}function dn(a){var e;return(e=(Zx(a)?a.ownerDocument:a.document)||window.document)==null?void 0:e.documentElement}function Zx(a){return gh()?a instanceof Node||a instanceof Es(a).Node:!1}function qs(a){return gh()?a instanceof Element||a instanceof Es(a).Element:!1}function fn(a){return gh()?a instanceof HTMLElement||a instanceof Es(a).HTMLElement:!1}function xy(a){return!gh()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof Es(a).ShadowRoot}const iS=new Set(["inline","contents"]);function yl(a){const{overflow:e,overflowX:t,overflowY:i,display:s}=js(a);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!iS.has(s)}const sS=new Set(["table","td","th"]);function nS(a){return sS.has(io(a))}const rS=[":popover-open",":modal"];function ph(a){return rS.some(e=>{try{return a.matches(e)}catch{return!1}})}const aS=["transform","translate","scale","rotate","perspective"],oS=["transform","translate","scale","rotate","perspective","filter"],lS=["paint","layout","strict","content"];function Vd(a){const e=Gd(),t=qs(a)?js(a):a;return aS.some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||oS.some(i=>(t.willChange||"").includes(i))||lS.some(i=>(t.contain||"").includes(i))}function cS(a){let e=Ar(a);for(;fn(e)&&!Qa(e);){if(Vd(e))return e;if(ph(e))return null;e=Ar(e)}return null}function Gd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const hS=new Set(["html","body","#document"]);function Qa(a){return hS.has(io(a))}function js(a){return Es(a).getComputedStyle(a)}function yh(a){return qs(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function Ar(a){if(io(a)==="html")return a;const e=a.assignedSlot||a.parentNode||xy(a)&&a.host||dn(a);return xy(e)?e.host:e}function Qx(a){const e=Ar(a);return Qa(e)?a.ownerDocument?a.ownerDocument.body:a.body:fn(e)&&yl(e)?e:Qx(e)}function al(a,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const s=Qx(a),r=s===((i=a.ownerDocument)==null?void 0:i.body),o=Es(s);if(r){const c=_d(o);return e.concat(o,o.visualViewport||[],yl(s)?s:[],c&&t?al(c):[])}return e.concat(s,al(s,[],t))}function _d(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function $x(a){const e=js(a);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=fn(a),r=s?a.offsetWidth:t,o=s?a.offsetHeight:i,c=Zc(t)!==r||Zc(i)!==o;return c&&(t=r,i=o),{width:t,height:i,$:c}}function Hd(a){return qs(a)?a:a.contextElement}function qa(a){const e=Hd(a);if(!fn(e))return un(1);const t=e.getBoundingClientRect(),{width:i,height:s,$:r}=$x(e);let o=(r?Zc(t.width):t.width)/i,c=(r?Zc(t.height):t.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const uS=un(0);function Jx(a){const e=Es(a);return!Gd()||!e.visualViewport?uS:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function fS(a,e,t){return e===void 0&&(e=!1),!t||e&&t!==Es(a)?!1:e}function Jr(a,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const s=a.getBoundingClientRect(),r=Hd(a);let o=un(1);e&&(i?qs(i)&&(o=qa(i)):o=qa(a));const c=fS(r,t,i)?Jx(r):un(0);let h=(s.left+c.x)/o.x,f=(s.top+c.y)/o.y,_=s.width/o.x,d=s.height/o.y;if(r){const g=Es(r),p=i&&qs(i)?Es(i):i;let x=g,b=_d(x);for(;b&&i&&p!==x;){const T=qa(b),R=b.getBoundingClientRect(),S=js(b),M=R.left+(b.clientLeft+parseFloat(S.paddingLeft))*T.x,I=R.top+(b.clientTop+parseFloat(S.paddingTop))*T.y;h*=T.x,f*=T.y,_*=T.x,d*=T.y,h+=M,f+=I,x=Es(b),b=_d(x)}}return $c({width:_,height:d,x:h,y:f})}function bh(a,e){const t=yh(a).scrollLeft;return e?e.left+t:Jr(dn(a)).left+t}function ev(a,e){const t=a.getBoundingClientRect(),i=t.left+e.scrollLeft-bh(a,t),s=t.top+e.scrollTop;return{x:i,y:s}}function dS(a){let{elements:e,rect:t,offsetParent:i,strategy:s}=a;const r=s==="fixed",o=dn(i),c=e?ph(e.floating):!1;if(i===o||c&&r)return t;let h={scrollLeft:0,scrollTop:0},f=un(1);const _=un(0),d=fn(i);if((d||!d&&!r)&&((io(i)!=="body"||yl(o))&&(h=yh(i)),fn(i))){const p=Jr(i);f=qa(i),_.x=p.x+i.clientLeft,_.y=p.y+i.clientTop}const g=o&&!d&&!r?ev(o,h):un(0);return{width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-h.scrollLeft*f.x+_.x+g.x,y:t.y*f.y-h.scrollTop*f.y+_.y+g.y}}function _S(a){return Array.from(a.getClientRects())}function mS(a){const e=dn(a),t=yh(a),i=a.ownerDocument.body,s=Rs(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=Rs(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-t.scrollLeft+bh(a);const c=-t.scrollTop;return js(i).direction==="rtl"&&(o+=Rs(e.clientWidth,i.clientWidth)-s),{width:s,height:r,x:o,y:c}}const vy=25;function gS(a,e){const t=Es(a),i=dn(a),s=t.visualViewport;let r=i.clientWidth,o=i.clientHeight,c=0,h=0;if(s){r=s.width,o=s.height;const _=Gd();(!_||_&&e==="fixed")&&(c=s.offsetLeft,h=s.offsetTop)}const f=bh(i);if(f<=0){const _=i.ownerDocument,d=_.body,g=getComputedStyle(d),p=_.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(i.clientWidth-d.clientWidth-p);x<=vy&&(r-=x)}else f<=vy&&(r+=f);return{width:r,height:o,x:c,y:h}}const pS=new Set(["absolute","fixed"]);function yS(a,e){const t=Jr(a,!0,e==="fixed"),i=t.top+a.clientTop,s=t.left+a.clientLeft,r=fn(a)?qa(a):un(1),o=a.clientWidth*r.x,c=a.clientHeight*r.y,h=s*r.x,f=i*r.y;return{width:o,height:c,x:h,y:f}}function Ty(a,e,t){let i;if(e==="viewport")i=gS(a,t);else if(e==="document")i=mS(dn(a));else if(qs(e))i=yS(e,t);else{const s=Jx(a);i={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return $c(i)}function tv(a,e){const t=Ar(a);return t===e||!qs(t)||Qa(t)?!1:js(t).position==="fixed"||tv(t,e)}function bS(a,e){const t=e.get(a);if(t)return t;let i=al(a,[],!1).filter(c=>qs(c)&&io(c)!=="body"),s=null;const r=js(a).position==="fixed";let o=r?Ar(a):a;for(;qs(o)&&!Qa(o);){const c=js(o),h=Vd(o);!h&&c.position==="fixed"&&(s=null),(r?!h&&!s:!h&&c.position==="static"&&!!s&&pS.has(s.position)||yl(o)&&!h&&tv(a,o))?i=i.filter(_=>_!==o):s=c,o=Ar(o)}return e.set(a,i),i}function xS(a){let{element:e,boundary:t,rootBoundary:i,strategy:s}=a;const o=[...t==="clippingAncestors"?ph(e)?[]:bS(e,this._c):[].concat(t),i],c=o[0],h=o.reduce((f,_)=>{const d=Ty(e,_,s);return f.top=Rs(d.top,f.top),f.right=Rr(d.right,f.right),f.bottom=Rr(d.bottom,f.bottom),f.left=Rs(d.left,f.left),f},Ty(e,c,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function vS(a){const{width:e,height:t}=$x(a);return{width:e,height:t}}function TS(a,e,t){const i=fn(e),s=dn(e),r=t==="fixed",o=Jr(a,!0,r,e);let c={scrollLeft:0,scrollTop:0};const h=un(0);function f(){h.x=bh(s)}if(i||!i&&!r)if((io(e)!=="body"||yl(s))&&(c=yh(e)),i){const p=Jr(e,!0,r,e);h.x=p.x+e.clientLeft,h.y=p.y+e.clientTop}else s&&f();r&&!i&&s&&f();const _=s&&!i&&!r?ev(s,c):un(0),d=o.left+c.scrollLeft-h.x-_.x,g=o.top+c.scrollTop-h.y-_.y;return{x:d,y:g,width:o.width,height:o.height}}function Xf(a){return js(a).position==="static"}function Ry(a,e){if(!fn(a)||js(a).position==="fixed")return null;if(e)return e(a);let t=a.offsetParent;return dn(a)===t&&(t=t.ownerDocument.body),t}function iv(a,e){const t=Es(a);
vendor: 4,367 bytes, line 50
50if(ph(a))return t;if(!fn(a)){let s=Ar(a);for(;s&&!Qa(s);){if(qs(s)&&!Xf(s))return s;s=Ar(s)}return t}let i=Ry(a,e);for(;i&&nS(i)&&Xf(i);)i=Ry(i,e);return i&&Qa(i)&&Xf(i)&&!Vd(i)?t:i||cS(a)||t}const RS=async function(a){const e=this.getOffsetParent||iv,t=this.getDimensions,i=await t(a.floating);return{reference:TS(a.reference,await e(a.floating),a.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function AS(a){return js(a).direction==="rtl"}const MS={convertOffsetParentRelativeRectToViewportRelativeRect:dS,getDocumentElement:dn,getClippingRect:xS,getOffsetParent:iv,getElementRects:RS,getClientRects:_S,getDimensions:vS,getScale:qa,isElement:qs,isRTL:AS};function sv(a,e){return a.x===e.x&&a.y===e.y&&a.width===e.width&&a.height===e.height}function SS(a,e){let t=null,i;const s=dn(a);function r(){var c;clearTimeout(i),(c=t)==null||c.disconnect(),t=null}function o(c,h){c===void 0&&(c=!1),h===void 0&&(h=1),r();const f=a.getBoundingClientRect(),{left:_,top:d,width:g,height:p}=f;if(c||e(),!g||!p)return;const x=Bc(d),b=Bc(s.clientWidth-(_+g)),T=Bc(s.clientHeight-(d+p)),R=Bc(_),M={rootMargin:-x+"px "+-b+"px "+-T+"px "+-R+"px",threshold:Rs(0,Rr(1,h))||1};let I=!0;function A(D){const C=D[0].intersectionRatio;if(C!==h){if(!I)return o();C?o(!1,C):i=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!sv(f,a.getBoundingClientRect())&&o(),I=!1}try{t=new IntersectionObserver(A,{...M,root:s.ownerDocument})}catch{t=new IntersectionObserver(A,M)}t.observe(a)}return o(!0),r}function ES(a,e,t,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,f=Hd(a),_=s||r?[...f?al(f):[],...al(e)]:[];_.forEach(R=>{s&&R.addEventListener("scroll",t,{passive:!0}),r&&R.addEventListener("resize",t)});const d=f&&c?SS(f,t):null;let g=-1,p=null;o&&(p=new ResizeObserver(R=>{let[S]=R;S&&S.target===f&&p&&(p.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var M;(M=p)==null||M.observe(e)})),t()}),f&&!h&&p.observe(f),p.observe(e));let x,b=h?Jr(a):null;h&&T();function T(){const R=Jr(a);b&&!sv(b,R)&&t(),b=R,x=requestAnimationFrame(T)}return t(),()=>{var R;_.forEach(S=>{s&&S.removeEventListener("scroll",t),r&&S.removeEventListener("resize",t)}),d?.(),(R=p)==null||R.disconnect(),p=null,h&&cancelAnimationFrame(x)}}const CS=$M,DS=JM,IS=KM,wS=tS,PS=ZM,Ay=YM,OS=eS,FS=(a,e,t)=>{const i=new Map,s={platform:MS,...t},r={...s.platform,_c:i};return jM(a,e,{...s,platform:r})};var BS=typeof document<"u",LS=function(){},qc=BS?Te.useLayoutEffect:LS;function Jc(a,e){if(a===e)return!0;if(typeof a!=typeof e)return!1;if(typeof a=="function"&&a.toString()===e.toString())return!0;let t,i,s;if(a&&e&&typeof a=="object"){if(Array.isArray(a)){if(t=a.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!Jc(a[i],e[i]))return!1;return!0}if(s=Object.keys(a),t=s.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,s[i]))return!1;for(i=t;i--!==0;){const r=s[i];if(!(r==="_owner"&&a.$$typeof)&&!Jc(a[r],e[r]))return!1}return!0}return a!==a&&e!==e}function nv(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function My(a,e){const t=nv(a);return Math.round(e*t)/t}function qf(a){const e=Te.useRef(a);return qc(()=>{e.current=a}),e}function US(a){a===void 0&&(a={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:s,elements:{reference:r,floating:o}={},transform:c=!0,whileElementsMounted:h,open:f}=a,[_,d]=Te.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[g,p]=Te.useState(i);Jc(g,i)||p(i);const[x,b]=Te.useState(null),[T,R]=Te.useState(null),S=Te.useCallback(q=>{q!==D.current&&(D.current=q,b(q))},[]),M=Te.useCallback(q=>{q!==C.current&&(C.current=q,R(q))},[]),I=r||x,A=o||T,D=Te.useRef(null),C=Te.useRef(null),k=Te.useRef(_),H=h!=null,L=qf(h),J=qf(s),te=qf(f),ae=Te.useCallback(()=>{if(!D.current||!C.current)return;const q={placement:e,strategy:t,middleware:g};J.current&&(q.platform=J.current),FS(D.current,C.current,q).then(G=>{const j={...G,isPositioned:te.current!==!1};B.current&&!Jc(k.current,j)&&(k.current=j,Ud.flushSync(()=>{d(j)}))})},[g,e,t,J,te]);qc(()=>{f===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(q=>({...q,isPositioned:!1})))},[f]);const B=Te.useRef(!1);qc(()=>(B.current=!0,()=>
vendor: 4,528 bytes, line 50
50{B.current=!1}),[]),qc(()=>{if(I&&(D.current=I),A&&(C.current=A),I&&A){if(L.current)return L.current(I,A,ae);ae()}},[I,A,ae,L,H]);const $=Te.useMemo(()=>({reference:D,floating:C,setReference:S,setFloating:M}),[S,M]),z=Te.useMemo(()=>({reference:I,floating:A}),[I,A]),X=Te.useMemo(()=>{const q={position:t,left:0,top:0};if(!z.floating)return q;const G=My(z.floating,_.x),j=My(z.floating,_.y);return c?{...q,transform:"translate("+G+"px, "+j+"px)",...nv(z.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:G,top:j}},[t,c,z.floating,_.x,_.y]);return Te.useMemo(()=>({..._,update:ae,refs:$,elements:z,floatingStyles:X}),[_,ae,$,z,X])}const kS=a=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:a,fn(t){const{element:i,padding:s}=typeof a=="function"?a(t):a;return i&&e(i)?i.current!=null?Ay({element:i.current,padding:s}).fn(t):{}:i?Ay({element:i,padding:s}).fn(t):{}}}},NS=(a,e)=>({...CS(a),options:[a,e]}),zS=(a,e)=>({...DS(a),options:[a,e]}),VS=(a,e)=>({...OS(a),options:[a,e]}),GS=(a,e)=>({...IS(a),options:[a,e]}),HS=(a,e)=>({...wS(a),options:[a,e]}),WS=(a,e)=>({...PS(a),options:[a,e]}),XS=(a,e)=>({...kS(a),options:[a,e]});var qS="Arrow",rv=Te.forwardRef((a,e)=>{const{children:t,width:i=10,height:s=5,...r}=a;return ne.jsx(sa.svg,{...r,ref:e,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?t:ne.jsx("polygon",{points:"0,0 30,0 15,10"})})});rv.displayName=qS;var jS=rv;function YS(a){const[e,t]=Te.useState(void 0);return nl(()=>{if(a){t({width:a.offsetWidth,height:a.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const r=s[0];let o,c;if("borderBoxSize"in r){const h=r.borderBoxSize,f=Array.isArray(h)?h[0]:h;o=f.inlineSize,c=f.blockSize}else o=a.offsetWidth,c=a.offsetHeight;t({width:o,height:c})});return i.observe(a,{box:"border-box"}),()=>i.unobserve(a)}else t(void 0)},[a]),e}var av="Popper",[ov,lv]=Hx(av),[DP,cv]=ov(av),hv="PopperAnchor",uv=Te.forwardRef((a,e)=>{const{__scopePopper:t,virtualRef:i,...s}=a,r=cv(hv,t),o=Te.useRef(null),c=ia(e,o),h=Te.useRef(null);return Te.useEffect(()=>{const f=h.current;h.current=i?.current||o.current,f!==h.current&&r.onAnchorChange(h.current)}),i?null:ne.jsx(sa.div,{...s,ref:c})});uv.displayName=hv;var Wd="PopperContent",[KS,ZS]=ov(Wd),fv=Te.forwardRef((a,e)=>{const{__scopePopper:t,side:i="bottom",sideOffset:s=0,align:r="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:h=!0,collisionBoundary:f=[],collisionPadding:_=0,sticky:d="partial",hideWhenDetached:g=!1,updatePositionStrategy:p="optimized",onPlaced:x,...b}=a,T=cv(Wd,t),[R,S]=Te.useState(null),M=ia(e,be=>S(be)),[I,A]=Te.useState(null),D=YS(I),C=D?.width??0,k=D?.height??0,H=i+(r!=="center"?"-"+r:""),L=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},J=Array.isArray(f)?f:[f],te=J.length>0,ae={padding:L,boundary:J.filter($S),altBoundary:te},{refs:B,floatingStyles:$,placement:z,isPositioned:X,middlewareData:q}=US({strategy:"fixed",placement:H,whileElementsMounted:(...be)=>ES(...be,{animationFrame:p==="always"}),elements:{reference:T.anchor},middleware:[NS({mainAxis:s+k,alignmentAxis:o}),h&&zS({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?VS():void 0,...ae}),h&&GS({...ae}),HS({...ae,apply:({elements:be,rects:Ee,availableWidth:Fe,availableHeight:Y})=>{const{width:ue,height:de}=Ee.reference,we=be.floating.style;we.setProperty("--radix-popper-available-width",`${Fe}px`),we.setProperty("--radix-popper-available-height",`${Y}px`),we.setProperty("--radix-popper-anchor-width",`${ue}px`),we.setProperty("--radix-popper-anchor-height",`${de}px`)}}),I&&XS({element:I,padding:c}),JS({arrowWidth:C,arrowHeight:k}),g&&WS({strategy:"referenceHidden",...ae})]}),[G,j]=mv(z),w=mh(x);nl(()=>{X&&w?.()},[X,w]);const O=q.arrow?.x,U=q.arrow?.y,W=q.arrow?.centerOffset!==0,[oe,le]=Te.useState();return nl(()=>{R&&le(window.getComputedStyle(R).zIndex)},[R]),ne.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:X?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:ne.jsx(KS,{scope:t,placedSide:G,onArrowChange:A,arrowX:O,arrowY:U,shouldHideArrow:W,children:ne.jsx(sa.div,{"data-side":G,"data-align":j,...b,ref:M,style:{...b.style,animation:X?void 0:"none"}})})})});fv.displayName=Wd;var dv="PopperArrow",QS={top:"bottom",right:"left",bottom:"top",left:"r
50ight"},_v=Te.forwardRef(function(e,t){const{__scopePopper:i,...s}=e,r=ZS(dv,i),o=QS[r.placedSide];return ne.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:ne.jsx(jS,{...s,ref:t,style:{...s.style,display:"block"}})})});_v.displayName=dv;function $S(a){return a!==null}var JS=a=>({name:"transformOrigin",options:a,fn(e){const{placement:t,rects:i,middlewareData:s}=e,o=s.arrow?.centerOffset!==0,c=o?0:a.arrowWidth,h=o?0:a.arrowHeight,[f,_]=mv(t),d={start:"0%",center:"50%",end:"100%"}[_],g=(s.arrow?.x??0)+c/2,p=(s.arrow?.y??0)+h/2;let x="",b="";return f==="bottom"?(x=o?d:`${g}px`,b=`${-h}px`):f==="top"?(x=o?d:`${g}px`,b=`${i.floating.height+h}px`):f==="right"?(x=`${-h}px`,b=o?d:`${p}px`):f==="left"&&(x=`${i.floating.width+h}px`,b=o?d:`${p}px`),{data:{x,y:b}}}});function mv(a){const[e,t="center"]=a.split("-");return[e,t]}var eE=uv,tE=fv,iE=_v;function sE(a,e){return Te.useReducer((t,i)=>e[t][i]??t,a)}var gv=a=>{const{present:e,children:t}=a,i=nE(e),s=typeof t=="function"?t({present:i.isPresent}):Te.Children.only(t),r=ia(i.ref,rE(s));return typeof t=="function"||i.isPresent?Te.cloneElement(s,{ref:r}):null};gv.displayName="Presence";function nE(a){const[e,t]=Te.useState(),i=Te.useRef(null),s=Te.useRef(a),r=Te.useRef("none"),o=a?"mounted":"unmounted",[c,h]=sE(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Te.useEffect(()=>{const f=Lc(i.current);r.current=c==="mounted"?f:"none"},[c]),nl(()=>{const f=i.current,_=s.current;if(_!==a){const g=r.current,p=Lc(f);a?h("MOUNT"):p==="none"||f?.display==="none"?h("UNMOUNT"):h(_&&g!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=a}},[a,h]),nl(()=>{if(e){let f;const _=e.ownerDocument.defaultView??window,d=p=>{const b=Lc(i.current).includes(CSS.escape(p.animationName));if(p.target===e&&b&&(h("ANIMATION_END"),!s.current)){const T=e.style.animationFillMode;e.style.animationFillMode="forwards",f=_.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=T)})}},g=p=>{p.target===e&&(r.current=Lc(i.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{_.clearTimeout(f),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else h("ANIMATION_END")},[e,h]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:Te.useCallback(f=>{i.current=f?getComputedStyle(f):null,t(f)},[])}}function Lc(a){return a?.animationName||"none"}function rE(a){let e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?a.ref:(e=Object.getOwnPropertyDescriptor(a,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?a.props.ref:a.props.ref||a.ref)}var aE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),oE="VisuallyHidden",pv=Te.forwardRef((a,e)=>ne.jsx(sa.span,{...a,ref:e,style:{...aE,...a.style}}));pv.displayName=oE;var lE=pv,[xh]=Hx("Tooltip",[lv]),Xd=lv(),yv="TooltipProvider",cE=700,Sy="tooltip.open",[hE,bv]=xh(yv),xv=a=>{const{__scopeTooltip:e,delayDuration:t=cE,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:r}=a,o=Te.useRef(!0),c=Te.useRef(!1),h=Te.useRef(0);return Te.useEffect(()=>{const f=h.current;return()=>window.clearTimeout(f)},[]),ne.jsx(hE,{scope:e,isOpenDelayedRef:o,delayDuration:t,onOpen:Te.useCallback(()=>{window.clearTimeout(h.current),o.current=!1},[]),onClose:Te.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>o.current=!0,i)},[i]),isPointerInTransitRef:c,onPointerInTransitChange:Te.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:r})};xv.displayName=yv;var vv="Tooltip",[IP,vh]=xh(vv),md="TooltipTrigger",uE=Te.forwardRef((a,e)=>{const{__scopeTooltip:t,...i}=a,s=vh(md,t),r=bv(md,t),o=Xd(t),c=Te.useRef(null),h=ia(e,c,s.onTriggerChange),f=Te.useRef(!1),_=Te.useRef(!1),d=Te.useCallback(()=>f.current=!1,[]);return Te.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),ne.jsx(eE,{asChild:!0,...o,children:ne.jsx(sa.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:h,onPointerMove:kn(a.onPointerMove,g=>{g.pointerType!=="touch"&&!_.current&&!r.isPointerInTransitRef.current&&(s.onTriggerEnter(),_.current=!0)}),onPointerLeave:kn(a.onPointerLeave,()=>{s.onTriggerLeave(),_.current=!1}),onPointerDown:kn(a.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:kn(a.onFocus,()=>{f.current||s.onOpen()}),onBlur:kn(a.onBlur,s.onClose),onClick:kn(a.onClick,s.onClose)})})});uE.displayName=md;var fE="TooltipPortal",[wP,dE]=xh(fE,{forceMount:void 0}),$a="TooltipContent",_E=Te.forwardRef((a,e)=>{const t=dE($a,a.__scopeTooltip),{forceMount:i=t.forceMount,side:s="top",...r}=a,o=vh($a,a.__scopeTooltip);return ne.jsx(gv,{present:i||o.open,children:o.disableHoverableContent?ne.jsx(Tv,{side:s,...r,ref:e}):ne.jsx(mE,{side:s,...r,ref:e})})}),mE=Te.forwardRef((a,e)=>{const t=vh($a,a.__scopeTooltip),i=bv($a,a.__scopeTooltip),s=Te.useRef(null),r=ia(e,s),[o,c]=Te.useState(null),{trigger:h,onClose:f}=t,_=s.current,{onPointerInTransitChange:d}=i,g=Te.useCallback(()=>{c(null),d(!1)},[d]),p=Te.useCallback((x,b)=>{const T=x.currentTarget,R={x:x.clientX,y:x.clientY},S=xE(R,T.getBoundingClientRect()),M=vE(R,S),I=TE(b.getBoundingClientRect()),A=AE([...M,...I]);c(A),d(!0)},[d]);return Te.useEffect(()=>()=>g(),[g]),Te.useEffect(()=>{if(h&&_){const x=T=>p(T,_),b=T=>p(T,h);return h.addEventListener("pointerleave",x),_.addEventListener("pointerleave",b),()=>{h.removeEventListener("pointerleave",x),_.removeEventListener("pointerleave",b)}}},[h,_,p,g]),Te.useEffect(()=>{if(o){const x=b=>{const T=b.target,R={x:b.clientX,y:b.clientY},S=h?.contains(T)||_?.contains(T),M=!RE(R,o);S?g():M&&(g(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[h,_,o,f,g]),ne.jsx(Tv,{...a,ref:r})}),[gE,pE]=xh(vv,{isInside:!1}),yE=TM("TooltipContent"),Tv=Te.forwardRef((a,e)=>{const{__scopeTooltip:t,children:i,"aria-label":s,onEscapeKeyDown:r,onPointerDownOutside:o,...c}=a,h=vh($a,t),f=Xd(t),{onClose:_}=h;return Te.useEffect(()=>(document.addEventListener(Sy,_),()=>document.removeEventListener(Sy,_)),[_]),Te.useEffect(()=>{if(h.trigger){const d=g=>{g.target?.contains(h.trigger)&&_()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[h.trigger,_]),ne.jsx(qx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:_,children:ne.jsxs(tE,{"data-state":h.stateAttribute,...f,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[ne.jsx(yE,{children:i}),ne.jsx(gE,{scope:t,isInside:!0,children:ne.jsx(lE,{id:h.contentId,role:"tooltip",children:s||i})})]})})});_E.displayName=$a;var Rv="TooltipArrow",bE=Te.forwardRef((a,e)=>{const{__scopeTooltip:t,...i}=a,s=Xd(t);return pE(Rv,t).isInside?null:ne.jsx(iE,{...s,...i,ref:e})});bE.displayName=Rv;function xE(a,e){const t=Math.abs(e.top-a.y),i=Math.abs(e.bottom-a.y),s=Math.abs(e.right-a.x),r=Math.abs(e.left-a.x);switch(Math.min(t,i,s,r)){case r:return"left";case s:return"right";case t:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function vE(a,e,t=5){const i=[];switch(e){case"top":i.push({x:a.x-t,y:a.y+t},{x:a.x+t,y:a.y+t});break;case"bottom":i.push({x:a.x-t,y:a.y-t},{x:a.x+t,y:a.y-t});break;case"left":i.push({x:a.x+t,y:a.y-t},{x:a.x+t,y:a.y+t});break;case"right":i.push({x:a.x-t,y:a.y-t},{x:a.x-t,y:a.y+t});break}return i}function TE(a){const{top:e,right:t,bottom:i,left:s}=a;return[{x:s,y:e},{x:t,y:e},{x:t,y:i},{x:s,y:i}]}function RE(a,e){const{x:t,y:i}=a;let s=!1;for(let r=0,o=e.length-1;r<e.length;o=r++){const c=e[r],h=e[o],f=c.x,_=c.y,d=h.x,g=h.y;_>i!=g>i&&t<(d-f)*(i-_)/(g-_)+f&&(s=!s)}return s}function AE(a){const e=a.slice();return e.sort((t,i)=>t.x<i.x?-1:t.x>i.x?1:t.y<i.y?-1:t.y>i.y?1:0),ME(e)}function ME(a){if(a.length<=1)return a.slice();const e=[];for(let i=0;i<a.length;i++){const s=a[i];for(;e.length>=2;){const r=e[e.length-1],o=e[e.length-2];if((r.x-o.x)*(s.y-o.y)>=(r.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const t=[];for(let i=a.length-1;i>=0;i--){const s=a[i];for(;t.length>=2;){const r=t[t.length-1],o=t[t.length-2];if((r.x-o.x)*(s.y-o.y)>=(r.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var SE=xv;function Av(a){var e,t,i="";
vendor: 4,686 bytes, line 50
50if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var s=a.length;for(e=0;e<s;e++)a[e]&&(t=Av(a[e]))&&(i&&(i+=" "),i+=t)}else for(t in a)a[t]&&(i&&(i+=" "),i+=t);return i}function EE(){for(var a,e,t=0,i="",s=arguments.length;t<s;t++)(a=arguments[t])&&(e=Av(a))&&(i&&(i+=" "),i+=e);return i}const qd="-",CE=a=>{const e=IE(a),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:o=>{const c=o.split(qd);return c[0]===""&&c.length!==1&&c.shift(),Mv(c,e)||DE(o)},getConflictingClassGroupIds:(o,c)=>{const h=t[o]||[];return c&&i[o]?[...h,...i[o]]:h}}},Mv=(a,e)=>{if(a.length===0)return e.classGroupId;const t=a[0],i=e.nextPart.get(t),s=i?Mv(a.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;const r=a.join(qd);return e.validators.find(({validator:o})=>o(r))?.classGroupId},Ey=/^\[(.+)\]$/,DE=a=>{if(Ey.test(a)){const e=Ey.exec(a)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},IE=a=>{const{theme:e,classGroups:t}=a,i={nextPart:new Map,validators:[]};for(const s in t)gd(t[s],i,s,e);return i},gd=(a,e,t,i)=>{a.forEach(s=>{if(typeof s=="string"){const r=s===""?e:Cy(e,s);r.classGroupId=t;return}if(typeof s=="function"){if(wE(s)){gd(s(i),e,t,i);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([r,o])=>{gd(o,Cy(e,r),t,i)})})},Cy=(a,e)=>{let t=a;return e.split(qd).forEach(i=>{t.nextPart.has(i)||t.nextPart.set(i,{nextPart:new Map,validators:[]}),t=t.nextPart.get(i)}),t},wE=a=>a.isThemeGetter,PE=a=>{if(a<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,i=new Map;const s=(r,o)=>{t.set(r,o),e++,e>a&&(e=0,i=t,t=new Map)};return{get(r){let o=t.get(r);if(o!==void 0)return o;if((o=i.get(r))!==void 0)return s(r,o),o},set(r,o){t.has(r)?t.set(r,o):s(r,o)}}},pd="!",yd=":",OE=yd.length,FE=a=>{const{prefix:e,experimentalParseClassName:t}=a;let i=s=>{const r=[];let o=0,c=0,h=0,f;for(let x=0;x<s.length;x++){let b=s[x];if(o===0&&c===0){if(b===yd){r.push(s.slice(h,x)),h=x+OE;continue}if(b==="/"){f=x;continue}}b==="["?o++:b==="]"?o--:b==="("?c++:b===")"&&c--}const _=r.length===0?s:s.substring(h),d=BE(_),g=d!==_,p=f&&f>h?f-h:void 0;return{modifiers:r,hasImportantModifier:g,baseClassName:d,maybePostfixModifierPosition:p}};if(e){const s=e+yd,r=i;i=o=>o.startsWith(s)?r(o.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(t){const s=i;i=r=>t({className:r,parseClassName:s})}return i},BE=a=>a.endsWith(pd)?a.substring(0,a.length-1):a.startsWith(pd)?a.substring(1):a,LE=a=>{const e=Object.fromEntries(a.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const s=[];let r=[];return i.forEach(o=>{o[0]==="["||e[o]?(s.push(...r.sort(),o),r=[]):r.push(o)}),s.push(...r.sort()),s}},UE=a=>({cache:PE(a.cacheSize),parseClassName:FE(a),sortModifiers:LE(a),...CE(a)}),kE=/\s+/,NE=(a,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:r}=e,o=[],c=a.trim().split(kE);let h="";for(let f=c.length-1;f>=0;f-=1){const _=c[f],{isExternal:d,modifiers:g,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:b}=t(_);if(d){h=_+(h.length>0?" "+h:h);continue}let T=!!b,R=i(T?x.substring(0,b):x);if(!R){if(!T){h=_+(h.length>0?" "+h:h);continue}if(R=i(x),!R){h=_+(h.length>0?" "+h:h);continue}T=!1}const S=r(g).join(":"),M=p?S+pd:S,I=M+R;if(o.includes(I))continue;o.push(I);const A=s(R,T);for(let D=0;D<A.length;++D){const C=A[D];o.push(M+C)}h=_+(h.length>0?" "+h:h)}return h};function zE(){let a=0,e,t,i="";for(;a<arguments.length;)(e=arguments[a++])&&(t=Sv(e))&&(i&&(i+=" "),i+=t);return i}const Sv=a=>{if(typeof a=="string")return a;let e,t="";for(let i=0;i<a.length;i++)a[i]&&(e=Sv(a[i]))&&(t&&(t+=" "),t+=e);return t};function VE(a,...e){let t,i,s,r=o;function o(h){const f=e.reduce((_,d)=>d(_),a());return t=UE(f),i=t.cache.get,s=t.cache.set,r=c,c(h)}function c(h){const f=i(h);if(f)return f;const _=NE(h,t);return s(h,_),_}return function(){return r(zE.apply(null,arguments))}}const Fi=a=>{const e=t=>t[a]||[];return e.isThemeGetter=!0,e},Ev=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GE=/^\d+\/\d+$/,HE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,XE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ha=a=>GE.test(a),vt=a=>!!a&&!Number.isNaN(Number(a)),mr=a=>!!a&&Number.isInteger(Number(a)),jf=a=>
vendor: 4,348 bytes, line 50
50a.endsWith("%")&&vt(a.slice(0,-1)),On=a=>HE.test(a),YE=()=>!0,KE=a=>WE.test(a)&&!XE.test(a),Dv=()=>!1,ZE=a=>qE.test(a),QE=a=>jE.test(a),$E=a=>!Je(a)&&!et(a),JE=a=>so(a,Pv,Dv),Je=a=>Ev.test(a),Wr=a=>so(a,Ov,KE),Yf=a=>so(a,nC,vt),Dy=a=>so(a,Iv,Dv),eC=a=>so(a,wv,QE),Uc=a=>so(a,Fv,ZE),et=a=>Cv.test(a),$o=a=>no(a,Ov),tC=a=>no(a,rC),Iy=a=>no(a,Iv),iC=a=>no(a,Pv),sC=a=>no(a,wv),kc=a=>no(a,Fv,!0),so=(a,e,t)=>{const i=Ev.exec(a);return i?i[1]?e(i[1]):t(i[2]):!1},no=(a,e,t=!1)=>{const i=Cv.exec(a);return i?i[1]?e(i[1]):t:!1},Iv=a=>a==="position"||a==="percentage",wv=a=>a==="image"||a==="url",Pv=a=>a==="length"||a==="size"||a==="bg-size",Ov=a=>a==="length",nC=a=>a==="number",rC=a=>a==="family-name",Fv=a=>a==="shadow",aC=()=>{const a=Fi("color"),e=Fi("font"),t=Fi("text"),i=Fi("font-weight"),s=Fi("tracking"),r=Fi("leading"),o=Fi("breakpoint"),c=Fi("container"),h=Fi("spacing"),f=Fi("radius"),_=Fi("shadow"),d=Fi("inset-shadow"),g=Fi("text-shadow"),p=Fi("drop-shadow"),x=Fi("blur"),b=Fi("perspective"),T=Fi("aspect"),R=Fi("ease"),S=Fi("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...I(),et,Je],D=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],k=()=>[et,Je,h],H=()=>[Ha,"full","auto",...k()],L=()=>[mr,"none","subgrid",et,Je],J=()=>["auto",{span:["full",mr,et,Je]},mr,et,Je],te=()=>[mr,"auto",et,Je],ae=()=>["auto","min","max","fr",et,Je],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...k()],X=()=>[Ha,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],q=()=>[a,et,Je],G=()=>[...I(),Iy,Dy,{position:[et,Je]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],w=()=>["auto","cover","contain",iC,JE,{size:[et,Je]}],O=()=>[jf,$o,Wr],U=()=>["","none","full",f,et,Je],W=()=>["",vt,$o,Wr],oe=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[vt,jf,Iy,Dy],Ee=()=>["","none",x,et,Je],Fe=()=>["none",vt,et,Je],Y=()=>["none",vt,et,Je],ue=()=>[vt,et,Je],de=()=>[Ha,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[On],breakpoint:[On],color:[YE],container:[On],"drop-shadow":[On],ease:["in","out","in-out"],font:[$E],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[On],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[On],shadow:[On],spacing:["px",vt],text:[On],"text-shadow":[On],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ha,Je,et,T]}],container:["container"],columns:[{columns:[vt,Je,et,c]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{start:H()}],end:[{end:H()}],top:[{top:H()}
vendor: 11,585 bytes, line 50
50],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[mr,"auto",et,Je]}],basis:[{basis:[Ha,"full","auto",c,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,Ha,"auto","initial","none",Je]}],grow:[{grow:["",vt,et,Je]}],shrink:[{shrink:["",vt,et,Je]}],order:[{order:[mr,"first","last","none",et,Je]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[c,"screen",...X()]}],"min-w":[{"min-w":[c,"screen","none",...X()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",t,$o,Wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,et,Yf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jf,Je]}],"font-family":[{font:[tC,Je,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,et,Je]}],"line-clamp":[{"line-clamp":[vt,"none",et,Yf]}],leading:[{leading:[r,...k()]}],"list-image":[{"list-image":["none",et,Je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",et,Je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",et,Wr]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[vt,"auto",et,Je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",et,Je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",et,Je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:w()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mr,et,Je],radial:["",et,Je],conic:[mr,et,Je]},sC,eC]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,et,Je]}],"outline-w":[{outline:["",vt,$o,Wr]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",_,kc,Uc]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",d,kc,Uc]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[vt,Wr]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",g,kc,Uc]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[vt,et,Je]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[et,Je]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:w()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",et,Je]}],filter:[{filter:["","none",et,Je]}],blur:[{blur:Ee()}],brightness:[{brightness:[vt,et,Je]}],contrast:[{contrast:[vt,et,Je]}],"drop-shadow":[{"drop-shadow":["","none",p,kc,Uc]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",vt,et,Je]}],"hue-rotate":[{"hue-rotate":[vt,et,Je]}],invert:[{invert:["",vt,et,Je]}],saturate:[{saturate:[vt,et,Je]}],sepia:[{sepia:["",vt,et,Je]}],"backdrop-filter":[{"backdrop-filter":["","none",et,Je]}],"backdrop-blur":[{"backdrop-blur":Ee()}],"backdrop-brightness":[{"backdrop-brightness":[vt,et,Je]}],"backdrop-contrast":[{"backdrop-contrast":[vt,et,Je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,et,Je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,et,Je]}],"backdrop-invert":[{"backdrop-invert":["",vt,et,Je]}],"backdrop-opacity":[{"backdrop-opacity":[vt,et,Je]}],"backdrop-saturate":[{"backdrop-saturate":[vt,et,Je]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,et,Je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",et,Je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",et,Je]}],ease:[{ease:["linear","initial",R,et,Je]}],delay:[{delay:[vt,et,Je]}],animate:[{animate:["none",S,et,Je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,et,Je]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[et,Je,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}
50],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",et,Je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",et,Je]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[vt,$o,Wr,Yf]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},oC=VE(aC);function lC(...a){return oC(EE(a))}function cC({delayDuration:a=0,...e}){return ne.jsx(SE,{"data-loc":"client/src/components/ui/tooltip.tsx:11","data-slot":"tooltip-provider",delayDuration:a,...e})}/**
51 * @license lucide-react v0.453.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const hC=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Bv=(...a)=>a.filter((e,t,i)=>!!e&&i.indexOf(e)===t).join(" ");/**
56 * @license lucide-react v0.453.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */var uC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
61 * @license lucide-react v0.453.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const fC=Te.forwardRef(({color:a="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:r,iconNode:o,...c},h)=>Te.createElement("svg",{ref:h,...uC,width:e,height:e,stroke:a,strokeWidth:i?Number(t)*24/Number(e):t,className:Bv("lucide",s),...c},[...o.map(([f,_])=>Te.createElement(f,_)),...Array.isArray(r)?r:[r]]));/**
66 * @license lucide-react v0.453.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const Ys=(a,e)=>{const t=Te.forwardRef(({className:i,...s},r)=>Te.createElement(fC,{ref:r,iconNode:e,className:Bv(`lucide-${hC(a)}`,i),...s}));return t.displayName=`${a}`,t};/**
71 * @license lucide-react v0.453.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const Kf=Ys("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
76 * @license lucide-react v0.453.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const dC=Ys("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
81 * @license lucide-react v0.453.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const _C=Ys("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
86 * @license lucide-react v0.453.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const wy=Ys("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
91 * @license lucide-react v0.453.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const Zf=Ys("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
96 * @license lucide-react v0.453.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const mC=Ys("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
101 * @license lucide-react v0.453.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const gC=Ys("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
106 * @license lucide-react v0.453.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const Lv=Ys("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
111 * @license lucide-react v0.453.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const pC=Ys("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
116 * @license lucide-react v0.453.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const yC=Ys("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
121 * @license lucide-react v0.453.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const bC=Ys("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);class xC extends Te.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?ne.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:27",className:"flex items-center justify-center min-h-screen p-8 bg-background",children:ne.jsxs("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:28",className:"flex flex-col items-center w-full max-w-2xl p-8",children:[ne.jsx(bC,{"data-loc":"client/src/components/ErrorBoundary.tsx:29",size:48,className:"text-destructive mb-6 flex-shrink-0"}),ne.jsx("h2",{"data-loc":"client/src/components/ErrorBoundary.tsx:34",className:"text-xl mb-4",children:"An unexpected error occurred."}),ne.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:36",className:"p-4 w-full rounded bg-muted overflow-auto mb-6",children:ne.jsx("pre",{"data-loc":"client/src/components/ErrorBoundary.tsx:37",className:"text-sm text-muted-foreground whitespace-break-spaces",children:this.state.error?.stack})}),ne.jsxs("button",{"data-loc":"client/src/components/ErrorBoundary.tsx:42",onClick:()=>window.location.reload(),className:lC("flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground","hover:opacity-90 cursor-pointer"),children:[ne.jsx(Lv,{"data-loc":"client/src/components/ErrorBoundary.tsx:50",size:16}),"Reload Page"]})]})}):this.props.children}}const vC=Te.createContext(void 0);function TC({children:a,defaultTheme:e="light",switchable:t=!1}){const[i,s]=Te.useState(()=>t&&localStorage.getItem("theme")||e);Te.useEffect(()=>{const o=document.documentElement;i==="dark"?o.classList.add("dark"):o.classList.remove("dark"),t&&localStorage.setItem("theme",i)},[i,t]);const r=t?()=>{s(o=>o==="light"?"dark":"light")}:void 0;return ne.jsx(vC.Provider,{"data-loc":"client/src/contexts/ThemeContext.tsx:52",value:{theme:i,toggleTheme:r,switchable:t},children:a})}const RC=typeof WeakRef<"u";class AC{constructor(e,t=!1,i,s){this.initialize(e,t,i,s)}initialize(e,t=!1,i,s){return this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=s,this}}class MC{constructor(e,t,i=null){this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){this._remove&&this._remove(e)}}class Ae{static FromPromise(e,t){const i=new Ae;return e.then(s=>{i.notifyObservers(s)}).catch(s=>{if(t)t.notifyObservers(s);else throw s}),i}get observers(){return this._observers}constructor(e,t=!1){this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new AC(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,s=null,r=!1){if(!e)return null;const o=new MC(e,t,s);o.unregisterOnNextCall=r,i?this._observers.unshift(o):this._observers.push(o),this._onObserverAdded&&this._onObserverAdded(o),this._hasNotified&&this.notifyIfTriggered&&this._lastNotifiedValue!==void 0&&this.notifyObserver(o,this._lastNotifiedValue);const c=RC?new WeakRef(this):{deref:()=>this};return o._remove=(h=!1)=>{const f=c.deref();f&&(h?f.remove(o):f._remove(o))},o}
vendor: 60,991 bytes, lines 125-142
125addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!1}removeCallback(e,t){for(let i=0;i<this._observers.length;i++){const s=this._observers[i];if(!s._willBeUnregistered&&s.callback===e&&(!t||t===s.scope))return this._deferUnregister(s),!0}return!1}_deferUnregister(e){e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0))}_remove(e,t=!0){if(!e)return!1;const i=this._observers.indexOf(e);return i!==-1?(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,i,s,r){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const o=this._eventState;o.mask=t,o.target=i,o.currentTarget=s,o.skipNextObservers=!1,o.lastReturnValue=e,o.userInfo=r;for(const c of this._observers)if(!c._willBeUnregistered&&(c.mask&t&&(c.unregisterOnNextCall&&this._deferUnregister(c),c.scope?o.lastReturnValue=c.callback.apply(c.scope,[e,o]):o.lastReturnValue=c.callback(e,o)),o.skipNextObservers))return!1;return!0}notifyObserver(e,t,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const s=this._eventState;s.mask=i,s.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,s)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){const e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){const e=new Ae;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(const t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}class SC{get wrapU(){return this._cachedWrapU}set wrapU(e){this._cachedWrapU=e}get wrapV(){return this._cachedWrapV}set wrapV(e){this._cachedWrapV=e}get wrapR(){return this._cachedWrapR}set wrapR(e){this._cachedWrapR=e}get anisotropicFilteringLevel(){return this._cachedAnisotropicFilteringLevel}set anisotropicFilteringLevel(e){this._cachedAnisotropicFilteringLevel=e}get comparisonFunction(){return this._comparisonFunction}set comparisonFunction(e){this._comparisonFunction=e}get useMipMaps(){return this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}constructor(){this.samplingMode=-1,this._useMipMaps=!0,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._comparisonFunction=0}setParameters(e=1,t=1,i=1,s=1,r=2,o=0){return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=i,this._cachedAnisotropicFilteringLevel=s,this.samplingMode=r,this._comparisonFunction=o,this}compareSampler(e){return this._cachedWrapU===e._cachedWrapU&&this._cachedWrapV===e._cachedWrapV&&this._cachedWrapR===e._cachedWrapR&&this._cachedAnisotropicFilteringLevel===e._cachedAnisotropicFilteringLevel&&this.samplingMode===e.samplingMode&&this._comparisonFunction===e._comparisonFunction&&this._useMipMaps===e._useMipMaps}}var Py;(function(a){a[a.Unknown=0]="Unknown",a[a.Url=1]="Url",a[a.Temp=2]="Temp",a[a.Raw=3]="Raw",a[a.Dynamic=4]="Dynamic",a[a.RenderTarget=5]="RenderTarget",a[a.MultiRenderTarget=6]="MultiRenderTarget",a[a.Cube=7]="Cube",a[a.CubeRaw=8]="CubeRaw",a[a.CubePrefiltered=9]="CubePrefiltered",a[a.Raw3D=10]="Raw3D",a[a.Raw2DArray=11]="Raw2DArray",a[a.DepthStencil=12]="DepthStencil",a[a.CubeRawRGBD=13]="CubeRawRGBD",a[a.Depth=14]="Depth",a[a.External=15]="External"})(Py||(Py={}));class is extends SC{get useMipMaps(){return this._useMipMaps===null?this.generateMipMaps:this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}get uniqueId(){return this._uniqueId}_setUniqueId(e){this._uniqueId=e}getEngine(){return this._engine}get source(){return this._source}constructor(e,t,i=!1){super(),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.generateMipMaps=!1,this._useMipMaps=null,this.mipLevelCount=1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new Ae,this.onErrorObservable=new Ae,this.onRebuildCallback=null,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=0,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._cachedCoordinatesMode=null,this._isDisabled=!1,this._compression=null,this._sphericalPolynomial=null,this._sphericalPolynomialPromise=null,this._sphericalPolynomialComputed=!1,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._useSRGBBuffer=!1,this._creationFlags=0,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._hardwareTexture=null,this._maxLodLevel=null,this._references=1,this._gammaSpace=null,this._premulAlpha=!1,this._dynamicTextureSource=null,this._autoMSAAManagement=!1,this._engine=e,this._source=t,this._uniqueId=is._Counter++,i||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){this._references++}updateSize(e,t,i=1){this._engine.updateTextureDimensions(this,e,t,i),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i}_rebuild(){if(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){const t=this.onRebuildCallback(this),i=s=>{s._swapAndDie(this,!1),this.isReady=t.isReady};t.isAsync?t.proxy.then(i):i(t.proxy);return}let e;switch(this.source){case 2:break;case 1:e=this._engine.createTexture(this._originalUrl??this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,t=>{t._swapAndDie(this,!1),this.isReady=!0},null,this._buffer,void 0,this.format,this._extension,void 0,void 0,void 0,this._useSRGBBuffer);return;case 3:if(e=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this._useSRGBBuffer,this.mipLevelCount),e._swapAndDie(this,!1),this._bufferViewArray)for(let t=0;t<this._bufferViewArray.length;t++){const i=this._bufferViewArray[t];i&&this._engine.updateRawTexture(this,i,this.format,this.invertY,this._compression,this.type,this._useSRGBBuffer,t)}this.isReady=!0;break;case 10:e=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 11:if(e=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this.mipLevelCount),e._swapAndDie(this,!1),this._bufferViewArray)for(let t=0;t<this._bufferViewArray.length;t++){const i=this._bufferViewArray[t];i&&this._engine.updateRawTexture2DArray(this,i,this.format,this.invertY,this._compression,this.type,t)}this.isReady=!0;break;case 4:e=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode),e._swapAndDie(this,!1),this._dynamicTextureSource&&this._engine.updateDynamicTexture(this,this._dynamicTextureSource,this.invertY,this._premulAlpha,this.format,!0);break;case 7:e=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer,ArrayBuffer.isView(this._buffer)?this._buffer:null);return;case 8:e=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this._originalFormat??this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),e._swapAndDie(this,!1),this.isReady=!0;break;case 13:return;case 9:e=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,t=>{t&&t._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension),e._sphericalPolynomial=this._sphericalPolynomial;return}}_swapAndDie(e,t=!0){this._hardwareTexture?.setUsage(e._source,this.generateMipMaps,this.is2DArray,this.isCube,this.is3D,this.width,this.height,this.depth),e._hardwareTexture=this._hardwareTexture,e._setUniqueId(is._Counter++),t&&(e._isRGBD=this._isRGBD),this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);const i=this._engine.getLoadedTexturesCache();let s=i.indexOf(this);s!==-1&&i.splice(s,1),s=i.indexOf(e),s===-1&&i.push(e)}dispose(){this._references--,this._references===0&&(this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}is._Counter=0;class ft{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}ft.Instances=[];ft.OnEnginesDisposedObservable=new Ae;ft._LastCreatedScene=null;ft.UseFallbackTexture=!0;ft.FallbackTexture="";class me{static _CheckLimit(e,t){let i=me._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},me._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){const i=me._LogLimitOutputs[e];if(!i||!me.MessageLimitReached)return;const s=this._Levels[t];i.current===i.limit&&me[s.name](me.MessageLimitReached.replace(/%LIMIT%/g,""+i.limit).replace(/%TYPE%/g,s.name??""))}static _AddLogEntry(e){me._LogCache=e+me._LogCache,me.OnNewCacheEntry&&me.OnNewCacheEntry(e)}static _FormatMessage(e){const t=s=>s<10?"0"+s:""+s,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,i){const s=Array.isArray(t)?t[0]:t;if(i!==void 0&&!me._CheckLimit(s,i))return;const r=me._FormatMessage(s),o=this._Levels[e],c=Array.isArray(t)?t.slice(1):[];o.logFunc&&o.logFunc("BJS - "+r,...c);const h=`<div style='color:${o.color}'>${r}</div><br>`;me._AddLogEntry(h),me._GenerateLimitMessage(s,e)}static get LogCache(){return me._LogCache}static ClearLogCache(){me._LogCache="",me._LogLimitOutputs={},me.errorsCount=0}static set LogLevels(e){me.Log=me._LogDisabled,me.Warn=me._LogDisabled,me.Error=me._LogDisabled;const t=[me.MessageLogLevel,me.WarningLogLevel,me.ErrorLogLevel];for(const i of t)if((e&i)===i){const s=this._Levels[i];me[s.name]=me._LogEnabled.bind(me,i)}}}me.NoneLogLevel=0;me.MessageLogLevel=1;me.WarningLogLevel=2;me.ErrorLogLevel=4;me.AllLogLevel=7;me.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";me._LogCache="";me._LogLimitOutputs={};me._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}];me.errorsCount=0;me.Log=me._LogEnabled.bind(me,me.MessageLogLevel);me.Warn=me._LogEnabled.bind(me,me.WarningLogLevel);me.Error=me._LogEnabled.bind(me,me.ErrorLogLevel);class yi{static GetShadersRepository(e=0){return e===0?yi.ShadersRepository:yi.ShadersRepositoryWGSL}static GetShadersStore(e=0){return e===0?yi.ShadersStore:yi.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return e===0?yi.IncludesShadersStore:yi.IncludesShadersStoreWGSL}}yi.ShadersRepository="src/Shaders/";yi.ShadersStore={};yi.IncludesShadersStore={};yi.ShadersRepositoryWGSL="src/ShadersWGSL/";yi.ShadersStoreWGSL={};yi.IncludesShadersStoreWGSL={};function Bi(){return typeof window<"u"}function Xa(){return typeof navigator<"u"}function Qr(){return typeof document<"u"}function Uv(a){let e="",t=a.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}class EC{constructor(){this._valueCache={},this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null,this._isDisposed=!1}get isAsync(){return this.isParallelCompiled}get isReady(){return this.program?this.isParallelCompiled?this.engine._isRenderingStateCompiled(this):!0:!1}_handlesSpectorRebuildCallback(e){e&&this.program&&e(this.program)}setEngine(e){this.engine=e}_fillEffectInformation(e,t,i,s,r,o,c,h){const f=this.engine;if(f.supportsUniformBuffers)for(const g in t)e.bindUniformBlock(g,t[g]);this.engine.getUniforms(this,i).forEach((g,p)=>{s[i[p]]=g}),this._uniforms=s;let d;for(d=0;d<r.length;d++)e.getUniform(r[d])==null&&(r.splice(d,1),d--);r.forEach((g,p)=>{o[g]=p});for(const g of f.getAttributes(this,c))h.push(g)}dispose(){this._uniforms={},this._isDisposed=!0}_cacheMatrix(e,t){const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_cacheFloat2(e,t,i){let s=this._valueCache[e];if(!s||s.length!==2)return s=[t,i],this._valueCache[e]=s,!0;let r=!1;return s[0]!==t&&(s[0]=t,r=!0),s[1]!==i&&(s[1]=i,r=!0),r}_cacheFloat3(e,t,i,s){let r=this._valueCache[e];if(!r||r.length!==3)return r=[t,i,s],this._valueCache[e]=r,!0;let o=!1;return r[0]!==t&&(r[0]=t,o=!0),r[1]!==i&&(r[1]=i,o=!0),r[2]!==s&&(r[2]=s,o=!0),o}_cacheFloat4(e,t,i,s,r){let o=this._valueCache[e];if(!o||o.length!==4)return o=[t,i,s,r],this._valueCache[e]=o,!0;let c=!1;return o[0]!==t&&(o[0]=t,c=!0),o[1]!==i&&(o[1]=i,c=!0),o[2]!==s&&(o[2]=s,c=!0),o[3]!==r&&(o[3]=r,c=!0),c}setInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setInt4(e,t,i,s,r){this._cacheFloat4(e,t,i,s,r)&&(this.engine.setInt4(this._uniforms[e],t,i,s,r)||(this._valueCache[e]=null))}setIntArray(e,t){this._valueCache[e]=null,this.engine.setIntArray(this._uniforms[e],t)}setIntArray2(e,t){this._valueCache[e]=null,this.engine.setIntArray2(this._uniforms[e],t)}setIntArray3(e,t){this._valueCache[e]=null,this.engine.setIntArray3(this._uniforms[e],t)}setIntArray4(e,t){this._valueCache[e]=null,this.engine.setIntArray4(this._uniforms[e],t)}setUInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setUInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setUInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setUInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setUInt4(e,t,i,s,r){this._cacheFloat4(e,t,i,s,r)&&(this.engine.setUInt4(this._uniforms[e],t,i,s,r)||(this._valueCache[e]=null))}setUIntArray(e,t){this._valueCache[e]=null,this.engine.setUIntArray(this._uniforms[e],t)}setUIntArray2(e,t){this._valueCache[e]=null,this.engine.setUIntArray2(this._uniforms[e],t)}setUIntArray3(e,t){this._valueCache[e]=null,this.engine.setUIntArray3(this._uniforms[e],t)}setUIntArray4(e,t){this._valueCache[e]=null,this.engine.setUIntArray4(this._uniforms[e],t)}setArray(e,t){this._valueCache[e]=null,this.engine.setArray(this._uniforms[e],t)}setArray2(e,t){this._valueCache[e]=null,this.engine.setArray2(this._uniforms[e],t)}setArray3(e,t){this._valueCache[e]=null,this.engine.setArray3(this._uniforms[e],t)}setArray4(e,t){this._valueCache[e]=null,this.engine.setArray4(this._uniforms[e],t)}setMatrices(e,t){t&&(this._valueCache[e]=null,this.engine.setMatrices(this._uniforms[e],t))}setMatrix(e,t){this._cacheMatrix(e,t)&&(this.engine.setMatrices(this._uniforms[e],t.asArray())||(this._valueCache[e]=null))}setMatrix3x3(e,t){this._valueCache[e]=null,this.engine.setMatrix3x3(this._uniforms[e],t)}setMatrix2x2(e,t){this._valueCache[e]=null,this.engine.setMatrix2x2(this._uniforms[e],t)}setFloat(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t)}setVector2(e,t){this._cacheFloat2(e,t.x,t.y)&&(this.engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null))}setFloat2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setFloat2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setVector3(e,t){this._cacheFloat3(e,t.x,t.y,t.z)&&(this.engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null))}setFloat3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setFloat3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setVector4(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setQuaternion(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setFloat4(e,t,i,s,r){this._cacheFloat4(e,t,i,s,r)&&(this.engine.setFloat4(this._uniforms[e],t,i,s,r)||(this._valueCache[e]=null))}setColor3(e,t){this._cacheFloat3(e,t.r,t.g,t.b)&&(this.engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null))}setColor4(e,t,i){this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(this._valueCache[e]=null))}setDirectColor4(e,t){this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null))}_getVertexShaderCode(){return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null}_getFragmentShaderCode(){return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null}}const Oy={};function je(a,e=!1){if(!(e&&Oy[a]))return Oy[a]=!0,`${a} needs to be imported before as it contains a side-effect required by your code.`}const Fy={};let CC=!1,DC=0;function He(a,e,t=!1){const i=function(){if((t||CC)&&DC===0){const s=`${a}.${e}`;Fy[s]||(Fy[s]=!0,console.warn(`[Babylon.js] ${s}() requires a side-effect import. See: https://doc.babylonjs.com/setup/treeshaking`))}};return i.__isSideEffectStub=!0,i}function jd(a){return a?!a.__isSideEffectStub:!1}function mt(a,e){return{get(){},set(t){Object.defineProperty(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0}}const Zr={};function kv(a,e,t=""){return t+(e?e+`
126`:"")+a}function Nv(a,e,t,i,s,r,o){const c=o||Zr.loadFile;if(!c)throw je("FileTools");return c(a,e,t,i,s,r)}function zv(a,e,t,i){if(a){e?a.IS_NDC_HALF_ZRANGE="":delete a.IS_NDC_HALF_ZRANGE,t?a.USE_REVERSE_DEPTHBUFFER="":delete a.USE_REVERSE_DEPTHBUFFER,i?a.USE_EXACT_SRGB_CONVERSIONS="":delete a.USE_EXACT_SRGB_CONVERSIONS;return}else{let s="";return e&&(s+="#define IS_NDC_HALF_ZRANGE"),t&&(s&&(s+=`
127`),s+="#define USE_REVERSE_DEPTHBUFFER"),i&&(s&&(s+=`
128`),s+="#define USE_EXACT_SRGB_CONVERSIONS"),s}}function IC(a,e,t=!1,i){switch(a){case 3:return new Int8Array(e);case 0:return new Uint8Array(e);case 4:return typeof e!="number"?new Int16Array(e):new Int16Array(t?e/2:e);case 5:case 8:case 9:case 10:case 2:return typeof e!="number"?new Uint16Array(e):new Uint16Array(t?e/2:e);case 6:return typeof e!="number"?new Int32Array(e):new Int32Array(t?e/4:e);case 7:case 11:case 12:case 13:case 14:case 15:return typeof e!="number"?new Uint32Array(e):new Uint32Array(t?e/4:e);case 1:return typeof e!="number"?new Float32Array(e):new Float32Array(t?e/4:e)}return new Uint8Array(e)}const bd=new WeakMap,wC={_webGLVersion:2,cachedPipelines:{}};function fs(a){let e=bd.get(a);if(!e){if(!a)return wC;e={_webGLVersion:a.TEXTURE_BINDING_3D?2:1,_context:a,parallelShaderCompile:a.getExtension("KHR_parallel_shader_compile")||void 0,cachedPipelines:{}},bd.set(a,e)}return e}function Qf(a){bd.delete(a)}function Vv(a,e,t,i,s,r){const o=fs(i);r||(r=o._createShaderProgramInjection??Yd);const c=xd(e,"vertex",i,o._contextWasLost),h=xd(t,"fragment",i,o._contextWasLost);return r(a,c,h,i,s,o.validateShaderPrograms)}function Gv(a,e,t,i,s,r=null,o){const c=fs(s);o||(o=c._createShaderProgramInjection??Yd);const h=c._webGLVersion>1?`#version 300 es
129#define WEBGL2 
130`:"",f=By(e,"vertex",i,h,s,c._contextWasLost),_=By(t,"fragment",i,h,s,c._contextWasLost);return o(a,f,_,s,r,c.validateShaderPrograms)}function PC(a,e){const t=new EC,i=fs(a);return i.parallelShaderCompile&&!i.disableParallelShaderCompile&&(t.isParallelCompiled=!0),t.context=i._context,t}function Yd(a,e,t,i,s=null,r){const o=i.createProgram();if(a.program=o,!o)throw new Error("Unable to create program");return i.attachShader(o,e),i.attachShader(o,t),i.linkProgram(o),a.context=i,a.vertexShader=e,a.fragmentShader=t,a.isParallelCompiled||Kd(a,i,r),o}function OC(a,e,t){const i=a;if(i._isDisposed)return!1;const s=fs(e);return s&&s.parallelShaderCompile&&s.parallelShaderCompile.COMPLETION_STATUS_KHR&&i.program&&e.getProgramParameter(i.program,s.parallelShaderCompile.COMPLETION_STATUS_KHR)?(Kd(i,e,t),!0):!1}function Kd(a,e,t){const i=a.context,s=a.vertexShader,r=a.fragmentShader,o=a.program;if(!i.getProgramParameter(o,i.LINK_STATUS)){if(!e.getShaderParameter(s,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(s);if(f)throw a.vertexCompilationError=f,new Error("VERTEX SHADER "+f)}if(!e.getShaderParameter(r,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(r);if(f)throw a.fragmentCompilationError=f,new Error("FRAGMENT SHADER "+f)}const h=i.getProgramInfoLog(o);if(h)throw a.programLinkError=h,new Error(h)}if(t&&(i.validateProgram(o),!i.getProgramParameter(o,i.VALIDATE_STATUS))){const f=i.getProgramInfoLog(o);if(f)throw a.programValidationError=f,new Error(f)}i.deleteShader(s),i.deleteShader(r),a.vertexShader=void 0,a.fragmentShader=void 0,a.onCompiled&&(a.onCompiled(),a.onCompiled=void 0)}function FC(a,e,t,i,s,r,o,c,h,f="",_,d,g){const p=fs(a.context);d||(d=p.createRawShaderProgramInjection??Vv),g||(g=p.createShaderProgramInjection??Gv);const x=a;i?x.program=d(x,e,t,x.context,h):x.program=g(x,e,t,c,x.context,h),x.program.__SPECTOR_rebuildProgram=o,_()}function By(a,e,t,i,s,r){return xd(kv(a,t,i),e,s,r)}function xd(a,e,t,i){const s=t.createShader(e==="vertex"?t.VERTEX_SHADER:t.FRAGMENT_SHADER);if(!s){let r=t.NO_ERROR,o;for(;(o=t.getError())!==t.NO_ERROR;)r=o;throw new Error(`Something went wrong while creating a gl ${e} shader object. gl error=${r}, gl isContextLost=${t.isContextLost()}, _contextWasLost=${i}`)}return t.shaderSource(s,a),t.compileShader(s),s}function BC(a,e){e.useProgram(a)}function LC(a,e){const t=a;if(!t.isParallelCompiled){e(a);return}const i=t.onCompiled;t.onCompiled=()=>{i?.(),e(a)}}const UC="attribute",kC="varying";class bl{constructor(){this.children=[]}isValid(e){return!0}process(e,t,i){let s="";if(this.line){let r=this.line;const o=t.processor;if(o){o.lineProcessor&&(r=o.lineProcessor(r,t.isFragment,t.processingContext));const c=t.processor?.attributeKeywordName??UC,h=t.isFragment&&t.processor?.varyingFragmentKeywordName?t.processor?.varyingFragmentKeywordName:!t.isFragment&&t.processor?.varyingVertexKeywordName?t.processor?.varyingVertexKeywordName:kC;!t.isFragment&&o.attributeProcessor&&this.line.startsWith(c)?r=o.attributeProcessor(this.line,e,t.processingContext):o.varyingProcessor&&(o.varyingCheck?.(this.line,t.isFragment)||!o.varyingCheck&&this.line.startsWith(h))?r=o.varyingProcessor(this.line,t.isFragment,e,t.processingContext):o.uniformProcessor&&o.uniformRegexp&&o.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(r=o.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):o.uniformBufferProcessor&&o.uniformBufferRegexp&&o.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(r=o.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):o.textureProcessor&&o.textureRegexp&&o.textureRegexp.test(this.line)?r=o.textureProcessor(this.line,t.isFragment,e,t.processingContext):(o.uniformProcessor||o.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?o.uniformProcessor&&(r=o.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):o.uniformBufferProcessor&&(r=o.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,o.endOfUniformBufferProcessor&&(r=o.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}s+=r+`
131`}for(const r of this.children)s+=r.process(e,t,i);return this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true",i[this.additionalDefineKey]=e[this.additionalDefineKey]),s}}class NC{constructor(){this._lines=[]}get currentLine(){return this._lines[this.lineIndex]}get canRead(){return this.lineIndex<this._lines.length-1}set lines(e){this._lines.length=0;for(const t of e){if(!t||t==="\r")continue;if(t[0]==="#"){this._lines.push(t);continue}const i=t.trim();if(!i)continue;if(i.startsWith("//")){this._lines.push(t);continue}const s=i.indexOf(";");if(s===-1)this._lines.push(i);else if(s===i.length-1)i.length>1&&this._lines.push(i);else{const r=t.split(";");for(let o=0;o<r.length;o++){let c=r[o];c&&(c=c.trim(),c&&this._lines.push(c+(o!==r.length-1?";":"")))}}}}}class $f extends bl{process(e,t,i){for(let s=0;s<this.children.length;s++){const r=this.children[s];if(r.isValid(e))return r.process(e,t,i)}return""}}class zC extends bl{isValid(e){return this.testExpression.isTrue(e)}}class ni{isTrue(e){return!0}static postfixToInfix(e){const t=[];for(const i of e)if(ni._OperatorPriority[i]===void 0)t.push(i);else{const s=t[t.length-1],r=t[t.length-2];t.length-=2,t.push(`(${r}${i}${s})`)}return t[t.length-1]}static infixToPostfix(e){const t=ni._InfixToPostfixCache.get(e);if(t)return t.accessTime=Date.now(),t.result;if(!e.includes("&&")&&!e.includes("||")&&!e.includes(")")&&!e.includes("("))return[e];const i=[];let s=-1;const r=()=>{_=_.trim(),_!==""&&(i.push(_),_="")},o=d=>{s<ni._Stack.length-1&&(ni._Stack[++s]=d)},c=()=>ni._Stack[s],h=()=>s===-1?"!!INVALID EXPRESSION!!":ni._Stack[s--];let f=0,_="";for(;f<e.length;){const d=e.charAt(f),g=f<e.length-1?e.substring(f,2+f):"";if(d==="(")_="",o(d);else if(d===")"){for(r();s!==-1&&c()!=="(";)i.push(h());h()}else if(ni._OperatorPriority[g]>1){for(r();s!==-1&&ni._OperatorPriority[c()]>=ni._OperatorPriority[g];)i.push(h());o(g),f++}else _+=d;f++}for(r();s!==-1;)c()==="("?h():i.push(h());return ni._InfixToPostfixCache.size>=ni.InfixToPostfixCacheLimitSize&&ni.ClearCache(),ni._InfixToPostfixCache.set(e,{result:i,accessTime:Date.now()}),i}static ClearCache(){const e=Array.from(ni._InfixToPostfixCache.entries()).sort((t,i)=>t[1].accessTime-i[1].accessTime);for(let t=0;t<ni.InfixToPostfixCacheCleanupSize;t++)ni._InfixToPostfixCache.delete(e[t][0])}}ni.InfixToPostfixCacheLimitSize=5e4;ni.InfixToPostfixCacheCleanupSize=25e3;ni._InfixToPostfixCache=new Map;ni._OperatorPriority={")":0,"(":1,"||":2,"&&":3};ni._Stack=["","","","","","","","","","","","","","","","","","","",""];class eh extends ni{constructor(e,t=!1){super(),this.define=e,this.not=t}isTrue(e){let t=e[this.define]!==void 0;return this.not&&(t=!t),t}}class VC extends ni{isTrue(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)}}class GC extends ni{isTrue(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)}}class HC extends ni{constructor(e,t,i){super(),this.define=e,this.operand=t,this.testValue=i}toString(){return`${this.define} ${this.operand} ${this.testValue}`}isTrue(e){let t=!1;const i=parseInt(e[this.define]!=null?e[this.define]:this.define),s=parseInt(e[this.testValue]!=null?e[this.testValue]:this.testValue);if(isNaN(i)||isNaN(s))return!1;switch(this.operand){case">":t=i>s;break;case"<":t=i<s;break;case"<=":t=i<=s;break;case">=":t=i>=s;break;case"==":t=i===s;break;case"!=":t=i!==s;break}return t}}const WC=/defined\s*?\((.+?)\)/g,Jf=/defined\s*?\[(.+?)\]/g,XC=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,qC=/__decl__/,Ly=/light\{X\}.(\w*)/g,Uy=/\{X\}/g,Nc=[],jC=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;function YC(a){a.processor&&a.processor.initializeShaders&&a.processor.initializeShaders(a.processingContext)}function ky(a,e,t,i){e.processor?.preProcessShaderCode&&(a=e.processor.preProcessShaderCode(a,e.isFragment)),Td(a,e,s=>{e.processCodeAfterIncludes&&(s=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",s,e.defines));const r=eD(s,e,i);t(r,s)})}function KC(a,e,t){return!t.processor||!t.processor.finalizeShaders?{vertexCode:a,fragmentCode:e}:t.processor.finalizeShaders(a,e,t.processingContext)}function ZC(a,e){if(e.processor?.noPrecision)return a;const t=e.shouldUseHighPrecisionShader;return a.indexOf("precision highp float")===-1?t?a=`precision highp float;
132`+a:a=`precision mediump float;
133`+a:t||(a=a.replace("precision highp float","precision mediump float")),a}function ed(a){const t=/defined\((.+)\)/.exec(a);if(t&&t.length)return new eh(t[1].trim(),a[0]==="!");const i=["==","!=",">=","<=","<",">"];let s="",r=0;for(s of i)if(r=a.indexOf(s),r>-1)break;if(r===-1)return new eh(a);const o=a.substring(0,r).trim(),c=a.substring(r+s.length).trim();return new HC(o,s,c)}function QC(a){a=a.replace(WC,"defined[$1]");const e=ni.infixToPostfix(a),t=[];for(const s of e)if(s!=="||"&&s!=="&&")t.push(s);else if(t.length>=2){let r=t[t.length-1],o=t[t.length-2];t.length-=2;const c=s=="&&"?new GC:new VC;typeof r=="string"&&(r=r.replace(Jf,"defined($1)")),typeof o=="string"&&(o=o.replace(Jf,"defined($1)")),c.leftOperand=typeof o=="string"?ed(o):o,c.rightOperand=typeof r=="string"?ed(r):r,t.push(c)}let i=t[t.length-1];return typeof i=="string"&&(i=i.replace(Jf,"defined($1)")),typeof i=="string"?ed(i):i}function jc(a,e){const t=new zC,i=a.substring(0,e);let s=a.substring(e);return s=s.substring(0,(s.indexOf("//")+1||s.length+1)-1).trim(),i==="#ifdef"?t.testExpression=new eh(s):i==="#ifndef"?t.testExpression=new eh(s,!0):t.testExpression=QC(s),t}function td(a,e,t,i){let s;for(;vd(a,t);){s=a.currentLine;const r=s.substring(0,5).toLowerCase();if(r==="#else"){const o=new bl;e.children.push(o),vd(a,o);return}else if(r==="#elif"){const o=jc(s,5);e.children.push(o),t=o}}}function vd(a,e,t){for(;a.canRead;){a.lineIndex++;const i=a.currentLine;if(i.indexOf("#")>=0){const r=jC.exec(i);if(r&&r.length){switch(r[0]){case"#ifdef":{const c=new $f;e.children.push(c);const h=jc(i,6);c.children.push(h),td(a,c,h);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const c=new $f;e.children.push(c);const h=jc(i,7);c.children.push(h),td(a,c,h);break}case"#if":{const c=new $f,h=jc(i,3);e.children.push(c),c.children.push(h),td(a,c,h);break}}continue}}const s=new bl;if(s.line=i,e.children.push(s),i[0]==="#"&&i[1]==="d"){const r=i.replace(";","").split(" ");s.additionalDefineKey=r[1],r.length===3&&(s.additionalDefineValue=r[2])}}return!1}function $C(a,e,t,i){const s=new bl,r=new NC;return r.lineIndex=-1,r.lines=a.split(`
134`),vd(r,s),s.process(e,t,i)}function JC(a,e){const t=a.defines,i={};for(const s of t){const o=s.replace("#define","").replace(";","").trim().split(" ");i[o[0]]=o.length>1?o[1]:""}return a.processor?.shaderLanguage===0&&(i.GL_ES="true"),i.__VERSION__=a.version,i[a.platformName]="true",zv(i,e?.isNDCHalfZRange,e?.useReverseDepthBuffer,e?.useExactSrgbConversions),i}function eD(a,e,t){let i=ZC(a,e);if(!e.processor||e.processor.shaderLanguage===0&&i.indexOf("#version 3")!==-1&&(i=i.replace("#version 300 es",""),!e.processor.parseGLES3))return i;const s=e.defines,r=JC(e,t);e.processor.preProcessor&&(i=e.processor.preProcessor(i,s,r,e.isFragment,e.processingContext));const o={};return i=$C(i,r,e,o),e.processor.postProcessor&&(i=e.processor.postProcessor(i,s,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{},r,o)),t?._features.needShaderCodeInlining&&(i=t.inlineShaderCode(i)),i}function Td(a,e,t){Nc.length=0;let i;for(;(i=XC.exec(a))!==null;)Nc.push(i);let s=[a],r=!1;for(const c of Nc){let h=c[1];if(h.indexOf("__decl__")!==-1&&(h=h.replace(qC,""),e.supportsUniformBuffers&&(h=h.replace("Vertex","Ubo").replace("Fragment","Ubo")),h=h+"Declaration"),e.includesShadersStore[h]){let f=e.includesShadersStore[h];if(c[2]){const d=c[3].split(",");for(let g=0;g<d.length;g+=2){const p=new RegExp(d[g],"g"),x=d[g+1];f=f.replace(p,x)}}if(c[4]){const d=c[5];if(d.indexOf("..")!==-1){const g=d.split(".."),p=parseInt(g[0]);let x=parseInt(g[1]),b=f.slice(0);f="",isNaN(x)&&(x=e.indexParameters[g[1]]);for(let T=p;T<x;T++)e.supportsUniformBuffers||(b=b.replace(Ly,(R,S)=>S+"{X}")),f+=b.replace(Uy,T.toString())+`
135`}else e.supportsUniformBuffers||(f=f.replace(Ly,(g,p)=>p+"{X}")),f=f.replace(Uy,d)}const _=[];for(const d of s){const g=d.split(c[0]);for(let p=0;p<g.length-1;p++)_.push(g[p]),_.push(f);_.push(g[g.length-1])}s=_,r=r||f.indexOf("#include<")>=0||f.indexOf("#include <")>=0}else{const f=e.shadersRepository+"ShadersInclude/"+h+".fx";Hv.loadFile(f,_=>{e.includesShadersStore[h]=_,Td(s.join(""),e,t)});return}}Nc.length=0;const o=s.join("");r?Td(o.toString(),e,t):t(o)}const Hv={loadFile:(a,e,t,i,s,r)=>{throw je("FileTools")}};function tD(a,e){return fs(e).cachedPipelines[a]}function Wv(a){const e=a._name,t=a.context;if(e&&t){const i=fs(t);i.cachedPipelines[e]?.dispose(),delete i.cachedPipelines[e]}}function iD(a,e,t,i,s,r,o){let c,h;const f=Bi()?r?.getHostDocument():null;typeof e=="string"?c=e:typeof e.vertexSource=="string"?c="source:"+e.vertexSource:typeof e.vertexElement=="string"?c=f?.getElementById(e.vertexElement)||e.vertexElement:c=e.vertex||e,typeof e=="string"?h=e:typeof e.fragmentSource=="string"?h="source:"+e.fragmentSource:typeof e.fragmentElement=="string"?h=f?.getElementById(e.fragmentElement)||e.fragmentElement:h=e.fragment||e;const _=[void 0,void 0],d=()=>{if(_[0]&&_[1]){const[g,p]=_;YC(a),ky(g,a,(x,b)=>{o&&(o._vertexSourceCodeBeforeMigration=b),t&&(x=t("vertex",x)),a.isFragment=!0,ky(p,a,(T,R)=>{o&&(o._fragmentSourceCodeBeforeMigration=R),t&&(T=t("fragment",T));const S=KC(x,T,a);a=null;const M=sD(S.vertexCode,S.fragmentCode,e,s);i?.(M.vertexSourceCode,M.fragmentSourceCode)},r)},r)}};Ny(c,"Vertex","",g=>{o&&(o._rawVertexSourceCode=g),_[0]=g,d()},s),Ny(h,"Fragment","Pixel",g=>{o&&(o._rawFragmentSourceCode=g),_[1]=g,d()},s)}function Ny(a,e,t,i,s,r){if(typeof HTMLElement<"u"&&a instanceof HTMLElement){const h=Uv(a);i(h);return}if(a.substring(0,7)==="source:"){i(a.substring(7));return}if(a.substring(0,7)==="base64:"){const h=window.atob(a.substring(7));i(h);return}const o=yi.GetShadersStore(s);if(o[a+e+"Shader"]){i(o[a+e+"Shader"]);return}if(t&&o[a+t+"Shader"]){i(o[a+t+"Shader"]);return}let c;if(a[0]==="."||a[0]==="/"||a.indexOf("http")>-1?c=a:c=yi.GetShadersRepository(s)+a,r=r||Nv,!r)throw new Error("loadFileInjection is not defined");r(c+"."+e.toLowerCase()+".fx",i)}function sD(a,e,t,i){if(t){const s=t.vertexElement||t.vertex||t.spectorName||t,r=t.fragmentElement||t.fragment||t.spectorName||t;return{vertexSourceCode:(i===1?"//":"")+"#define SHADER_NAME vertex:"+s+`
136`+a,fragmentSourceCode:(i===1?"//":"")+"#define SHADER_NAME fragment:"+r+`
137`+e}}else return{vertexSourceCode:a,fragmentSourceCode:e}}const nD=(a,e,t,i)=>{try{const s=a.context?fs(a.context):null;s&&(s.disableParallelShaderCompile=a.disableParallelCompilation);const r=a.existingPipelineContext||e(a.shaderProcessingContext);return r._name=a.name,a.name&&s&&(s.cachedPipelines[a.name]=r),t(r,a.vertex,a.fragment,!!a.createAsRaw,"","",a.rebuildRebind,a.defines,a.transformFeedbackVaryings,"",()=>{i(r,()=>{a.onRenderingStateCompiled?.(r)})}),r}catch(s){throw me.Error("Error compiling effect"),s}};let zc=[];class Ki{static SetImmediate(e){zc.length===0&&setTimeout(()=>{const t=zc;zc=[];for(const i of t)i()},1),zc.push(e)}}function zy(a,e,t){try{if(a())return e(),!0}catch(i){return t?.(i),!0}return!1}const Zd=(a,e,t,i=16,s=3e4,r=!0,o)=>{if(r&&zy(a,e,t))return null;const c=setInterval(()=>{zy(a,e,t)?clearInterval(c):(s-=i,s<0&&(clearInterval(c),t?.(new Error("Operation timed out after maximum retries. "+(o||"")),!0)))},i);return()=>clearInterval(c)};class pi{static get ShadersRepository(){return yi.ShadersRepository}static set ShadersRepository(e){yi.ShadersRepository=e}get isDisposed(){return this._isDisposed}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Ae),this._onBindObservable}get shaderLanguage(){return this._shaderLanguage}constructor(e,t,i,s=null,r,o=null,c=null,h=null,f=null,_,d="",g=0,p){this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new Ae,this.onErrorObservable=new Ae,this._onBindObservable=null,this._isDisposed=!1,this._refCount=1,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._multiTarget=!1,this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._disableParallelShaderCompilation=!1,this._pipelineContext=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeBeforeMigration="",this._fragmentSourceCodeBeforeMigration="",this._rawVertexSourceCode="",this._rawFragmentSourceCode="",this._processCodeAfterIncludes=void 0,this._processFinalCode=null,this._onReleaseEffectsObserver=null,this.name=e,this._key=d;const x=this._key.replace(/\r/g,"").replace(/\n/g,"|");let b;if(t.attributes){const T=t;if(this._engine=i,this._attributesNames=T.attributes,this._uniformsNames=T.uniformsNames.concat(T.samplers),this._samplerList=T.samplers.slice(),this.defines=T.defines,this.onError=T.onError,this.onCompiled=T.onCompiled,this._fallbacks=T.fallbacks,this._indexParameters=T.indexParameters,this._transformFeedbackVaryings=T.transformFeedbackVaryings||null,this._multiTarget=!!T.multiTarget,this._shaderLanguage=T.shaderLanguage??0,this._disableParallelShaderCompilation=!!T.disableParallelShaderCompilation,T.uniformBuffersNames){this._uniformBuffersNamesList=T.uniformBuffersNames.slice();for(let R=0;R<T.uniformBuffersNames.length;R++)this._uniformBuffersNames[T.uniformBuffersNames[R]]=R}this._processFinalCode=T.processFinalCode??null,this._processCodeAfterIncludes=T.processCodeAfterIncludes??void 0,p=T.extraInitializationsAsync,b=T.existingPipelineContext}else this._engine=r,this.defines=o??"",this._uniformsNames=i.concat(s),this._samplerList=s?s.slice():[],this._attributesNames=t,this._uniformBuffersNamesList=[],this._shaderLanguage=g,this.onError=f,this.onCompiled=h,this._indexParameters=_,this._fallbacks=c;this._engine.shaderPlatformName==="WEBGL2"&&(b=tD(x,this._engine._gl)??b),this._attributeLocationByName={},this.uniqueId=pi._UniqueIdSeed++,b?(this._pipelineContext=b,this._pipelineContext.setEngine(this._engine),this._onRenderingStateCompiled(this._pipelineContext),this._pipelineContext.program&&(this._pipelineContext.program.__SPECTOR_rebuildProgram=this._rebuildProgram.bind(this))):this._processShaderCodeAsync(null,!1,null,p).catch(T=>{const R=T?.message??String(T),S=new Error(`Effect async shader preparation failed for "${String(this.name)}": ${R}`);T&&typeof T.stack=="string"&&(S.stack=`${S.message}
138Caused by: ${T.stack}`),this._processCompilationErrors(S)}),this._onReleaseEffectsObserver=this._engine.onReleaseEffectsObservable.addOnce(()=>{this._onReleaseEffectsObserver=null,!this.isDisposed&&this.dispose(!0)})}async _processShaderCodeAsync(e=null,t=!1,i=null,s){s&&await s(),this._processingContext=i||this._engine._getShaderProcessingContext(this._shaderLanguage,!1);const r={defines:this.defines.split(`
139`),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:e??this._engine._getShaderProcessor(this._shaderLanguage),supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:yi.GetShadersRepository(this._shaderLanguage),includesShadersStore:yi.GetIncludesShadersStore(this._shaderLanguage),version:(this._engine.version*100).toString(),platformName:this._engine.shaderPlatformName,processingContext:this._processingContext,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:this._processCodeAfterIncludes};iD(r,this.name,this._processFinalCode,(o,c)=>{this._vertexSourceCode=o,this._fragmentSourceCode=c,this._prepareEffect(t)},this._shaderLanguage,this._engine,this)}get key(){return this._key}isReady(){try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){return this._engine.isDisposed||this._isReady?!0:this._pipelineContext?this._pipelineContext.isReady:!1}getEngine(){return this._engine}getPipelineContext(){return this._pipelineContext}getAttributesNames(){return this._attributesNames}getAttributeLocation(e){return this._attributes[e]}getAttributeLocationByName(e){return this._attributeLocationByName[e]}getAttributesCount(){return this._attributes.length}getUniformIndex(e){return this._uniformsNames.indexOf(e)}getUniform(e){return this._uniforms[e]}getSamplers(){return this._samplerList}getUniformNames(){return this._uniformsNames}getUniformBuffersNames(){return this._uniformBuffersNamesList}getIndexParameters(){return this._indexParameters}getCompilationError(){return this._compilationError}allFallbacksProcessed(){return this._allFallbacksProcessed}async whenCompiledAsync(){return await new Promise(e=>{this.executeWhenCompiled(e)})}executeWhenCompiled(e){if(this.isReady()){e(this);return}this.onCompileObservable.add(t=>{e(t)}),(!this._pipelineContext||this._pipelineContext.isAsync)&&this._checkIsReady(null)}_checkIsReady(e){Zd(()=>this._isReadyInternal()||this._isDisposed,()=>{},t=>{this._processCompilationErrors(t,e)},16,12e4,!0,` - Effect: ${typeof this.name=="string"?this.name:this.key}`)}get vertexSourceCode(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:this._pipelineContext?._getVertexShaderCode()??this._vertexSourceCode}get fragmentSourceCode(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:this._pipelineContext?._getFragmentShaderCode()??this._fragmentSourceCode}get vertexSourceCodeBeforeMigration(){return this._vertexSourceCodeBeforeMigration}get fragmentSourceCodeBeforeMigration(){return this._fragmentSourceCodeBeforeMigration}get rawVertexSourceCode(){return this._rawVertexSourceCode}get rawFragmentSourceCode(){return this._rawFragmentSourceCode}getPipelineGenerationOptions(){return{platformName:this._engine.shaderPlatformName,shaderLanguage:this._shaderLanguage,shaderNameOrContent:this.name,key:this._key,defines:this.defines.split(`
140`),addGlobalDefines:!1,extendedProcessingOptions:{indexParameters:this._indexParameters,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,supportsUniformBuffers:this._engine.supportsUniformBuffers},extendedCreatePipelineOptions:{transformFeedbackVaryings:this._transformFeedbackVaryings,createAsRaw:!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride)}}}_rebuildProgram(e,t,i,s){this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(r,o)=>{s&&s(o)},this.onCompiled=()=>{const r=this.getEngine().scenes;if(r)for(let o=0;o<r.length;o++)r[o].markAllMaterialsAsDirty(127);this._pipelineContext._handlesSpectorRebuildCallback?.(i)},this._fallbacks=null,this._prepareEffect()}_onRenderingStateCompiled(e){if(this._pipelineContext=e,this._pipelineContext.setEngine(this._engine),this._attributes=[],this._pipelineContext._fillEffectInformation(this,this._uniformBuffersNames,this._uniformsNames,this._uniforms,this._samplerList,this._samplers,this._attributesNames,this._attributes),this._attributesNames)for(let t=0;t<this._attributesNames.length;t++){const i=this._attributesNames[t];this._attributeLocationByName[i]=this._attributes[t]}this._engine.bindSamplers(this),this._compilationError="",this._isReady=!0,this.onCompiled&&this.onCompiled(this),this.onCompileObservable.notifyObservers(this),this.onCompileObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh(),pi.AutomaticallyClearCodeCache&&this.clearCodeCache()}_prepareEffect(e=!1){const t=this._pipelineContext;this._isReady=!1;try{const i=!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride),s=i?null:this.defines,r=i?this._vertexSourceCodeOverride:this._vertexSourceCode,o=i?this._fragmentSourceCodeOverride:this._fragmentSourceCode,c=this._engine;this._pipelineContext=nD({existingPipelineContext:e?t:null,vertex:r,fragment:o,context:c.shaderPlatformName==="WEBGL2"||c.shaderPlatformName==="WEBGL1"?c._gl:void 0,rebuildRebind:(h,f,_,d)=>this._rebuildProgram(h,f,_,d),defines:s,transformFeedbackVaryings:this._transformFeedbackVaryings,name:this._key.replace(/\r/g,"").replace(/\n/g,"|"),createAsRaw:i,disableParallelCompilation:this._disableParallelShaderCompilation,shaderProcessingContext:this._processingContext,onRenderingStateCompiled:h=>{t&&!e&&this._engine._deletePipelineContext(t),h&&this._onRenderingStateCompiled(h)}},this._engine.createPipelineContext.bind(this._engine),this._engine._preparePipelineContextAsync.bind(this._engine),this._engine._executeWhenRenderingStateIsCompiled.bind(this._engine)),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(i){this._processCompilationErrors(i,t)}}_getShaderCodeAndErrorLine(e,t,i){const s=i?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/;let r=null;if(t&&e){const o=t.match(s);if(o&&o.length===2){const c=parseInt(o[1]),h=e.split(`
141`,-1);h.length>=c&&(r=`Offending line [${c}] in ${i?"fragment":"vertex"} code: ${h[c-1]}`)}}return[e,r]}_processCompilationErrors(e,t=null){this._compilationError=typeof e?.stack=="string"?e.stack:e?.message??String(e);const i=this._attributesNames,s=this._fallbacks;if(me.Error("Unable to compile effect:"),me.Error(`Uniforms: ${this._uniformsNames.join(" ")}`),me.Error(`Attributes: ${i.join(" ")}`),me.Error(`Defines:
142`+this.defines),pi.LogShaderCodeOnCompilationError){let o=null,c=null,h;this._pipelineContext?._getVertexShaderCode()&&([h,o]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),h&&(me.Error("Vertex code:"),me.Error(h))),this._pipelineContext?._getFragmentShaderCode()&&([h,c]=this._getShaderCodeAndErrorLine(this._pipelineContext?._getFragmentShaderCode(),this._compilationError,!0),h&&(me.Error("Fragment code:"),me.Error(h))),o&&me.Error(o),c&&me.Error(c)}me.Error("Error: "+this._compilationError);const r=()=>{this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this),this._engine.onEffectErrorObservable.notifyObservers({effect:this,errors:this._compilationError})};t&&(this._pipelineContext=t,this._isReady=!0,r()),s?(this._pipelineContext=null,s.hasMoreFallbacks?(this._allFallbacksProcessed=!1,me.Error("Trying next fallback."),this.defines=s.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,r(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||r())}get isSupported(){return this._compilationError===""}_bindTexture(e,t){this._engine._bindTexture(this._samplers[e],t,e)}setTexture(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t,e)}setTextureArray(e,t){const i=e+"Ex";if(this._samplerList.indexOf(i+"0")===-1){const s=this._samplerList.indexOf(e);for(let o=1;o<t.length;o++){const c=i+(o-1).toString();this._samplerList.splice(s+o,0,c)}let r=0;for(const o of this._samplerList)this._samplers[o]=r,r+=1}this._engine.setTextureArray(this._samplers[e],this._uniforms[e],t,e)}bindUniformBuffer(e,t){const i=this._uniformBuffersNames[t];i===void 0||pi._BaseCache[i]===e&&this._engine._features.useUBOBindingCache||(pi._BaseCache[i]=e,this._engine.bindUniformBufferBase(e,i,t))}bindUniformBlock(e,t){this._engine.bindUniformBlock(this._pipelineContext,e,t)}setInt(e,t){return this._pipelineContext.setInt(e,t),this}setInt2(e,t,i){return this._pipelineContext.setInt2(e,t,i),this}setInt3(e,t,i,s){return this._pipelineContext.setInt3(e,t,i,s),this}setInt4(e,t,i,s,r){return this._pipelineContext.setInt4(e,t,i,s,r),this}setIntArray(e,t){return this._pipelineContext.setIntArray(e,t),this}setIntArray2(e,t){return this._pipelineContext.setIntArray2(e,t),this}setIntArray3(e,t){return this._pipelineContext.setIntArray3(e,t),this}setIntArray4(e,t){return this._pipelineContext.setIntArray4(e,t),this}setUInt(e,t){return this._pipelineContext.setUInt(e,t),this}setUInt2(e,t,i){return this._pipelineContext.setUInt2(e,t,i),this}setUInt3(e,t,i,s){return this._pipelineContext.setUInt3(e,t,i,s),this}setUInt4(e,t,i,s,r){return this._pipelineContext.setUInt4(e,t,i,s,r),this}setUIntArray(e,t){return this._pipelineContext.setUIntArray(e,t),this}setUIntArray2(e,t){return this._pipelineContext.setUIntArray2(e,t),this}setUIntArray3(e,t){return this._pipelineContext.setUIntArray3(e,t),this}setUIntArray4(e,t){return this._pipelineContext.setUIntArray4(e,t),this}setFloatArray(e,t){return this._pipelineContext.setArray(e,t),this}setFloatArray2(e,t){return this._pipelineContext.setArray2(e,t),this}setFloatArray3(e,t){return this._pipelineContext.setArray3(e,t),this}setFloatArray4(e,t){return this._pipelineContext.setArray4(e,t),this}setArray(e,t){return this._pipelineContext.setArray(e,t),this}setArray2(e,t){return this._pipelineContext.setArray2(e,t),this}setArray3(e,t){return this._pipelineContext.setArray3(e,t),this}setArray4(e,t){return this._pipelineContext.setArray4(e,t),this}setMatrices(e,t){return this._pipelineContext.setMatrices(e,t),this}setMatrix(e,t){return this._pipelineContext.setMatrix(e,t),this}setMatrix3x3(e,t){return this._pipelineContext.setMatrix3x3(e,t),this}setMatrix2x2(e,t){return this._pipelineContext.setMatrix2x2(e,t),this}setFloat(e,t){return this._pipelineContext.setFloat(e,t),this}setBool(e,t){return this._pipelineContext.setInt(e,t?1:0),this}setVector2(e,t){return this._pipelineContext.setVector2(e,t),this}setFloat2(e,t,i){return this._pipelineContext.setFloat2(e,t,i),this}setVector3(e,t){return this._pipelineContext.setVector3(e,t),this}setFloat3(e,t,i,s){return this._pipelineContext.setFloat3(e,t,i,s),this}setVector4(e,t){return this._pipelineContext.setVector4(e,t),this}setQuaternion(e,t){return this._pipelineContext.setQuaternion(e,t),this}setFloat4(e,t,i,s,r){return this._pipelineContext.setFloat4(e,t,i,s,r),this}setColor3(e,t){return this._pipelineContext.setColor3(e,t),this}setColor4(e,t,i){return this._pipelineContext.setColor4(e,t,i),this}setDirectColor4(e,t){return this._pipelineContext.setDirectColor4(e,t),this}clearCodeCache(){this._vertexSourceCode="",this._fragmentSourceCode="",this._fragmentSourceCodeBeforeMigration="",this._vertexSourceCodeBeforeMigration=""}dispose(e=!1){if(e)this._refCount=0;else{if(pi.PersistentMode)return;this._refCount--}this._refCount>0||this._isDisposed||(this._onReleaseEffectsObserver&&(this._engine.onReleaseEffectsObservable.remove(this._onReleaseEffectsObserver),this._onReleaseEffectsObserver=null),this._pipelineContext&&Wv(this._pipelineContext),this._engine._releaseEffect(this),this.clearCodeCache(),this._isDisposed=!0)}static RegisterShader(e,t,i,s=0){t&&(yi.GetShadersStore(s)[`${e}PixelShader`]=t),i&&(yi.GetShadersStore(s)[`${e}VertexShader`]=i)}static ResetCache(){pi._BaseCache={}}}pi.LogShaderCodeOnCompilationError=!0;pi.PersistentMode=!1;pi.AutomaticallyClearCodeCache=!1;pi._UniqueIdSeed=0;pi._BaseCache={};pi.ShadersStore=yi.ShadersStore;pi.IncludesShadersStore=yi.IncludesShadersStore;class Si{static SetMatrixPrecision(e){if(Si.MatrixTrackPrecisionChange=!1,e&&!Si.MatrixUse64Bits&&Si.MatrixTrackedMatrices)for(let t=0;t<Si.MatrixTrackedMatrices.length;++t){const i=Si.MatrixTrackedMatrices[t],s=i._m;i._m=new Array(16);for(let r=0;r<16;++r)i._m[r]=s[r]}Si.MatrixUse64Bits=e,Si.MatrixCurrentType=Si.MatrixUse64Bits?Array:Float32Array,Si.MatrixTrackedMatrices=null}}Si.MatrixUse64Bits=!1;Si.MatrixTrackPrecisionChange=!0;Si.MatrixCurrentType=Float32Array;Si.MatrixTrackedMatrices=[];class Vn{static get Now(){return Bi()&&window.performance&&window.performance.now?window.performance.now():Date.now()}}class rD{constructor(e=!0){this._isDepthTestDirty=!1,this._isDepthMaskDirty=!1,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1,e&&this.reset()}get isDirty(){return this._isDepthFuncDirty||this._isDepthTestDirty||this._isDepthMaskDirty||this._isCullFaceDirty||this._isCullDirty||this._isZOffsetDirty||this._isFrontFaceDirty}get zOffset(){return this._zOffset}set zOffset(e){this._zOffset!==e&&(this._zOffset=e,this._isZOffsetDirty=!0)}get zOffsetUnits(){return this._zOffsetUnits}set zOffsetUnits(e){this._zOffsetUnits!==e&&(this._zOffsetUnits=e,this._isZOffsetDirty=!0)}get cullFace(){return this._cullFace}set cullFace(e){this._cullFace!==e&&(this._cullFace=e,this._isCullFaceDirty=!0)}get cull(){return this._cull}set cull(e){this._cull!==e&&(this._cull=e,this._isCullDirty=!0)}get depthFunc(){return this._depthFunc}set depthFunc(e){this._depthFunc!==e&&(this._depthFunc=e,this._isDepthFuncDirty=!0)}get depthMask(){return this._depthMask}set depthMask(e){this._depthMask!==e&&(this._depthMask=e,this._isDepthMaskDirty=!0)}get depthTest(){return this._depthTest}set depthTest(e){this._depthTest!==e&&(this._depthTest=e,this._isDepthTestDirty=!0)}get frontFace(){return this._frontFace}set frontFace(e){this._frontFace!==e&&(this._frontFace=e,this._isFrontFaceDirty=!0)}reset(){this._depthMask=!0,this._depthTest=!0,this._depthFunc=null,this._cullFace=null,this._cull=null,this._zOffset=0,this._zOffsetUnits=0,this._frontFace=null,this._isDepthTestDirty=!0,this._isDepthMaskDirty=!0,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!0,this._isFrontFaceDirty=!1}apply(e){this.isDirty&&(this._isCullDirty&&(this.cull?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this._isCullDirty=!1),this._isCullFaceDirty&&(e.cullFace(this.cullFace),this._isCullFaceDirty=!1),this._isDepthMaskDirty&&(e.depthMask(this.depthMask),this._isDepthMaskDirty=!1),this._isDepthTestDirty&&(this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this._isDepthTestDirty=!1),this._isDepthFuncDirty&&(e.depthFunc(this.depthFunc),this._isDepthFuncDirty=!1),this._isZOffsetDirty&&(this.zOffset||this.zOffsetUnits?(e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(this.zOffset,this.zOffsetUnits)):e.disable(e.POLYGON_OFFSET_FILL),this._isZOffsetDirty=!1),this._isFrontFaceDirty&&(e.frontFace(this.frontFace),this._isFrontFaceDirty=!1))}}class aD{get isDirty(){return this._isStencilTestDirty||this._isStencilMaskDirty||this._isStencilFuncDirty||this._isStencilOpDirty}get func(){return this._func}set func(e){this._func!==e&&(this._func=e,this._isStencilFuncDirty=!0)}get backFunc(){return this._func}set backFunc(e){this._backFunc!==e&&(this._backFunc=e,this._isStencilFuncDirty=!0)}get funcRef(){return this._funcRef}set funcRef(e){this._funcRef!==e&&(this._funcRef=e,this._isStencilFuncDirty=!0)}get funcMask(){return this._funcMask}set funcMask(e){this._funcMask!==e&&(this._funcMask=e,this._isStencilFuncDirty=!0)}get opStencilFail(){return this._opStencilFail}set opStencilFail(e){this._opStencilFail!==e&&(this._opStencilFail=e,this._isStencilOpDirty=!0)}get opDepthFail(){return this._opDepthFail}set opDepthFail(e){this._opDepthFail!==e&&(this._opDepthFail=e,this._isStencilOpDirty=!0)}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(e){this._opStencilDepthPass!==e&&(this._opStencilDepthPass=e,this._isStencilOpDirty=!0)}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(e){this._backOpStencilFail!==e&&(this._backOpStencilFail=e,this._isStencilOpDirty=!0)}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(e){this._backOpDepthFail!==e&&(this._backOpDepthFail=e,this._isStencilOpDirty=!0)}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(e){this._backOpStencilDepthPass!==e&&(this._backOpStencilDepthPass=e,this._isStencilOpDirty=!0)}get mask(){return this._mask}set mask(e){this._mask!==e&&(this._mask=e,this._isStencilMaskDirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._isStencilTestDirty=!0)}constructor(e=!0){this._isStencilTestDirty=!1,this._isStencilMaskDirty=!1,this._isStencilFuncDirty=!1,this._isStencilOpDirty=!1,this.useStencilGlobalOnly=!1,e&&this.reset()}reset(){this.stencilMaterial=void 0,this.stencilGlobal?.reset(),this._isStencilTestDirty=!0,this._isStencilMaskDirty=!0,this._isStencilFuncDirty=!0,this._isStencilOpDirty=!0}apply(e){if(!e)return;const t=!this.useStencilGlobalOnly&&!!this.stencilMaterial?.enabled;this.enabled=t?this.stencilMaterial.enabled:this.stencilGlobal.enabled,this.func=t?this.stencilMaterial.func:this.stencilGlobal.func,this.backFunc=t?this.stencilMaterial.backFunc:this.stencilGlobal.backFunc,this.funcRef=t?this.stencilMaterial.funcRef:this.stencilGlobal.funcRef,this.funcMask=t?this.stencilMaterial.funcMask:this.stencilGlobal.funcMask,this.opStencilFail=t?this.stencilMaterial.opStencilFail:this.stencilGlobal.opStencilFail,this.opDepthFail=t?this.stencilMaterial.opDepthFail:this.stencilGlobal.opDepthFail,this.opStencilDepthPass=t?this.stencilMaterial.opStencilDepthPass:this.stencilGlobal.opStencilDepthPass,this.backOpStencilFail=t?this.stencilMaterial.backOpStencilFail:this.stencilGlobal.backOpStencilFail,this.backOpDepthFail=t?this.stencilMaterial.backOpDepthFail:this.stencilGlobal.backOpDepthFail,this.backOpStencilDepthPass=t?this.stencilMaterial.backOpStencilDepthPass:this.stencilGlobal.backOpStencilDepthPass,this.mask=t?this.stencilMaterial.mask:this.stencilGlobal.mask,this.isDirty&&(this._isStencilTestDirty&&(this.enabled?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this._isStencilTestDirty=!1),this._isStencilMaskDirty&&(e.stencilMask(this.mask),this._isStencilMaskDirty=!1),this._isStencilFuncDirty&&(e.stencilFuncSeparate(e.FRONT,this.func,this.funcRef,this.funcMask),e.stencilFuncSeparate(e.BACK,this.backFunc,this.funcRef,this.funcMask),this._isStencilFuncDirty=!1),this._isStencilOpDirty&&(e.stencilOpSeparate(e.FRONT,this.opStencilFail,this.opDepthFail,this.opStencilDepthPass),e.stencilOpSeparate(e.BACK,this.backOpStencilFail,this.backOpDepthFail,this.backOpStencilDepthPass),this._isStencilOpDirty=!1))}}class Ts{constructor(){this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=Ts.ALWAYS,this.opStencilFail=Ts.KEEP,this.opDepthFail=Ts.KEEP,this.opStencilDepthPass=Ts.REPLACE,this.backFunc=Ts.ALWAYS,this.backOpStencilFail=Ts.KEEP,this.backOpDepthFail=Ts.KEEP,this.backOpStencilDepthPass=Ts.REPLACE}get stencilFunc(){return this.func}set stencilFunc(e){this.func=e}get stencilBackFunc(){return this.backFunc}set stencilBackFunc(e){this.backFunc=e}get stencilFuncRef(){return this.funcRef}set stencilFuncRef(e){this.funcRef=e}get stencilFuncMask(){return this.funcMask}set stencilFuncMask(e){this.funcMask=e}get stencilOpStencilFail(){return this.opStencilFail}set stencilOpStencilFail(e){this.opStencilFail=e}get stencilOpDepthFail(){return this.opDepthFail}set stencilOpDepthFail(e){this.opDepthFail=e}get stencilOpStencilDepthPass(){return this.opStencilDepthPass}set stencilOpStencilDepthPass(e){this.opStencilDepthPass=e}get stencilBackOpStencilFail(){return this.backOpStencilFail}set stencilBackOpStencilFail(e){this.backOpStencilFail=e}get stencilBackOpDepthFail(){return this.backOpDepthFail}set stencilBackOpDepthFail(e){this.backOpDepthFail=e}get stencilBackOpStencilDepthPass(){return this.backOpStencilDepthPass}set stencilBackOpStencilDepthPass(e){this.backOpStencilDepthPass=e}get stencilMask(){return this.mask}set stencilMask(e){this.mask=e}get stencilTest(){return this.enabled}set stencilTest(e){this.enabled=e}}Ts.ALWAYS=519;Ts.KEEP=7680;Ts.REPLACE=7681;class Xv{constructor(e){this._supportBlendParametersPerTarget=e,this._blendFunctionParameters=new Array(32),this._blendEquationParameters=new Array(16),this._blendConstants=new Array(4),this._isBlendConstantsDirt
142y=!1,this._alphaBlend=Array(8).fill(!1),this._numTargetEnabled=0,this._isAlphaBlendDirty=!1,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this.reset()}get isDirty(){return this._isAlphaBlendDirty||this._isBlendFunctionParametersDirty||this._isBlendEquationParametersDirty}get alphaBlend(){return this._numTargetEnabled>0}set alphaBlend(e){this.setAlphaBlend(e)}setAlphaBlend(e,t=0){this._alphaBlend[t]!==e&&(e?this._numTargetEnabled++:this._numTargetEnabled--,this._alphaBlend[t]=e,this._isAlphaBlendDirty=!0)}setAlphaBlendConstants(e,t,i,s){this._blendConstants[0]===e&&this._blendConstants[1]===t&&this._blendConstants[2]===i&&this._blendConstants[3]===s||(this._blendConstants[0]=e,this._blendConstants[1]=t,this._blendConstants[2]=i,this._blendConstants[3]=s,this._isBlendConstantsDirty=!0)}setAlphaBlendFunctionParameters(e,t,i,s,r=0){const o=r*4;this._blendFunctionParameters[o+0]===e&&this._blendFunctionParameters[o+1]===t&&this._blendFunctionParameters[o+2]===i&&this._blendFunctionParameters[o+3]===s||(this._blendFunctionParameters[o+0]=e,this._blendFunctionParameters[o+1]=t,this._blendFunctionParameters[o+2]=i,this._blendFunctionParameters[o+3]=s,this._isBlendFunctionParametersDirty=!0)}setAlphaEquationParameters(e,t,i=0){const s=i*2;this._blendEquationParameters[s+0]===e&&this._blendEquationParameters[s+1]===t||(this._blendEquationParameters[s+0]=e,this._blendEquationParameters[s+1]=t,this._isBlendEquationParametersDirty=!0)}reset(){this._alphaBlend.fill(!1),this._numTargetEnabled=0,this._blendFunctionParameters.fill(null),this._blendEquationParameters.fill(null),this._blendConstants[0]=null,this._blendConstants[1]=null,this._blendConstants[2]=null,this._blendConstants[3]=null,this._isAlphaBlendDirty=!0,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1}apply(e,t=1){if(!this.isDirty)return;if(this._isBlendConstantsDirty&&(e.blendColor(this._blendConstants[0],this._blendConstants[1],this._blendConstants[2],this._blendConstants[3]),this._isBlendConstantsDirty=!1),t===1||!this._supportBlendParametersPerTarget){this._isAlphaBlendDirty&&(this._alphaBlend[0]?e.enable(e.BLEND):e.disable(e.BLEND),this._isAlphaBlendDirty=!1),this._isBlendFunctionParametersDirty&&(e.blendFuncSeparate(this._blendFunctionParameters[0],this._blendFunctionParameters[1],this._blendFunctionParameters[2],this._blendFunctionParameters[3]),this._isBlendFunctionParametersDirty=!1),this._isBlendEquationParametersDirty&&(e.blendEquationSeparate(this._blendEquationParameters[0],this._blendEquationParameters[1]),this._isBlendEquationParametersDirty=!1);return}const i=e;if(this._isAlphaBlendDirty){for(let s=0;s<t;s++){const r=s<this._numTargetEnabled?s:0;this._alphaBlend[r]?i.enableIndexed(e.BLEND,s):i.disableIndexed(e.BLEND,s)}this._isAlphaBlendDirty=!1}if(this._isBlendFunctionParametersDirty){for(let s=0;s<t;s++){const r=s<this._numTargetEnabled?s*4:0;i.blendFuncSeparateIndexed(s,this._blendFunctionParameters[r+0],this._blendFunctionParameters[r+1],this._blendFunctionParameters[r+2],this._blendFunctionParameters[r+3])}this._isBlendFunctionParametersDirty=!1}if(this._isBlendEquationParametersDirty){for(let s=0;s<t;s++){const r=s<this._numTargetEnabled?s*2:0;i.blendEquationSeparateIndexed(s,this._blendEquationParameters[r+0],this._blendEquationParameters[r+1])}this._isBlendEquationParametersDirty=!1}}setAlphaMode(e,t){let i=32774;switch(e){case 0:break;case 7:this.setAlphaBlendFunctionParameters(1,771,1,1,t);break;case 8:this.setAlphaBlendFunctionParameters(1,771,1,771,t);break;case 2:this.setAlphaBlendFunctionParameters(770,771,1,1,t);break;case 6:this.setAlphaBlendFunctionParameters(1,1,0,1,t);break;case 1:this.setAlphaBlendFunctionParameters(770,1,0,1,t);break;case 3:this.setAlphaBlendFunctionParameters(0,769,1,1,t);break;case 4:this.setAlphaBlendFunctionParameters(774,0,1,1,t);break;case 5:this.setAlphaBlendFunctionParameters(770,769,1,1,t);break;case 9:this.setAlphaBlendFunctionParameters(32769,32770,32771,32772,t);break;case 10:this.setAlphaBlendFunctionParameters(1,769,1,771,t);break;case 11:this.setAlphaBlendFunctionParameters(1,1,1,1,t);break;case 12:this.setAlphaBlendFunctionParameters(772,1,0,0,t);break;case 13:this.setAlphaBlendFunctionParameters(775,769,773,771,t);break;case 14:this.setAlphaBlendFunctionParameters(1,771,1,771,t);break;case 15:this.setAlphaBlendFunctionParameters(1,1,1,0,t);break;case 16:this.setAlphaBlendFunctionParameters(775,769,0,1,t);break;case 17:this.setAlphaBlendFunctionParameters(770,771,1,771,t);break;case 18:this.setAlphaBlendFunctionParameters(1,1,1,1,t),i=32775;break;case 19:this.setAlphaBlendFunctionParameters(1,1,1,1,t),i=32776;break;case 20:this.setAlphaBlendFunctionParameters(1,35065,0,1,t);break;case 21:this.setAlphaBlendFunctionParameters(1,0,1,771,t);break}this.setAlphaEquationParameters(i,i,t)}}function qv(a,e){if(e){const{requestAnimationFrame:t}=e;if(typeof t=="function")return t(a)}if(Bi()){const{requestAnimationFrame:t}=e||window;if(typeof t=="function")return t(a)}else if(typeof requestAnimationFrame=="function")return requestAnimationFrame(a);return setTimeout(a,16)}class Ve{get frameId(){return this._frameId}get isWebGPU(){return this._isWebGPU}_getShaderProcessor(e){return this._shaderProcessor}_resetAlphaMode(){this._alphaMode.fill(-1),this._alphaEquation.fill(-1)}get shaderPlatformName(){return this._shaderPlatformName}_clearEmptyResources(){this._emptyTexture=null,this._emptyCubeTexture=null,this._emptyTexture3D=null,this._emptyTexture2DArray=null}get useReverseDepthBuffer(){return this._useReverseDepthBuffer}set useReverseDepthBuffer(e){e!==this._useReverseDepthBuffer&&(this._useReverseDepthBuffer=e,e?this._depthCullingState.depthFunc=518:this._depthCullingState.depthFunc=515)}setColorWrite(e){e!==this._colorWrite&&(this._colorWriteChanged=!0,this._colorWrite=e)}
142getColorWrite(){return this._colorWrite}get depthCullingState(){return this._depthCullingState}get alphaState(){return this._alphaState}get stencilState(){return this._stencilState}get stencilStateComposer(){return this._stencilStateComposer}_getGlobalDefines(e){if(e){this.isNDCHalfZRange?e.IS_NDC_HALF_ZRANGE="":delete e.IS_NDC_HALF_ZRANGE,this.useReverseDepthBuffer?e.USE_REVERSE_DEPTHBUFFER="":delete e.USE_REVERSE_DEPTHBUFFER,this.useExactSrgbConversions?e.USE_EXACT_SRGB_CONVERSIONS="":delete e.USE_EXACT_SRGB_CONVERSIONS;return}else{let t="";return this.isNDCHalfZRange&&(t+="#define IS_NDC_HALF_ZRANGE"),this.useReverseDepthBuffer&&(t&&(t+=`
143`),t+="#define USE_REVERSE_DEPTHBUFFER"),this.useExactSrgbConversions&&(t&&(t+=`
144`),t+="#define USE_EXACT_SRGB_CONVERSIONS"),t}}_rebuildInternalTextures(){const e=this._internalTexturesCache.slice();for(const t of e)t._rebuild()}_rebuildRenderTargetWrappers(){const e=this._renderTargetWrapperCache.slice();for(const t of e)t.textures?.some(i=>i.source===15)||t._rebuild()}_rebuildEffects(){for(const e in this._compiledEffects){const t=this._compiledEffects[e];t._pipelineContext=null,t._prepareEffect()}pi.ResetCache()}_rebuildGraphicsResources(){this.wipeCaches(!0),this._rebuildEffects(),this._rebuildComputeEffects?.(),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0)}_flagContextRestored(){me.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1}_restoreEngineAfterContextLost(e){setTimeout(()=>{this._clearEmptyResources();const t=this._depthCullingState.depthTest,i=this._depthCullingState.depthFunc,s=this._depthCullingState.depthMask,r=this._stencilState.stencilTest;e(),this._rebuildGraphicsResources(),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=i,this._depthCullingState.depthMask=s,this._stencilState.stencilTest=r,this._flagContextRestored()},0)}get isDisposed(){return this._isDisposed}get snapshotRendering(){return!1}set snapshotRendering(e){}get snapshotRenderingMode(){return 0}set snapshotRenderingMode(e){}getClassName(){return"AbstractEngine"}get emptyTexture(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,5,!1,!1,1)),this._emptyTexture}get emptyTexture3D(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture3D}get emptyTexture2DArray(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture2DArray}get emptyCubeTexture(){if(!this._emptyCubeTexture){const e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,5,0,!1,!1,1)}return this._emptyCubeTexture}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}get activeRenderLoops(){return this._activeRenderLoops}stopRenderLoop(e){if(!e){this._activeRenderLoops.length=0,this._cancelFrame();return}const t=this._activeRenderLoops.indexOf(e);t>=0&&(this._activeRenderLoops.splice(t,1),this._activeRenderLoops.length==0&&this._cancelFrame())}_cancelFrame(){if(this.customAnimationFrameRequester){if(this._frameHandler!==0){this._frameHandler=0;const{cancelAnimationFrame:e}=this.customAnimationFrameRequester;e&&e(this.customAnimationFrameRequester.requestID),delete this.customAnimationFrameRequester.requestID}return}if(this._frameHandler!==0){const e=this._frameHandler;if(this._frameHandler=0,Bi()){const{cancelAnimationFrame:t}=this.getHostWindow()||window;if(typeof t=="function")return t(e)}else if(typeof cancelAnimationFrame=="function")return cancelAnimationFrame(e);return clearTimeout(e)}}beginFrame(){this.onBeginFrameObservable.notifyObservers(this)}endFrame(){this._frameId++,this.onEndFrameObservable.notifyObservers(this)}get maxFPS(){return this._maxFPS}set maxFPS(e){if(this._maxFPS=e,e!==void 0){if(e<=0){this._minFrameTime=Number.MAX_VALUE;return}this._minFrameTime=1e3/e}}_isOverFrameTime(e){if(!e||this._maxFPS===void 0)return!1;const t=e-this._lastFrameTime;return this._lastFrameTime=e,this._renderAccumulator+=t,this._renderAccumulator<this._minFrameTime?!0:(this._renderAccumulator-=this._minFrameTime,this._renderAccumulator>this._minFrameTime&&(this._renderAccumulator=this._minFrameTime),!1)}
vendor: 11,952 bytes, line 144
144_processFrame(e){if(this._frameHandler=0,!this._contextWasLost&&!this._isOverFrameTime(e)){let t=!0;(this.isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(t=!1),t&&(this.beginFrame(),!this.skipFrameRender&&!this._renderViews()&&this._renderFrame(),this.endFrame())}}_renderLoop(e){this._processFrame(e),this._activeRenderLoops.length>0&&this._frameHandler===0&&this._queueNewFrameForRenderLoop()}_renderFrame(){for(let e=0;e<this._activeRenderLoops.length;e++){const t=this._activeRenderLoops[e];t()}}_renderViews(){return!1}_queueNewFrame(e,t){return qv(e,t)}_queueNewFrameForRenderLoop(){this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())}runRenderLoop(e){this._activeRenderLoops.indexOf(e)===-1&&(this._activeRenderLoops.push(e),this._activeRenderLoops.length===1&&this._frameHandler===0&&this._queueNewFrameForRenderLoop())}getDepthBuffer(){return this._depthCullingState.depthTest}setDepthBuffer(e){this._depthCullingState.depthTest=e}setZOffset(e){this._depthCullingState.zOffset=this.useReverseDepthBuffer?-e:e}getZOffset(){const e=this._depthCullingState.zOffset;return this.useReverseDepthBuffer?-e:e}setZOffsetUnits(e){this._depthCullingState.zOffsetUnits=this.useReverseDepthBuffer?-e:e}getZOffsetUnits(){const e=this._depthCullingState.zOffsetUnits;return this.useReverseDepthBuffer?-e:e}getHostWindow(){return Bi()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null}get compatibilityMode(){return this._compatibilityMode}set compatibilityMode(e){this._compatibilityMode=!0}_rebuildTextures(){for(const e of this.scenes)e._rebuildTextures();for(const e of this._virtualScenes)e._rebuildTextures()}_releaseRenderTargetWrapper(e){const t=this._renderTargetWrapperCache.indexOf(e);t!==-1&&this._renderTargetWrapperCache.splice(t,1)}get currentViewport(){return this._cachedViewport}setViewport(e,t,i){const s=t||this.getRenderWidth(),r=i||this.getRenderHeight(),o=e.x||0,c=e.y||0;this._cachedViewport=e,this._viewport(o*s,c*r,s*e.width,r*e.height)}createCanvasImage(){return document.createElement("img")}createCanvasPath2D(e){return new Path2D(e)}get description(){let e=this.name+this.version;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e}_createTextureBase(e,t,i,s,r=3,o=null,c=null,h,f,_=null,d=null,g=null,p=null,x,b,T){e=e||"";const R=e.substring(0,5)==="data:",S=e.substring(0,5)==="blob:",M=R&&e.indexOf(";base64,")!==-1,I=d||new is(this,1);I!==d&&(I.label=e.substring(0,60));const A=e;this._transformTextureUrl&&!M&&!d&&!_&&(e=this._transformTextureUrl(e)),A!==e&&(I._originalUrl=A);const D=e.lastIndexOf(".");let C=p||(D>-1?e.substring(D).toLowerCase():"");C.indexOf("?")>-1&&(C=C.split("?")[0]);const H=Ve.GetCompatibleTextureLoader(C,x);s&&s.addPendingData(I),I.url=e,I.generateMipMaps=!t,I.samplingMode=r,I.invertY=i,I._useSRGBBuffer=this._getUseSRGBBuffer(!!T,t),this._doNotHandleContextLost||(I._buffer=_);let L=null;o&&!d&&(L=I.onLoadedObservable.add(o)),d||this._internalTexturesCache.push(I);const J=(te,ae)=>{s&&s.removePendingData(I),e===A?(L&&I.onLoadedObservable.remove(L),ft.UseFallbackTexture&&e!==ft.FallbackTexture&&this._createTextureBase(ft.FallbackTexture,t,I.invertY,s,r,null,c,h,f,_,I),te=(te||"Unknown error")+(ft.UseFallbackTexture?" - Fallback texture was used":""),I.onErrorObservable.notifyObservers({message:te,exception:ae}),c&&c(te,ae)):(me.Warn(`Failed to load ${e}, falling back to ${A}`),this._createTextureBase(A,t,I.invertY,s,r,o,c,h,f,_,I,g,p,x,b,T))};if(H){const te=async ae=>{(await H).loadData(ae,I,($,z,X,q,G,j)=>{j?J("TextureLoader failed to load data"):h(I,C,s,{width:$,height:z},I.invertY,!X,q,()=>(G(),!1),r)},b)};if(!_)this._loadFile(e,async ae=>{try{await te(new Uint8Array(ae))}catch(B){J("Failed to parse texture data",B)}},void 0,s?s.offlineProvider:void 0,!0,(ae,B)=>{J("Unable to load "+(ae&&ae.responseURL,B))});else{const ae=async B=>{try{await te(B)}catch($){J("Failed to parse texture data",$)}};_ instanceof ArrayBuffer?ae(new Uint8Array(_)):ArrayBuffer.isView(_)?ae(_):c&&c("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null)}}else{const te=ae=>{S&&!this._doNotHandleContextLost&&(I._buffer=ae),h(I,C,s,ae,I.invertY,t,!1,f,r)};!R||M?_&&(typeof _.decoding=="string"||_.close)?te(_):Ve._FileToolsLoadImage(e||"",te,J,s?s.offlineProvider:null,x,I.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):typeof _=="string"||_ instanceof ArrayBuffer||ArrayBuffer.isView(_)||_ instanceof Blob?Ve._FileToolsLoadImage(_,te,J,s?s.offlineProvider:null,x,I.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):_&&te(_)}return I}_rebuildBuffers(){for(const e of this._uniformBuffers)e._rebuildAfterContextLost()}get _shouldUseHighPrecisionShader(){return!!(this._caps.highPrecisionShaderSupported&&this._highPrecisionShadersAllowed)}getHostDocument(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:Qr()?document:null}getLoadedTexturesCache(){return this._internalTexturesCache}clearInternalTexturesCache(){this._internalTexturesCache.length=0}getCaps(){return this._caps}resetTextureCache(){for(const e in this._boundTexturesCache)Object.prototype.hasOwnProperty.call(this._boundTexturesCache,e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1}get name(){return this._name}set name(e){this._name=e}static get NpmPackage(){return"[email protected]"}static get Version(){return"9.21.2"}getRenderingCanvas(){return this._renderingCanvas}getAudioContext(){return this._audioContext}getAudioDestination(){return this._audioDestination}setHardwareScalingLevel(e){this._hardwareScalingLevel=e,this.resize()}getHardwareScalingLevel(){return this._hardwareScalingLevel}get doNotHandleContextLost(){return this._doNotHandleContextLost}set doNotHandleContextLost(e){this._doNotHandleContextLost=e}get isStencilEnable(){return this._isStencilEnable}getCreationOptions(){return this._creationOptions}constructor(e,t,i){this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new rD,this._stencilStateComposer=new aD,this._stencilState=new Ts,this._alphaState=new Xv(!1),this._alphaMode=Array(8).fill(-1),this._alphaEquation=Array(8).fill(-1),this._activeRequests=[],this._badOS=!1,this._badDesktopOS=!1,this._compatibilityMode=!0,this._internalTexturesCache=new Array,this._currentRenderTarget=null,this._boundTexturesCache={},this._activeChannel=0,this._currentTextureChannel=-1,this._viewportCached={x:0,y:0,z:0,w:0},this._isWebGPU=!1,this._enableGPUDebugMarkers=!1,this.onCanvasBlurObservable=new Ae,this.onCanvasFocusObservable=new Ae,this.onNewSceneAddedObservable=new Ae,this.onResizeObservable=new Ae,this.onCanvasPointerOutObservable=new Ae,this.onEffectErrorObservable=new Ae,this.disablePerformanceMonitorInBackground=!1,this.disableVertexArrayObjects=!1,this._frameId=0,this.hostInformation={isMobile:!1},this.isFullscreen=!1,this.enableOfflineSupport=!1,this.disableManifestCheck=!1,this.disableContextMenu=!0,this.currentRenderPassId=0,this.isPointerLock=!1,this.postProcesses=[],this.canvasTabIndex=1,this._contextWasLost=!1,this._useReverseDepthBuffer=!1,this.isNDCHalfZRange=!1,this.hasOriginBottomLeft=!0,this._renderTargetWrapperCache=new Array,this._compiledEffects={},this._isDisposed=!1,this.scenes=[],this._virtualScenes=new Array,this.onBeforeTextureInitObservable=new Ae,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this._frameHandler=0,this._activeRenderLoops=new Array,this.customAnimationFrameRequester=null,this._windowIsBackground=!1,this._boundRenderFunction=o=>this._renderLoop(o),this._lastFrameTime=0,this._renderAccumulator=0,this.skipFrameRender=!1,this.onBeforeShaderCompilationObservable=new Ae,this.onAfterShaderCompilationObservable=new Ae,this.onBeginFrameObservable=new Ae,this.onEndFrameObservable=new Ae,this._transformTextureUrl=null,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._highPrecisionShadersAllowed=!0,this.onContextLostObservable=new Ae,this.onContextRestoredObservable=new Ae,this._name="",this.premultipliedAlpha=!0,this.adaptToDeviceRatio=!1,this._lastDevicePixelRatio=1,this._doNotHandleContextLost=!1,this.cullBackFaces=null,this._renderPassNames=["main"],this._fps=60,this._deltaTime=0,this._deterministicLockstep=!1,this._lockstepMaxSteps=4,this._timeStep=1/60,this.onDisposeObservable=new Ae,this.onReleaseEffectsObservable=new Ae,ft.Instances.push(this),this.startTime=Vn.Now,this._stencilStateComposer.stencilGlobal=this._stencilState,Si.SetMatrixPrecision(!!t.useLargeWorldRendering||!!t.useHighPrecisionMatrix),Xa()&&navigator.userAgent&&(this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),t.antialias=e??t.antialias,t.deterministicLockstep=t.deterministicLockstep??!1,t.lockstepMaxSteps=t.lockstepMaxSteps??4,t.timeStep=t.timeStep??1/60,t.stencil=t.stencil??!0,this._audioContext=t.audioEngineOptions?.audioContext??null,this._audioDestination=t.audioEngineOptions?.audioDestination??null,this.premultipliedAlpha=t.premultipliedAlpha??!0,this._doNotHandleContextLost=!!t.doNotHandleContextLost,this._isStencilEnable=!!t.stencil,this.useExactSrgbConversions=t.useExactSrgbConversions??!1,this.canvasTabIndex=t.canvasTabIndex??this.canvasTabIndex;const s=Bi()&&window.devicePixelRatio||1,r=t.limitDeviceRatio||s;i=i||t.adaptToDeviceRatio||!1,this.adaptToDeviceRatio=i,this._hardwareScalingLevel=i?1/Math.min(r,s):1,this._lastDevicePixelRatio=s,this._creationOptions=t}resize(e=!1){let t,i;if(this.adaptToDeviceRatio){const s=Bi()&&window.devicePixelRatio||1,r=this._lastDevicePixelRatio/s;this._lastDevicePixelRatio=s,this._hardwareScalingLevel*=r}if(Bi()&&Qr())if(this._renderingCanvas){const s=this._renderingCanvas.getBoundingClientRect?.();t=this._renderingCanvas.clientWidth||s?.width||this._renderingCanvas.width*this._hardwareScalingLevel||100,i=this._renderingCanvas.clientHeight||s?.height||this._renderingCanvas.height*this._hardwareScalingLevel||100}else t=window.innerWidth,i=window.innerHeight;else t=this._renderingCanvas?this._renderingCanvas.width:100,i=this._renderingCanvas?this._renderingCanvas.height:100;this.setSize(t/this._hardwareScalingLevel,i/this._hardwareScalingLevel,e)}setSize(e,t,i=!1){if(!this._renderingCanvas||(e=e|0,t=t|0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t))return!1;if(this._renderingCanvas.width=e,this._renderingCanvas.height=t,this.scenes){for(let s=0;s<this.scenes.length;s++){const r=this.scenes[s];for(let o=0;o<r.cameras.length;o++){const c=r.cameras[o];c._currentRenderId=0}}this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this)}return!0}createRawTexture(e,t,i,s,r,o,c,h,f,_,d,g){throw je("engine.rawTexture")}createRawCubeTexture(e,t,i,s,r,o,c,h){throw je("engine.rawTexture")}createRawTexture3D(e,t,i,s,r,o,c,h,f,_,d){throw je("engine.rawTexture")}createRawTexture2DArray(e,t,i,s,r,o,c,h,f,_,d,g){throw je("engine.rawTexture")}_sharedInit(e){this._renderingCanvas=e}_setupMobileChecks(){navigator&&navigator.userAgent&&(this._checkForMobile=()=>{const e=navigator.userAgent;this.hostInformation.isMobile=e.indexOf("Mobile")!==-1||e.indexOf("Mac")!==-1&&Qr()&&"ontouchend"in document},this._checkForMobile(),Bi()&&window.addEventListener("resize",this._checkForMobile))}createVideoElement(e){return document.createElement("video")}_reportDrawCall(e=1){this._drawCalls?.addCount(e,!1)}getFps(){return this._fps}
144getDeltaTime(){return this._deltaTime}isDeterministicLockStep(){return this._deterministicLockstep}getLockstepMaxSteps(){return this._lockstepMaxSteps}getTimeStep(){return this._timeStep*1e3}_createImageBitmapFromSource(e,t){throw new Error("createImageBitmapFromSource is not implemented")}createImageBitmap(e,t){return createImageBitmap(e,t)}resizeImageBitmap(e,t,i){throw new Error("resizeImageBitmap is not implemented")}getFontOffset(e){throw new Error("getFontOffset is not implemented")}static _CreateCanvas(e,t){if(typeof document>"u")return new OffscreenCanvas(e,t);const i=document.createElement("canvas");return i.width=e,i.height=t,i}createCanvas(e,t){return Ve._CreateCanvas(e,t)}static _FileToolsLoadImage(e,t,i,s,r,o,c){if(!Zr.loadImage)throw je("FileTools");return Zr.loadImage(e,t,i,s,r,o,c)}_loadFile(e,t,i,s,r,o){const c=Nv(e,t,i,s,r,o);return this._activeRequests.push(c),c.onCompleteObservable.add(()=>{const h=this._activeRequests.indexOf(c);h!==-1&&this._activeRequests.splice(h,1)}),c}static _FileToolsLoadFile(e,t,i,s,r,o){if(Zr.loadFile)return Zr.loadFile(e,t,i,s,r,o);throw je("FileTools")}dispose(){for(this.releaseEffects(),this._isDisposed=!0,this.stopRenderLoop(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._renderingCanvas=null,this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.scenes.length;)this.scenes[0].dispose();for(;this._virtualScenes.length;)this._virtualScenes[0].dispose();this.releaseComputeEffects?.(),pi.ResetCache();for(const t of this._activeRequests)t.abort();this._boundRenderFunction=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onNewSceneAddedObservable.clear(),this.onEffectErrorObservable.clear(),Bi()&&window.removeEventListener("resize",this._checkForMobile);const e=ft.Instances.indexOf(this);e>=0&&ft.Instances.splice(e,1),ft.Instances.length||(ft.OnEnginesDisposedObservable.notifyObservers(this),ft.OnEnginesDisposedObservable.clear()),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}static DefaultLoadingScreenFactory(e){throw je("LoadingScreen")}static MarkAllMaterialsAsDirty(e,t){for(let i=0;i<ft.Instances.length;i++){const s=ft.Instances[i];for(let r=0;r<s.scenes.length;r++)s.scenes[r].markAllMaterialsAsDirty(e,t)}}static GetCompatibleTextureLoader(e,t){return null}}Ve._RenderPassIdCounter=0;Ve._RescalePostProcessFactory=null;Ve.CollisionsEpsilon=.001;Ve.QueueNewFrame=qv;function jv(a){return a.getPipelineContext===void 0}class oD{constructor(){this.shaderLanguage=0}postProcessor(e,t,i,s,r){if(r.drawBuffersExtensionDisabled){const o=/#extension.+GL_EXT_draw_buffers.+(enable|require)/g;e=e.replace(o,"")}return e}}const lD=/(flat\s)?\s*varying\s*.*/;class cD{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,t){return lD.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,i){const s=e.search(/#extension.+GL_EXT_draw_buffers.+require/)!==-1,r=/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;if(e=e.replace(r,""),e=e.replace(/texture2D\s*\(/g,"texture("),i){const o=e.search(/layout *\(location *= *0\) *out/g)!==-1,c=t.indexOf("#define DUAL_SOURCE_BLENDING")!==-1,h=c?`layout(location = 0, index = 0) out vec4 glFragColor;
145layout(location = 0, index = 1) out vec4 glFragColor2;
146`:`layout(location = 0) out vec4 glFragColor;
147`;c&&(e=`#extension GL_EXT_blend_func_extended : require
148`+e),e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCubeLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCube\s*\(/g,"texture("),e=e.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),e=e.replace(/gl_FragColor/g,"glFragColor"),e=e.replace(/gl_FragData/g,"glFragData"),e=e.replace(/void\s+?main\s*\(/g,(s||o?"":h)+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e=`invariant gl_Position;
149`+e),t.indexOf("#define MULTIVIEW")!==-1)return`#extension GL_OVR_multiview2 : require
150layout (num_views = 2) in;
151`+e;return e}}class xl{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=xl._Counter++}}xl._Counter=0;class ol extends xl{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}function Vc(a){let e=1;do e*=2;while(e<a);return e===a}function Vy(a,e,t){return a*(1-t)+e*t}function hD(a){const e=Yv(a),t=Kv(a);return e-a>a-t?t:e}function Yv(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a}function Kv(a){return a=a|a>>1,a=a|a>>2,a=a|a>>4,a=a|a>>8,a=a|a>>16,a-(a>>1)}function Rd(a,e,t=2){let i;switch(t){case 1:i=Kv(a);break;case 2:i=hD(a);break;case 3:default:i=Yv(a);break}return Math.min(i,e)}class Ad{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&(e=t.createTexture(),!e))throw new Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(const e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){return this._MSAARenderBuffers?.[e]??null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}function Gy(a){return a===13||a===14||a===15||a===16||a===17||a===18||a===19}function ll(a){return a===13||a===17||a===18||a===19}class uD{}class st extends Ve{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return pi.ShadersRepository}static set ShadersRepository(e){pi.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,i,s){if(i=i||{},super(t??i.antialias,i,s),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;let r;if(e.getContext){if(r=e,i.preserveDrawingBuffer===void 0&&(i.preserveDrawingBuffer=!1),i.xrCompatible===void 0&&(i.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const h=navigator.userAgent;for(const f of st.ExceptionList){const _=f.key,d=f.targets;if(new RegExp(_).test(h)){if(f.capture&&f.captureConstraint){const p=f.capture,x=f.captureConstraint,T=new RegExp(p).exec(h);if(T&&T.length>0&&parseInt(T[T.length-1])>=x)continue}for(const p of d)switch(p){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":i.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1;break}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{Qf(this._gl)}:(this._onContextLost=h=>{h.preventDefault(),this._contextWasLost=!0,Qf(this._gl),me.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},r.addEventListener("webglcontextrestored",this._onContextRestored,!1),i.powerPreference=i.powerPreference||"high-performance"),r.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(i.xrCompatible=!1),!i.disableWebGL2Support)try{this._gl=r.getContext("webgl2",i)||r.getContext("experimental-webgl2",i),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch{}if(!this._gl){if(!r)throw new Error("The provided canvas is null or undefined.");try{this._gl=r.getContext("webgl",i)||r.getContext("experimental-webgl",i)}catch(h){throw new Error("WebGL not supported",{cause:h})}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=e,r=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const h=this._gl.getContextAttributes();h&&(i.stencil=h.stencil)}this._sharedInit(r),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),i.useHighPrecisionFloats!==void 0&&(this._highPrecisionShadersAllowed=i.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let h=0;h<this._caps.maxVertexAttribs;h++)this._currentBufferPointers[h]=new uD;this._shaderProcessor=this.webGLVersion>1?new cD:new oD;const o=`Babylon.js v${st.Version}`;me.Log(o+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",o);const c=fs(this._gl);c.validateShaderPrograms=this.validateShaderPrograms,c.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}
vendor: 8,888 bytes, line 151
151areAllEffectsReady(){for(const e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),shaderFloatPrecision:0,parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||this._gl.getExtension("OES_standard_derivatives")!==null,maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||this._gl.getExtension("OES_element_index_uint")!==null,fragmentDepthSupported:this._webGLVersion>1||this._gl.getExtension("EXT_frag_depth")!==null,highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),blendFloat:this._gl.getExtension("EXT_float_blend")!==null,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:this._webGLVersion!==1,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1,supportReadWriteStorageTextures:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);const e=this._gl.getExtension("WEBGL_debug_renderer_info");e!=null&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),this._gl.HALF_FLOAT_OES!==36193&&(this._gl.HALF_FLOAT_OES=36193),this._gl.RGBA16F!==34842&&(this._gl.RGBA16F=34842),this._gl.RGBA32F!==34836&&(this._gl.RGBA32F=34836),this._gl.DEPTH24_STENCIL8!==35056&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(this._webGLVersion===1&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);const t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,this._alphaState=new Xv(this._caps.blendParametersPerTarget),t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&this._gl.HALF_FLOAT_OES!==5131&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRen
151der=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._maxMSAASamplesOverride!==null?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{const i=this._gl.getExtension("WEBGL_draw_buffers");if(i!==null){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=i.drawBuffersWEBGL.bind(i),this._caps.maxDrawBuffers=this._gl.getParameter(i.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let s=0;s<16;s++)this._gl["COLOR_ATTACHMENT"+s+"_WEBGL"]=i["COLOR_ATTACHMENT"+s+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{const i=this._gl.getExtension("WEBGL_depth_texture");i!=null&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=i.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{const i=this._gl.getExtension("OES_vertex_array_object");i!=null&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=i.createVertexArrayOES.bind(i),this._gl.bindVertexArray=i.bindVertexArrayOES.bind(i),this._gl.deleteVertexArray=i.deleteVertexArrayOES.bind(i))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{const i=this._gl.getExtension("ANGLE_instanced_arrays");i!=null?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=i.drawArraysInstancedANGLE.bind(i),this._gl.drawElementsInstanced=i.drawElementsInstancedANGLE.bind(i),this._gl.vertexAttribDivisor=i.vertexAttribDivisorANGLE.bind(i)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){const i=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),s=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(i&&s&&(this._caps.highPrecisionShaderSupported=i.precision!==0&&s.precision!==0,this._caps.shaderFloatPrecision=Math.min(i.precision,s.precision)),!this._shouldUseHighPrecisionShader){const r=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),o=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);r&&o&&(this._caps.shaderFloatPrecision=Math.min(r.precision,o.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{const i=this._gl.getExtension("EXT_blend_minmax");i!=null&&(this._caps.blendMinMax=!0,this._gl.MAX=i.MAX_EXT,this._gl.MIN=i.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{const i=this._gl.getExtension("EXT_sRGB");i!=null&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:i.SRGB_EXT,SRGB8:i.SRGB_ALPHA_EXT,SRGB8_ALPHA8:i.SRGB_ALPHA_EXT})}if(this._creationOptions){const i=this._creationOptions.forceSRGBBufferSupportState;i!==void 0&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&i)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let i=0;i<this._maxSimultaneousTextures;i++)this._nextFreeTextureSlots.push(i);this._glRenderer==="Mali-G72"&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){this._features={forceBitmapOverHTMLImageElement:typeof HTMLImageElement>"u",supportRenderAndCopyToLodForFloatTextures:this._webGLVersion!==1,supportDepthStencilTexture:this._webGLVersion!==1,supportShadowSamplers:this._webGLVersion!==1,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:this._webGLVersion!==1,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:this._webGLVersion!==1,basisNeedsPOT:this._webGLVersion===1,support3DTextures:this._webGLVersion!==1,needTypeSuffixInShaderConstants:this._webGLVersion!==1,supportMSAA:this._webGLVersion!==1,supportSSAO2:this._webGLVersion!==1,supportIBLShadows:this._webGLVersion!==1,supportExtendedTextureFormats:this._webGLVersion!==1,supportSwitchCaseInSha
vendor: 49,050 bytes, line 151
151der:this._webGLVersion!==1,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);const e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){const e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,i,s=!1,r=0){const o=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=o;let c=0;if(t&&e){let h=!0;if(this._currentRenderTarget){const f=this._currentRenderTarget.texture?.format;if(f===8||f===9||f===10||f===11){const _=this._currentRenderTarget.texture?.type;_===7||_===5?(st._TempClearColorUint32[0]=e.r*255,st._TempClearColorUint32[1]=e.g*255,st._TempClearColorUint32[2]=e.b*255,st._TempClearColorUint32[3]=e.a*255,this._gl.clearBufferuiv(this._gl.COLOR,0,st._TempClearColorUint32),h=!1):(st._TempClearColorInt32[0]=e.r*255,st._TempClearColorInt32[1]=e.g*255,st._TempClearColorInt32[2]=e.b*255,st._TempClearColorInt32[3]=e.a*255,this._gl.clearBufferiv(this._gl.COLOR,0,st._TempClearColorInt32),h=!1)}}h&&(this._gl.clearColor(e.r,e.g,e.b,e.a!==void 0?e.a:1),c|=this._gl.COLOR_BUFFER_BIT)}i&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),c|=this._gl.DEPTH_BUFFER_BIT),s&&(this._gl.clearStencil(r),c|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(c)}_viewport(e,t,i,s){(e!==this._viewportCached.x||t!==this._viewportCached.y||i!==this._viewportCached.z||s!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=s,this._gl.viewport(e,t,i,s))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw new Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,i,s,r,o=0,c=0){const h=e;this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(h._framebuffer);const f=this._gl;e.isMulti||(e.is2DArray||e.is3D?(f.framebufferTextureLayer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,o,c),h._currentLOD=o):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,o):h._currentLOD!==o&&(f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,o),h._currentLOD=o));const _=e._depthStencilTexture;if(_){e.is3D&&(e.texture.width!==_.width||e.texture.height!==_.height||e.texture.depth!==_.depth)&&me.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");const d=e._depthStencilTextureWithStencil?f.DEPTH_STENCIL_ATTACHMENT:f.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?f.framebufferTextureLayer(f.FRAMEBUFFER,d,_._hardwareTexture?.underlyingResource,o,c):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,d,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,_._hardwareTexture?.underlyingResource,o):f.framebufferTexture2D(f.FRAMEBUFFER,d,f.TEXTURE_2D,_._hardwareTexture?.underlyingResource,o)}h._MSAAFramebuffer&&this._bindUnboundFramebuffer(h._MSAAFramebuffer),this._cachedViewport&&!r?this.setViewport(this._cachedViewport,i,s):(i||(i=e.width,o&&(i=i/Math.pow(2,o))),s||(s=e.height,o&&(s=s/Math.pow(2,o))),this._viewport(0,0,i,s)),this.wipeCaches()}setStateCullFaceType(e,t){const i=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==i||t)&&(this._depthCullingState.cullFace=i)}setState(e,t=0,i,s=!1,r,o,c=0){(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(r,i),this.setZOffset(t),this.setZOffsetUnits(c);const h=s?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==h||i)&&(this._depthCullingState.frontFace=h),this._stencilStateComposer.stencilMaterial=o}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return this._currentFramebuffer===null}generateMipmaps(e){const t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,i){const s=e;this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),i&&(s._MSAAFramebuffer&&this._bindUnboundFramebuffer(s._framebuffer),i()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){const t=e,i=this._gl;if(!t._MSAAFramebuffer||t.isMulti)return;let s=t.resolveMSAAColors?i.COLOR_BUFFER_BIT:0;s|=t._generateDepthBuffer&&t.resolveMSAADepth?i.DEPTH_BUFFER_BIT:0,s|=t._generateStencilBuffer&&t.resolveMSAAStencil?i.STENCIL_BUFFER_BIT:0,i.bindFramebuffer(i.READ_FRAMEBUFFER,t._MSAAFramebuffer),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer),i.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,s,i.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,i){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");const s=new ol(i);return this.bindArrayBuffer(s),typeof e!="number"?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),s.capacity=e.length*4):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),s.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),s.capacity=e),this._resetVertexBufferBinding(),s.references=1,s}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,i){const s=this._gl.createBuffer(),r=new ol(s);if(!s)throw new Error("Unable to create index buffer");this.bindIndexBuffer(r);const o=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,o,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),r.references=1,r.is32Bits=o.BYTES_PER_ELEMENT===4,r}_normalizeIndexData(e){if(e.BYTES_PER_ELEMENT===2)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(let i=0;i<e.length;i++)if(e[i]>=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,i){const s=e.program,r=this._gl.getUniformBlockIndex(s,t);this._gl.uniformBlockBinding(s,r,i)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,i,s,r,o,c){const h=this._currentBufferPointers[t];if(!h)return;let f=!1;h.active?(h.buffer!==e&&(h.buffer=e,f=!0),h.size!==i&&(h.size=i,f=!0),h.type!==s&&(h.type=s,f=!0),h.normalized!==r&&(h.normalized=r,f=!0),h.stride!==o&&(h.stride=o,f=!0),h.offset!==c&&(h.offset=c,f=!0)):(f=!0,h.active=!0,h.index=t,h.size=i,h.type=s,h.normalized=r,h.stride=o,h.offset=c,h.buffer=e),(f||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),s===this._gl.UNSIGNED_INT||s===this._gl.INT?this._gl.vertexAttribIPointer(t,i,s,o,c):this._gl.vertexAttribPointer(t,i,s,r,o,c))}_bindIndexBufferWithCache(e){e!=null&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,i){const s=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let r=0;r<s.length;r++){const o=t.getAttributeLocation(r);if(o>=0){const c=s[r];let h=null;if(i&&(h=i[c]),h||(h=e[c]),!h)continue;this._gl.enableVertexAttribArray(o),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[o]=!0);const f=h.getBuffer();f&&(this._vertexAttribPointer(f,o,h.getSize(),h.type,h.normalized,h.byteStride,h.byteOffset),h.getIsInstanced()&&(this._gl.vertexAttribDivisor(o,h.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(o),this._currentInstanceBuffers.push(f))))}}}recordVertexArrayObject(e,t,i,s){const r=this._gl.createVertexArray();if(!r)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(r),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i,s),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),r}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=t!=null&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,i,s,r){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==r){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r;const o=r.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let c=0;for(let h=0;h<o;h++)if(h<i.length){const f=r.getAttributeLocation(h);f>=0&&(this._gl.enableVertexAttribArray(f),this._vertexAttribArraysEnabled[f]=!0,this._vertexAttribPointer(e,f,i[h],this._gl.FLOAT,!1,s,c)),c+=i[h]*4}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,i,s){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==i)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i,s)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,i=this._currentInstanceLocations.length;t<i;t++){const s=this._currentInstanceBuffers[t];e!=s&&s.references&&(e=s,this.bindArrayBuffer(s));const r=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(r,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){this._gl.deleteVertexArray(e)}_releaseBuffer(e){return e.references--,e.references===0?(this._deleteBuffer(e),!0):!1}_deleteBuffer(e){this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,i){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),i[0].index!==void 0)this.bindInstancesBuffer(e,i,!0);else for(let s=0;s<4;s++){const r=i[s];this._vertexAttribArraysEnabled[r]||(this._gl.enableVertexAttribArray(r),this._vertexAttribArraysEnabled[r]=!0),this._vertexAttribPointer(e,r,4,this._gl.FLOAT,!1,64,s*16),this._gl.vertexAttribDivisor(r,1),this._currentInstanceLocations.push(r),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,i=!0){this.bindArrayBuffer(e);let s=0;if(i)for(let r=0;r<t.length;r++){const o=t[r];s+=o.attributeSize*4}for(let r=0;r<t.length;r++){const o=t[r];o.index===void 0&&(o.index=this._currentEffect.getAttributeLocationByName(o.attributeName)),!(o.index<0)&&(this._vertexAttribArraysEnabled[o.index]||(this._gl.enableVertexAttribArray(o.index),this._vertexAttribArraysEnabled[o.index]=!0),this._vertexAttribPointer(e,o.index,o.attributeSize,o.attributeType||this._gl.FLOAT,o.normalized||!1,s,o.offset),this._gl.vertexAttribDivisor(o.index,o.divisor===void 0?1:o.divisor),this._currentInstanceLocations.push(o.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){if(!this._currentEffect)return;const t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){let t=!1,i;for(;(i=this._currentInstanceLocations.indexOf(e))!==-1;)this._currentInstanceLocations.splice(i,1),this._currentInstanceBuffers.splice(i,1),t=!0;t&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,i,s){this.drawElementsType(e?0:1,t,i,s)}drawPointClouds(e,t,i){this.drawArraysType(2,e,t,i)}drawUnIndexed(e,t,i,s){this.drawArraysType(e?0:1,t,i,s)}drawElementsType(e,t,i,s){this.applyStates(),this._reportDrawCall();const r=this._drawMode(e),o=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,c=this._uintIndicesCurrentlySet?4:2;s?this._gl.drawElementsInstanced(r,i,o,t*c,s):this._gl.drawElements(r,i,o,t*c)}drawArraysType(e,t,i,s){this.applyStates(),this._reportDrawCall();const r=this._drawMode(e);s?this._gl.drawArraysInstanced(r,t,i,s):this._gl.drawArrays(r,t,i)}_drawMode(e){switch(e){case 0:return this._gl.TRIANGLES;case 2:return this._gl.POINTS;case 1:return this._gl.LINES;case 3:return this._gl.POINTS;case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN;default:return this._gl.TRIANGLES}}_releaseEffect(e){this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];const t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){const t=e;t&&t.program&&(t.program.__SPECTOR_rebuildProgram=null,Wv(t),this._gl&&(this._currentProgram===t.program&&this._setProgram(null),this._gl.deleteProgram(t.program)))}_getGlobalDefines(e){return zv(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,i,s,r,o,c,h,f,_=0,d){const g=typeof e=="string"?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,p=typeof e=="string"?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,x=this._getGlobalDefines(),b=t.attributes!==void 0;let T=r??t.defines??"";x&&(T+=x);const R=g+"+"+p+"@"+T;if(this._compiledEffects[R]){const M=this._compiledEffects[R];return c&&M.isReady()&&c(M),M._refCount++,M}this._gl&&fs(this._gl);const S=new pi(e,t,b?this:i,s,this,r,o,c,h,f,R,t.shaderLanguage??_,t.extraInitializationsAsync??d);return this._compiledEffects[R]=S,S}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,i,s,r=null){const o=fs(this._gl);return o._contextWasLost=this._contextWasLost,o.validateShaderPrograms=this.validateShaderPrograms,Vv(e,t,i,s||this._gl,r)}createShaderProgram(e,t,i,s,r,o=null){const c=fs(this._gl);return c._contextWasLost=this._contextWasLost,c.validateShaderPrograms=this.validateShaderPrograms,Gv(e,t,i,s,r||this._gl,o)}inlineShaderCode(e){return e}createPipelineContext(e){if(this._gl){const i=fs(this._gl);i.parallelShaderCompile=this._caps.parallelShaderCompile}const t=PC(this._gl);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return Kd(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,i,s,r,o,c,h,f,_,d){const g=fs(this._gl);return g._contextWasLost=this._contextWasLost,g.validateShaderPrograms=this.validateShaderPrograms,g._createShaderProgramInjection=this._createShaderProgram.bind(this),g.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),g.createShaderProgramInjection=this.createShaderProgram.bind(this),g.loadFileInjection=this._loadFile.bind(this),FC(e,t,i,s,r,o,c,h,f,_,d)}_createShaderProgram(e,t,i,s,r=null){return Yd(e,t,i,s,r)}_isRenderingStateCompiled(e){return this._isDisposed?!1:OC(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){LC(e,t)}getUniforms(e,t){const i=new Array,s=e;for(let r=0;r<t.length;r++)i.push(this._gl.getUniformLocation(s.program,t[r]));return i}getAttributes(e,t){const i=[],s=e;for(let r=0;r<t.length;r++)try{i.push(this._gl.getAttribLocation(s.program,t[r]))}catch{i.push(-1)}return i}enableEffect(e){e=e!==null&&jv(e)?e.effect:e,!(!e||e===this._currentEffect)&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){return e?(this._gl.uniform1i(e,t),!0):!1}setInt2(e,t,i){return e?(this._gl.uniform2i(e,t,i),!0):!1}setInt3(e,t,i,s){return e?(this._gl.uniform3i(e,t,i,s),!0):!1}setInt4(e,t,i,s,r){return e?(this._gl.uniform4i(e,t,i,s,r),!0):!1}setIntArray(e,t){return e?(this._gl.uniform1iv(e,t),!0):!1}setIntArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){return e?(this._gl.uniform1ui(e,t),!0):!1}setUInt2(e,t,i){return e?(this._gl.uniform2ui(e,t,i),!0):!1}setUInt3(e,t,i,s){return e?(this._gl.uniform3ui(e,t,i,s),!0):!1}setUInt4(e,t,i,s,r){return e?(this._gl.uniform4ui(e,t,i,s,r),!0):!1}setUIntArray(e,t){return e?(this._gl.uniform1uiv(e,t),!0):!1}setUIntArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){return!e||t.length<1?!1:(this._gl.uniform1fv(e,t),!0)}setArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){return e?(this._gl.uniformMatrix4fv(e,!1,t),!0):!1}setMatrix3x3(e,t){return e?(this._gl.uniformMatrix3fv(e,!1,t),!0):!1}setMatrix2x2(e,t){return e?(this._gl.uniformMatrix2fv(e,!1,t),!0):!1}setFloat(e,t){return e?(this._gl.uniform1f(e,t),!0):!1}setFloat2(e,t,i){return e?(this._gl.uniform2f(e,t,i),!0):!1}setFloat3(e,t,i,s){return e?(this._gl.uniform3f(e,t,i,s),!0):!1}setFloat4(e,t,i,s,r){return e?(this._gl.uniform4f(e,t,i,s,r),!0):!1}applyStates(){if(this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;const e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){this.preventCacheWipeBetweenFrames&&!e||(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){const i=this._gl;let s=i.NEAREST,r=i.NEAREST,o=!1;switch(e){case 11:s=i.LINEAR,t?r=i.LINEAR_MIPMAP_NEAREST:r=i.LINEAR;break;case 3:s=i.LINEAR,o=!0,t?r=i.LINEAR_MIPMAP_LINEAR:r=i.LINEAR;break;case 8:o=!0,s=i.NEAREST,t?r=i.NEAREST_MIPMAP_LINEAR:r=i.NEAREST;break;case 4:s=i.NEAREST,t?r=i.NEAREST_MIPMAP_NEAREST:r=i.NEAREST;break;case 5:s=i.NEAREST,t?r=i.LINEAR_MIPMAP_NEAREST:r=i.LINEAR;break;case 6:o=!0,s=i.NEAREST,t?r=i.LINEAR_MIPMAP_LINEAR:r=i.LINEAR;break;case 7:s=i.NEAREST,r=i.LINEAR;break;case 1:s=i.NEAREST,r=i.NEAREST;break;case 9:s=i.LINEAR,t?r=i.NEAREST_MIPMAP_NEAREST:r=i.NEAREST;break;case 10:o=!0,s=i.LINEAR,t?r=i.NEAREST_MIPMAP_LINEAR:r=i.NEAREST;break;case 2:s=i.LINEAR,r=i.LINEAR;break;case 12:s=i.LINEAR,r=i.NEAREST;break}return{min:r,mag:s,hasMipMaps:o}}_createTexture(){const e=this._gl.createTexture();if(!e)throw new Error("Unable to create texture");return e}_createHardwareTexture(){return new Ad(this._createTexture(),this._gl)}_createInternalTexture(e,t,i=!0,s=0){let r,o=!1,c=0,h=3,f=5,_=!1,d=1,g,p=!1,x=0,b=!1;t!==void 0&&typeof t=="object"?(r=!!t.generateMipMaps,o=!!t.createMipMaps,c=t.type===void 0?0:t.type,h=t.samplingMode===void 0?3:t.samplingMode,f=t.format===void 0?5:t.format,_=t.useSRGBBuffer===void 0?!1:t.useSRGBBuffer,d=t.samples??1,g=t.label,p=!!t.createMSAATexture,x=t.comparisonFunction||0,b=!!t.isCube):r=!!t,_&&(_=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(c===1&&!this._caps.textureFloatLinearFiltering||c===2&&!this._caps.textureHalfFloatLinearFiltering)&&(h=1),c===1&&!this._caps.textureFloat&&(c=0,me.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const T=Gy(f),R=ll(f),S=this._gl,M=new is(this,s),I=e.width||e,A=e.height||e,D=e.depth||0,C=e.layers||0,k=this._getSamplingParameters(h,(r||o)&&!T),H=C!==0?S.TEXTURE_2D_ARRAY:D!==0?S.TEXTURE_3D:b?S.TEXTURE_CUBE_MAP:S.TEXTURE_2D,L=T?this._getInternalFormatFromDepthTextureFormat(f,!0,R):this._getRGBABufferInternalSizedFormat(c,f,_),J=T?R?S.DEPTH_STENCIL:S.DEPTH_COMPONENT:this._getInternalFormat(f),te=T?this._getWebGLTextureTypeFromDepthTextureFormat(f):this._getWebGLTextureType(c);if(this._bindTextureDirectly(H,M),C!==0)M.is2DArray=!0,S.texImage3D(H,0,L,I,A,C,0,J,te,null);else if(D!==0)M.is3D=!0,S.texImage3D(H,0,L,I,A,D,0,J,te,null);else if(b){M.isCube=!0;for(let ae=0;ae<6;ae++)S.texImage2D(S.TEXTURE_CUBE_MAP_POSITIVE_X+ae,0,L,I,A,0,J,te,null)}else S.texImage2D(H,0,L,I,A,0,J,te,null);if(S.texParameteri(H,S.TEXTURE_MAG_FILTER,k.mag),S.texParameteri(H,S.TEXTURE_MIN_FILTER,k.min),S.texParameteri(H,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(H,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),T&&this.webGLVersion>1&&(x===0?(S.texParameteri(H,S.TEXTURE_COMPARE_FUNC,515),S.texParameteri(H,S.TEXTURE_COMPARE_MODE,S.NONE)):(S.texParameteri(H,S.TEXTURE_COMPARE_FUNC,x),S.texParameteri(H,S.TEXTURE_COMPARE_MODE,S.COMPARE_REF_TO_TEXTURE))),(r||o)&&this._gl.generateMipmap(H),this._bindTextureDirectly(H,null),M._useSRGBBuffer=_,M.baseWidth=I,M.baseHeight=A,M.width=I,M.height=A,M.depth=C||D,M.isReady=!0,M.samples=d,M.generateMipMaps=r,M.samplingMode=h,M.type=c,M.format=f,M.label=g,M.comparisonFunction=x,this._internalTexturesCache.push(M),p){let ae;if(Gy(M.format)?ae=this._setupFramebufferDepthAttachments(ll(M.format),M.format!==19,M.width,M.height,d,M.format,!0):ae=this._createRenderBuffer(M.width,M.height,d,-1,this._getRGBABufferInternalSizedFormat(M.type,M.format,M._useSRGBBuffer),-1),!ae)throw new Error("Unable to create render buffer");M._autoMSAAManagement=!0;let B=M._hardwareTexture;B||(B=M._hardwareTexture=this._createHardwareTexture()),B.addMSAARenderBuffer(ae)}return M}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,i,s,r=3,o=null,c=null,h=null,f=null,_=null,d=null,g,p,x,b){return this._createTextureBase(e,t,i,s,r,o,c,(...T)=>this._prepareWebGLTexture(...T,_),(T,R,S,M,I,A)=>{const D=this._gl,C=S.width===T&&S.height===R;I._creationFlags=x??0;const k=this._getTexImageParametersForCreateTexture(I.format,I._useSRGBBuffer);if(C)return D.texImage2D(D.TEXTURE_2D,0,k.internalFormat,k.format,k.type,S),!1;const H=this._caps.maxTextureSize;if(S.width>H||S.height>H||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext||(this._workingCanvas.width=T,this._workingCanvas.height=R,this._workingContext.drawImage(S,0,0,S.width,S.height,0,0,T,R),D.texImage2D(D.TEXTURE_2D,0,k.internalFormat,k.format,k.type,this._workingCanvas),I.width=T,I.height=R),!1;{const L=new is(this,2);this._bindTextureDirectly(D.TEXTURE_2D,L,!0),D.texImage2D(D.TEXTURE_2D,0,k.internalFormat,k.format,k.type,S),this._rescaleTexture(L,I,s,k.format,()=>{this._releaseTexture(L),this._bindTextureDirectly(D.TEXTURE_2D,I,!0),A()})}return!0},h,f,_,d,g,p,b)}_getTexImageParametersForCreateTexture(e,t){let i,s;return this.webGLVersion===1?(i=this._getInternalFormat(e,t),s=i):(i=this._getInternalFormat(e,!1),s=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:s,format:i,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,i,s,r){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,i=!1){const s=this._getTextureTarget(t),r=this._getSamplingParameters(e,t.useMipMaps||i);this._setTextureParameterInteger(s,this._gl.TEXTURE_MAG_FILTER,r.mag,t),this._setTextureParameterInteger(s,this._gl.TEXTURE_MIN_FILTER,r.min),i&&r.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(s)),this._bindTextureDirectly(s,null),t.samplingMode=e}updateTextureDimensions(e,t,i,s=1){}updateTextureWrappingMode(e,t,i=null,s=null){const r=this._getTextureTarget(e);t!==null&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),i!==null&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&s!==null&&(this._setTextureParameterInteger(r,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(s),e),e._cachedWrapR=s),this._bindTextureDirectly(r,null)}_uploadCompressedDataToTextureDirectly(e,t,i,s,r,o=0,c=0){const h=this._gl;let f=h.TEXTURE_2D;if(e.isCube&&(f=h.TEXTURE_CUBE_MAP_POSITIVE_X+o),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=h.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=h.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=h.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 37809:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;break;case 37810:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;break;case 37811:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;break;case 37812:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;break;case 37813:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;break;case 37814:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;break;case 37815:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;break;case 37816:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;break;case 37817:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;break;case 37818:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;break;case 37819:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;break;case 37820:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;break;case 37821:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;break;case 33776:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1;break}if(e.generateMipMaps){const _=e._hardwareTexture;_.memoryAllocated||(h.texStorage2D(e.isCube?h.TEXTURE_CUBE_MAP:h.TEXTURE_2D,Math.floor(Math.log2(Math.max(i,s)))+1,t,e.width,e.height),_.memoryAllocated=!0),this._gl.compressedTexSubImage2D(f,c,0,0,i,s,t,r)}else this._gl.compressedTexImage2D(f,c,t,i,s,0,r)}_uploadDataToTextureDirectly(e,t,i=0,s=0,r,o=!1){const c=this._gl,h=this._getWebGLTextureType(e.type),f=this._getInternalFormat(e.format),_=r===void 0?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(r,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let d=c.TEXTURE_2D;e.isCube&&(d=c.TEXTURE_CUBE_MAP_POSITIVE_X+i);const g=Math.round(Math.log(e.width)*Math.LOG2E),p=Math.round(Math.log(e.height)*Math.LOG2E),x=o?e.width:Math.pow(2,Math.max(g-s,0)),b=o?e.height:Math.pow(2,Math.max(p-s,0));c.texImage2D(d,s,_,x,b,0,f,h,t)}updateTextureData(e,t,i,s,r,o,c=0,h=0,f=!1){const _=this._gl,d=this._getWebGLTextureType(e.type),g=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let p=_.TEXTURE_2D,x=_.TEXTURE_2D;e.isCube&&(x=_.TEXTURE_CUBE_MAP_POSITIVE_X+c,p=_.TEXTURE_CUBE_MAP),this._bindTextureDirectly(p,e,!0),_.texSubImage2D(x,h,i,s,r,o,g,d,t),f&&this._gl.generateMipmap(x),this._bindTextureDirectly(p,null)}_uploadArrayBufferViewToTexture(e,t,i=0,s=0){const r=this._gl,o=e.isCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,i,s),this._bindTextureDirectly(o,null,!0)}_prepareWebGLTextureContinuation(e,t,i,s,r){const o=this._gl;if(!o)return;const c=this._getSamplingParameters(r,!i);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,c.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,c.min),!i&&!s&&o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,i,s,r,o,c,h,f,_){const d=this.getCaps().maxTextureSize,g=Math.min(d,this.needPOTTextures?Rd(s.width,d):s.width),p=Math.min(d,this.needPOTTextures?Rd(s.height,d):s.height),x=this._gl;if(x){if(!e._hardwareTexture){i&&i.removePendingData(e);return}this._bindTextureDirectly(x.TEXTURE_2D,e,!0),this._unpackFlipY(r===void 0?!0:!!r),e.baseWidth=s.width,e.baseHeight=s.height,e.width=g,e.height=p,e.isReady=!0,e.type=e.type!==-1?e.type:0,e.format=e.format!==-1?e.format:_??(t===".jpg"&&!e._useSRGBBuffer?4:5),!h(g,p,s,t,e,()=>{this._prepareWebGLTextureContinuation(e,i,o,c,f)})&&this._prepareWebGLTextureContinuation(e,i,o,c,f)}}_getInternalFormatFromDepthTextureFormat(e,t,i){const s=this._gl;if(!t)return s.STENCIL_INDEX8;let o=i?s.DEPTH_STENCIL:s.DEPTH_COMPONENT;return this.webGLVersion>1?e===15?o=s.DEPTH_COMPONENT16:e===16?o=s.DEPTH_COMPONENT24:e===17||e===13?o=i?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24:e===14?o=s.DEPTH_COMPONENT32F:e===18&&(o=i?s.DEPTH32F_STENCIL8:s.DEPTH_COMPONENT32F):o=s.DEPTH_COMPONENT16,o}_getWebGLTextureTypeFromDepthTextureFormat(e){const t=this._gl;let i=t.UNSIGNED_INT;return e===15?i=t.UNSIGNED_SHORT:e===17||e===13?i=t.UNSIGNED_INT_24_8:e===14?i=t.FLOAT:e===18?i=t.FLOAT_32_UNSIGNED_INT_24_8_REV:e===19&&(i=t.UNSIGNED_BYTE),i}_setupFramebufferDepthAttachments(e,t,i,s,r=1,o,c=!1){const h=this._gl;o=o??(e?13:14);const f=this._getInternalFormatFromDepthTextureFormat(o,t,e);return e&&t?this._createRenderBuffer(i,s,r,h.DEPTH_STENCIL,f,c?-1:h.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(i,s,r,f,f,c?-1:h.DEPTH_ATTACHMENT):e?this._createRenderBuffer(i,s,r,f,f,c?-1:h.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,i,s,r,o,c=!0){const f=this._gl.createRenderbuffer();return this._updateRenderBuffer(f,e,t,i,s,r,o,c)}_updateRenderBuffer(e,t,i,s,r,o,c,h=!0){const f=this._gl;return f.bindRenderbuffer(f.RENDERBUFFER,e),s>1&&f.renderbufferStorageMultisample?f.renderbufferStorageMultisample(f.RENDERBUFFER,s,o,t,i):f.renderbufferStorage(f.RENDERBUFFER,r,t,i),c!==-1&&f.framebufferRenderbuffer(f.FRAMEBUFFER,c,f.RENDERBUFFER,e),h&&f.bindRenderbuffer(f.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();const t=this._internalTexturesCache.indexOf(e);t!==-1&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e?.release()}_setProgram(e){this._currentProgram!==e&&(BC(e,this._gl),this._currentProgram=e)}bindSamplers(e){const t=e.getPipelineContext();this._setProgram(t.program);const i=e.getSamplers();for(let s=0;s<i.length;s++){const r=e.getUniform(i[s]);r&&(this._boundUniforms[s]=r)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,i=!1,s=!1){let r=!1;const o=t&&t._associatedChannel>-1;if(i&&o&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||s){if(this._activateCurrentTexture(),t&&t.isMultiview)throw me.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else i&&(r=!0,this._activateCurrentTexture());return o&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),r}_bindTexture(e,t,i){if(e===void 0)return;t&&(t._associatedChannel=e),this._activeChannel=e;const s=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(s,t)}unbindAllTextures(){for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,i,s){e!==void 0&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))}_bindSamplerUniformToChannel(e,t){const i=this._boundUniforms[e];!i||i._currentState===t||(this._gl.uniform1i(i,t),i._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:return this._gl.REPEAT;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,i=!1,s=!1,r=""){if(!t)return this._boundTexturesCache[e]!=null&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;const f=t.getInternalTexture();f&&(f._associatedChannel=e),t.update()}else if(t.delayLoadState===4)return t.delayLoad(),!1;let o;s?o=t.depthStencilTexture:t.isReady()?o=t.getInternalTexture():t.isCube?o=this.emptyCubeTexture:t.is3D?o=this.emptyTexture3D:t.is2DArray?o=this.emptyTexture2DArray:o=this.emptyTexture,!i&&o&&(o._associatedChannel=e);let c=!0;this._boundTexturesCache[e]===o&&(i||this._bindSamplerUniformToChannel(o._associatedChannel,e),c=!1),this._activeChannel=e;const h=this._getTextureTarget(o);if(c&&this._bindTextureDirectly(h,o,i),o&&!o.isMultiview){if(o.isCube&&o._cachedCoordinatesMode!==t.coordinatesMode){o._cachedCoordinatesMode=t.coordinatesMode;const f=t.coordinatesMode!==3&&t.coordinatesMode!==5?1:0;t.wrapU=f,t.wrapV=f}o._cachedWrapU!==t.wrapU&&(o._cachedWrapU=t.wrapU,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),o)),o._cachedWrapV!==t.wrapV&&(o._cachedWrapV=t.wrapV,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),o)),o.is3D&&o._cachedWrapR!==t.wrapR&&(o._cachedWrapR=t.wrapR,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),o)),this._setAnisotropicLevel(h,o,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,i,s){if(!(e===void 0||!t)){(!this._textureUnits||this._textureUnits.length!==i.length)&&(this._textureUnits=new Int32Array(i.length));for(let r=0;r<i.length;r++){const o=i[r].getInternalTexture();o?(this._textureUnits[r]=e+r,o._associatedChannel=e+r):this._textureUnits[r]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let r=0;r<i.length;r++)this._setTexture(this._textureUnits[r],i[r],!0)}}_setAnisotropicLevel(e,t,i){const s=this._caps.textureAnisotropicFilterExtension;t.samplingMode!==11&&t.samplingMode!==3&&t.samplingMode!==2&&(i=1),s&&t._cachedAnisotropicFilteringLevel!==i&&(this._setTextureParameterFloat(e,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(i,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=i)}_setTextureParameterFloat(e,t,i,s){this._bindTextureDirectly(e,s,!0,!0),this._gl.texParameterf(e,t,i)}_setTextureParameterInteger(e,t,i,s){s&&this._bindTextureDirectly(e,s,!0,!0),this._gl.texParameteri(e,t,i)}unbindAllAttributes(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e);return}for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)e>=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}releaseEffects(){this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){Bi()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),Qf(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){const t=this._gl;for(;t.getError()!==t.NO_ERROR;);let i=!0;const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);const o=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i=i&&o===t.FRAMEBUFFER_COMPLETE,i=i&&t.getError()===t.NO_ERROR,i&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){t.bindFramebuffer(t.FRAMEBUFFER,null);const c=t.RGBA,h=t.UNSIGNED_BYTE,f=new Uint8Array(4);t.readPixels(0,0,1,1,c,h,f),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(s),t.deleteFramebuffer(r),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i}_getWebGLTextureType(e){if(this._webGLVersion===1){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:return this._gl.UNSIGNED_BYTE;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:return this._gl.UNSIGNED_BYTE;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:i=this._gl.ALPHA;break;case 1:i=this._gl.LUMINANCE;break;case 2:i=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:i=this._gl.RED;break;case 7:case 33324:case 36761:i=this._gl.RG;break;case 4:case 32852:case 36762:i=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;break}if(this._webGLVersion>1)switch(e){case 8:i=this._gl.RED_INTEGER;break;case 9:i=this._gl.RG_INTEGER;break;case 10:i=this._gl.RGB_INTEGER;break;case 11:i=this._gl.RGBA_INTEGER;break}return i}_getRGBABufferInternalSizedFormat(e,t,i=!1){if(this._webGLVersion===1){if(t!==void 0)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return i?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return i?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;case 11:return this._gl.RGBA16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;case 11:return this._gl.RGBA16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;case 11:return this._gl.RGBA32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;case 11:return this._gl.RGBA32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;case 5:return this._gl.RGBA32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;case 5:return this._gl.RGBA16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,i,s,r=!0,o=!0,c=null){const h=r?4:3,f=r?this._gl.RGBA:this._gl.RGB,_=i*s*h;if(!c)c=new Uint8Array(_);else if(c.length<_)return me.Error(`Data buffer is too small to store the read pixels (${c.length} should be more than ${_})`),Promise.resolve(c);return o&&this.flushFramebuffer(),this._gl.readPixels(e,t,i,s,f,this._gl.UNSIGNED_BYTE,c),Promise.resolve(c)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(this._HasMajorPerformanceCaveat!==null)return!this._HasMajorPerformanceCaveat;if(this._IsSupported===null)try{const e=Ve._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=t!=null&&!!globalThis.WebGLRenderingContext}catch{this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(this._HasMajorPerformanceCaveat===null)try{const e=Ve._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch{this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}st._TempClearColorUint32=new Uint32Array(4);st._TempClearColorInt32=new Int32Array(4);st.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}];st._ConcatenateShader=kv;st._IsSupported=null;st._HasMajorPerformanceCaveat=null;class fD{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new dD(e)}sampleFrame(e=Vn.Now){if(this._enabled){if(this._lastFrameTimeMs!=null){const t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){const e=this._rollingFrameTime.history(0);return e===0?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class dD{constructor(e){this._samples=new Array(e),this.reset()}add(e){let t;if(this.isSaturated()){const i=this._samples[this._pos];t=i-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(i-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;const t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){const t=this._samples.length;return(e%t+t)%t}}function _D(a){!a||!a.setAttribute||(a.setAttribute("touch-action","none"),a.style.touchAction="none",a.style.webkitTapHighlightColor="transparent")}function mD(a,e,t){a._onCanvasFocus=()=>{a.onCanvasFocusObservable.notifyObservers(a)},a._onCanvasBlur=()=>{a.onCanvasBlurObservable.notifyObservers(a)},a._onCanvasContextMenu=s=>{a.disableContextMenu&&s.preventDefault()}
151,e.addEventListener("focus",a._onCanvasFocus),e.addEventListener("blur",a._onCanvasBlur),e.addEventListener("contextmenu",a._onCanvasContextMenu),a._onBlur=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.disable(),a._windowIsBackground=!0},a._onFocus=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.enable(),a._windowIsBackground=!1},a._onCanvasPointerOut=s=>{document.elementFromPoint(s.clientX,s.clientY)!==e&&a.onCanvasPointerOutObservable.notifyObservers(s)};const i=a.getHostWindow();i&&typeof i.addEventListener=="function"&&(i.addEventListener("blur",a._onBlur),i.addEventListener("focus",a._onFocus)),e.addEventListener("pointerout",a._onCanvasPointerOut),t.doNotHandleTouchAction||_D(e),!Ve.audioEngine&&t.audioEngine&&Ve.AudioEngineFactory&&(Ve.audioEngine=Ve.AudioEngineFactory(a.getRenderingCanvas(),a.getAudioContext(),a.getAudioDestination())),Qr()&&(a._onFullscreenChange=()=>{a.isFullscreen=!!document.fullscreenElement,a.isFullscreen&&a._pointerLockRequested&&e&&Qv(e)},document.addEventListener("fullscreenchange",a._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",a._onFullscreenChange,!1),a._onPointerLockChange=()=>{a.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",a._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",a._onPointerLockChange,!1)),a.enableOfflineSupport=Ve.OfflineProviderFactory!==void 0,a._deterministicLockstep=!!t.deterministicLockstep,a._lockstepMaxSteps=t.lockstepMaxSteps||0,a._timeStep=t.timeStep||1/60}function gD(a,e){ft.Instances.length===1&&Ve.audioEngine&&(Ve.audioEngine.dispose(),Ve.audioEngine=null);const t=a.getHostWindow();t&&typeof t.removeEventListener=="function"&&(t.removeEventListener("blur",a._onBlur),t.removeEventListener("focus",a._onFocus)),e&&(e.removeEventListener("focus",a._onCanvasFocus),e.removeEventListener("blur",a._onCanvasBlur),e.removeEventListener("pointerout",a._onCanvasPointerOut),e.removeEventListener("contextmenu",a._onCanvasContextMenu)),Qr()&&(document.removeEventListener("fullscreenchange",a._onFullscreenChange),document.removeEventListener("mozfullscreenchange",a._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",a._onFullscreenChange),document.removeEventListener("msfullscreenchange",a._onFullscreenChange),document.removeEventListener("pointerlockchange",a._onPointerLockChange),document.removeEventListener("mspointerlockchange",a._onPointerLockChange),document.removeEventListener("mozpointerlockchange",a._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",a._onPointerLockChange))}function pD(a){const e=yD(a);if(e)return e;const t=bD(a);return t||xD(a)}function yD(a){if(!Qr()||!document.body)return null;const e=document.createElement("span");e.textContent="Hg",e.style.font=a;const t=document.createElement("div");t.style.display="inline-block",t.style.width="1px",t.style.height="0px",t.style.verticalAlign="bottom";const i=document.createElement("div");i.style.whiteSpace="nowrap",i.appendChild(e),i.appendChild(t),document.body.appendChild(i);let s,r;try{r=t.getBoundingClientRect().top-e.getBoundingClientRect().top,t.style.verticalAlign="baseline",s=t.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(i)}const o={ascent:s,height:r,descent:r-s};return Zv(o)?o:null}function bD(a){let e=null;try{typeof OffscreenCanvas<"u"?e=new OffscreenCanvas(64,64):Qr()&&typeof document.createElement=="function"&&(e=document.createElement("canvas"),e.width=64,e.height=64);const t=e?.getContext("2d");if(!t)return null;t.font=a;const i=t.measureText("Hg"),s=Number(i.actualBoundingBoxAscent??i.fontBoundingBoxAscent),r=Number(i.actualBoundingBoxDescent??i.fontBoundingBoxDescent),o={ascent:s,height:s+r,descent:r};return Zv(o)?o:null}catch{return null}finally{const t=e;typeof t?.dispose=="function"&&t.dispose()}}function xD(a){const e=Math.max(1,vD(a)),t=e*.8,i=e*.2;return{ascent:t,height:t+i,descent:i}}function vD(a){const e=/(?:^|\s)([0-9]+(?:\.[0-9]+)?)px(?:\/|\s|$)/.exec(String(a||""));return e?Number(e[1]):16}function Zv(a){return Number.isFinite(a.ascent)&&Number.isFinite(a.height)&&Number.isFinite(a.descent)&&a.height>0}async function TD(a,e,t){return await new Promise((i,s)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{a.createImageBitmap(r,t).then(o=>{i(o)})})},r.onerror=()=>{s(`Error loading image ${r.src}`)},r.src=e})}function RD(a,e,t,i){const r=a.createCanvas(t,i).getContext("2d");if(!r)throw new Error("Unable to get 2d context for resizeImageBitmap");return r.drawImage(e,0,0),r.getImageData(0,0,t,i).data}function AD(a){const e=a.requestFullscreen||a.webkitRequestFullscreen;e&&e.call(a)}function MD(){const a=document;document.exitFullscreen?document.exitFullscreen():a.webkitCancelFullScreen&&a.webkitCancelFullScreen()}function Qv(a){if(a.requestPointerLock){const e=a.requestPointerLock();e instanceof Promise?e.then(()=>{a.focus()}).catch(()=>{}):a.focus()}}function SD(){document.exitPointerLock&&document.exitPointerLock()}class Xs{get min(){return this._min}get max(){return this._max}get average(){return this._average}get lastSecAverage(){return this._lastSecAverage}get current(){return this._current}get total(){return this._totalAccumulated}get count(){return this._totalValueCount}constructor(){this._startMonitoringTime=0,this._min=0,this._max=0,this._hasResult=!1,this._hasCurrentValue=!1,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}fetchNewFrame(){this._totalValueCount++,this._current=0,this._hasCurrentValue=Xs.Enabled,this._lastSecValueCount++}
151addCount(e,t){Xs.Enabled&&(this._current+=e,this._hasCurrentValue=!0,t&&this._fetchResult())}beginMonitoring(){Xs.Enabled&&(this._startMonitoringTime=Vn.Now)}endMonitoring(e=!0){if(!Xs.Enabled)return;e&&this.fetchNewFrame();const t=Vn.Now;this._current=t-this._startMonitoringTime,this._hasCurrentValue=!0,e&&this._fetchResult()}endFrame(){this._fetchResult()}_fetchResult(){if(!this._hasCurrentValue)return;this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._hasResult?(this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current)):(this._min=this._current,this._max=this._current,this._hasResult=!0),this._average=this._totalAccumulated/this._totalValueCount;const e=Vn.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}Xs.Enabled=!0;let Hy=!1;function $v(){Hy||(Hy=!0,Ve.prototype.getInputElement=function(){return this._renderingCanvas},Ve.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},Ve.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},Ve.prototype.getAspectRatio=function(a,e=!1){const t=a.viewport;return this.getRenderWidth(e)*t.width/(this.getRenderHeight(e)*t.height)},Ve.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},Ve.prototype._verifyPointerLock=function(){this._onPointerLockChange?.()})}let Wy=!1;function Qd(){Wy||(Wy=!0,Ve.prototype.getRenderPassNames=function(){return this._renderPassNames},Ve.prototype.getCurrentRenderPassName=function(){return this._renderPassNames[this.currentRenderPassId]},Ve.prototype.createRenderPassId=function(a){const e=++Ve._RenderPassIdCounter;return this._renderPassNames[e]=a??"NONAME",e},Ve.prototype.releaseRenderPassId=function(a){this._renderPassNames[a]=void 0;for(let e=0;e<this.scenes.length;++e){const t=this.scenes[e];for(let i=0;i<t.meshes.length;++i){const s=t.meshes[i];if(s._releaseRenderPassId(a),s.subMeshes)for(let r=0;r<s.subMeshes.length;++r)s.subMeshes[r]._removeDrawWrapper(a)}}})}class De extends st{static get NpmPackage(){return Ve.NpmPackage}static get Version(){return Ve.Version}static get Instances(){return ft.Instances}static get LastCreatedEngine(){return ft.LastCreatedEngine}static get LastCreatedScene(){return ft.LastCreatedScene}static DefaultLoadingScreenFactory(e){return Ve.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!De._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,i,s=!1){$v(),Qd(),super(e,t,i,s),this._performanceMonitor=new fD,this._drawCalls=new Xs,e&&(this._features.supportRenderPasses=!0)}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){super._sharedInit(e),mD(this,e,this._creationOptions)}resizeImageBitmap(e,t,i){return RD(this,e,t,i)}async _createImageBitmapFromSource(e,t){return await TD(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&AD(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&MD()}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,i,s){const r=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,s),r}scissorClear(e,t,i,s,r){this.enableScissor(e,t,i,s),this.clear(r,!0,!0,!0),this.disableScissor()}getVertexShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(const e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(const e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){return pD(e)}enterPointerlock(){this._renderingCanvas&&Qv(this._renderingCanvas)}exitPointerlock(){SD()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){const t=e;t&&t.program&&t.transformFeedback&&(this.deleteTransformFeedback(t.transformFeedback),t.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,i,s,r,o=null){r=r||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);const c=super.createShaderProgram(e,t,i,s,r,o);return this.onAfterShaderCompilationObservable.notifyObservers(this),c}_createShaderProgram(e,t,i,s,r=null){const o=s.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");if(s.attachShader(o,t),s.attachShader(o,i),this.webGLVersion>1&&r){const c=this.createTransformFeedback();this.bindTransformFeedback(c),this.setTranformFeedbackVaryings(o,r),e.transformFeedback=c}return s.linkProgram(o),this.webGLVersion>1&&r&&this.bindTransformFeedback(null),e.context=s,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),o}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){super._releaseRenderTargetWrapper(e);for(const t of this.scenes){for(const i of t.postProcesses)i._outputTexture===e&&(i._outputTexture=null);for(const i of t.cameras)for(const s of i._postProcesses)s&&s._outputTexture===e&&(s._outputTexture=null)}}_rescaleTexture(e,t,i,s,r){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);const o=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&De._RescalePostProcessFactory&&(this._rescalePostProcess=De._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;const c=()=>{this._rescalePostProcess.onApply=function(_){_._bindTexture("textureSampler",e)};let f=i;f||(f=this.scenes[this.scenes.length-1]),f.postProcessManager.directRender([this._rescalePostProcess],o,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,s,0,0,t.width,t.height,0),this.unBindFramebuffer(o
vendor: 6,475 bytes, line 151
151),o.dispose(),r&&r()},h=this._rescalePostProcess.getEffect();h?h.executeWhenCompiled(c):this._rescalePostProcess.onEffectCreatedObservable.addOnce(f=>{f.executeWhenCompiled(c)})}}wrapWebGLTexture(e,t=!1,i=3,s=0,r=0){const o=new Ad(e,this._gl),c=new is(this,15,!0);return c._hardwareTexture=o,c.baseWidth=s,c.baseHeight=r,c.width=s,c.height=r,c.isReady=!0,c.useMipMaps=t,this.updateTextureSamplingMode(i,c),c}updateWrappedWebGLTexture(e,t){if(e.source!==15)throw new Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");for(const s of this._renderTargetWrapperCache)if(s.textures?.includes(e)){if(s.isMulti)throw new Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");if(s._depthStencilTexture)throw new Error("updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.")}e._hardwareTexture=new Ad(t,this._gl),e.isReady=!0,e._cachedCoordinatesMode=null,e._cachedWrapU=null,e._cachedWrapV=null,e._cachedWrapR=null,e._cachedAnisotropicFilteringLevel=null;for(const s in this._boundTexturesCache)this._boundTexturesCache[s]===e&&(this._boundTexturesCache[s]=null);this.updateTextureSamplingMode(e.samplingMode,e);const i=this._gl;for(const s of this._renderTargetWrapperCache){if(s.texture!==e)continue;const r=s,o=s.samples,c=o>1;r._framebuffer&&i.deleteFramebuffer(r._framebuffer),!c&&r._depthStencilBuffer&&(i.deleteRenderbuffer(r._depthStencilBuffer),r._depthStencilBuffer=null);const h=this._currentFramebuffer,f=i.createFramebuffer();this._bindUnboundFramebuffer(f),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),c||(r._depthStencilBuffer=this._setupFramebufferDepthAttachments(s._generateStencilBuffer,s._generateDepthBuffer,s.width,s.height)),this._bindUnboundFramebuffer(h),r._framebuffer=f,c&&(s._samples=1,this.updateRenderTargetTextureSampleCount(r,o))}}_uploadImageToTexture(e,t,i=0,s=0){const r=this._gl,o=this._getWebGLTextureType(e.type),c=this._getInternalFormat(e.format),h=this._getRGBABufferInternalSizedFormat(e.type,c),f=e.isCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D;this._bindTextureDirectly(f,e,!0),this._unpackFlipY(e.invertY);let _=r.TEXTURE_2D;e.isCube&&(_=r.TEXTURE_CUBE_MAP_POSITIVE_X+i),r.texImage2D(_,s,h,c,o,t),this._bindTextureDirectly(f,null,!0)}updateTextureComparisonFunction(e,t){if(this.webGLVersion===1){me.Error("WebGL 1 does not support texture comparison.");return}const i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),t===0?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),t===0?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");const i=new ol(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i.references=1,i}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,i=10){const s=this._gl;return await new Promise((r,o)=>{Zd(()=>{const c=s.clientWaitSync(e,t,0);if(c==s.WAIT_FAILED)throw new Error("clientWaitSync failed");return c!=s.TIMEOUT_EXPIRED},r,o,i)})}_readPixelsAsync(e,t,i,s,r,o,c){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");const h=this._gl,f=h.createBuffer();h.bindBuffer(h.PIXEL_PACK_BUFFER,f),h.bufferData(h.PIXEL_PACK_BUFFER,c.byteLength,h.STREAM_READ),h.readPixels(e,t,i,s,r,o,0),h.bindBuffer(h.PIXEL_PACK_BUFFER,null);const _=h.fenceSync(h.SYNC_GPU_COMMANDS_COMPLETE,0);return _?(h.flush(),this._clientWaitAsync(_,0,10).then(()=>(h.deleteSync(_),h.bindBuffer(h.PIXEL_PACK_BUFFER,f),h.getBufferSubData(h.PIXEL_PACK_BUFFER,0,c),h.bindBuffer(h.PIXEL_PACK_BUFFER,null),h.deleteBuffer(f),c))):null}dispose(){this.hideLoadingUI?.(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),gD(this,this._renderingCanvas),super.dispose()}}De.ALPHA_DISABLE=0;De.ALPHA_ADD=1;De.ALPHA_COMBINE=2;De.ALPHA_SUBTRACT=3;De.ALPHA_MULTIPLY=4;De.ALPHA_MAXIMIZED=5;De.ALPHA_ONEONE=6;De.ALPHA_PREMULTIPLIED=7;De.ALPHA_PREMULTIPLIED_PORTERDUFF=8;De.ALPHA_INTERPOLATE=9;De.ALPHA_SCREENMODE=10;De.DELAYLOADSTATE_NONE=0;De.DELAYLOADSTATE_LOADED=1;De.DELAYLOADSTATE_LOADING=2;De.DELAYLOADSTATE_NOTLOADED=4;De.NEVER=512;De.ALWAYS=519;De.LESS=513;De.EQUAL=514;De.LEQUAL=515;De.GREATER=516;De.GEQUAL=518;De.NOTEQUAL=517;De.KEEP=7680;De.REPLACE=7681;De.INCR=7682;De.DECR=7683;De.INVERT=5386;De.INCR_WRAP=34055;De.DECR_WRAP=34056;De.TEXTURE_CLAMP_ADDRESSMODE=0;De.TEXTURE_WRAP_ADDRESSMODE=1;De.TEXTURE_MIRROR_ADDRESSMODE=2;De.TEXTUREFORMAT_ALPHA=0;De.TEXTUREFORMAT_LUMINANCE=1;De.TEXTUREFORMAT_LUMINANCE_ALPHA=2;De.TEXTUREFORMAT_RGB=4;De.TEXTUREFORMAT_RGBA=5;De.TEXTUREFORMAT_RED=6;De.TEXTUREFORMAT_R=6;De.TEXTUREFORMAT_R16_UNORM=33322;De.TEXTUREFORMAT_RG16_UNORM=33324;De.TEXTUREFORMAT_RGB16_UNORM=32852;De.TEXTUREFORMAT_RGBA16_UNORM=32859;De.TEXTUREFORMAT_R16_SNORM=36760;De.TEXTUREFORMAT_RG16_SNORM=36761;De.TEXTUREFORMAT_RGB16_SNORM=36762;De.TEXTUREFORMAT_RGBA16_SNORM=36763;De.TEXTUREFORMAT_RG=7;De.TEXTUREFORMAT_RED_INTEGER=8;De.TEXTUREFORMAT_R_INTEGER=8;De.TEXTUREFORMAT_RG_INTEGER=9;De.TEXTUREFORMAT_RGB_INTEGER=10;De.TEXTUREFORMAT_RGBA_INTEGER=11;De.TEXTURETYPE_UNSIGNED_BYTE=0;De.TEXTURETYPE_UNSIGNED_INT=0;De.TEXTURETYPE_FLOAT=1;De.TEXTURETYPE_HALF_FLOAT=2;De.TEXTURETYPE_BYTE=3;De.TEXTURETYPE_SHORT=4;De.TEXTURETYPE_UNSIGNED_SHORT=5;De.TEXTURETYPE_INT=6;De.TEXTURETYPE_UNSIGNED_INTEGER=7;De.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8;De.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9;De.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10;De.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11;De.TEXTURETYPE_UNSIGNED_INT_24_8=12;De.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13;De.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14;De.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15;
151De.TEXTURE_NEAREST_SAMPLINGMODE=1;De.TEXTURE_BILINEAR_SAMPLINGMODE=2;De.TEXTURE_TRILINEAR_SAMPLINGMODE=3;De.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8;De.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11;De.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3;De.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4;De.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5;De.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6;De.TEXTURE_NEAREST_LINEAR=7;De.TEXTURE_NEAREST_NEAREST=1;De.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9;De.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10;De.TEXTURE_LINEAR_LINEAR=2;De.TEXTURE_LINEAR_NEAREST=12;De.TEXTURE_EXPLICIT_MODE=0;De.TEXTURE_SPHERICAL_MODE=1;De.TEXTURE_PLANAR_MODE=2;De.TEXTURE_CUBIC_MODE=3;De.TEXTURE_PROJECTION_MODE=4;De.TEXTURE_SKYBOX_MODE=5;De.TEXTURE_INVCUBIC_MODE=6;De.TEXTURE_EQUIRECTANGULAR_MODE=7;De.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8;De.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;De.SCALEMODE_FLOOR=1;De.SCALEMODE_NEAREST=2;De.SCALEMODE_CEILING=3;let Xy=!1;function ED(){Xy||(Xy=!0,st.prototype.setAlphaMode=function(a,e=!1,t=0){if(this._alphaMode[t]===a){if(!e){const s=a===0;this.depthCullingState.depthMask!==s&&(this.depthCullingState.depthMask=s)}return}const i=a===0;this._alphaState.setAlphaBlend(!i,t),this._alphaState.setAlphaMode(a,t),e||(this.depthCullingState.depthMask=i),this._alphaMode[t]=a})}ED();let qy=!1;function CD(){if(qy)return;qy=!0;const a=new WeakMap,e=new WeakMap,t=new WeakMap,i=new WeakMap;st.prototype.getAlphaToCoverage=function(){return a.get(this)??!1},st.prototype.setAlphaToCoverage=function(s){a.get(this)===s&&(!this._gl||e.get(this)===this._gl)||(a.set(this,s),this._gl&&(s?this._gl.enable(this._gl.SAMPLE_ALPHA_TO_COVERAGE):this._gl.disable(this._gl.SAMPLE_ALPHA_TO_COVERAGE),e.set(this,this._gl)))},Object.defineProperty(st.prototype,"currentSampleCount",{get:function(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._gl?(i.get(this)!==this._gl&&(t.set(this,this._gl.getContextAttributes()?.antialias?Math.max(1,this._gl.getParameter(this._gl.SAMPLES)):1),i.set(this,this._gl)),t.get(this)):1},enumerable:!1,configurable:!0})}CD();let jy=!1;function DD(){if(jy)return;jy=!0;function a(i,s,r,o){let c,h=1;o===1?c=new Float32Array(s*r*4):o===2?(c=new Uint16Array(s*r*4),h=15360):o===7?c=new Uint32Array(s*r*4):c=new Uint8Array(s*r*4);for(let f=0;f<s;f++)for(let _=0;_<r;_++){const d=(_*s+f)*3,g=(_*s+f)*4;c[g+0]=i[d+0],c[g+1]=i[d+1],c[g+2]=i[d+2],c[g+3]=h}return c}function e(i){return function(s,r,o,c,h,f,_,d,g=null,p=0){const x=i?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,b=i?10:11,T=new is(this,b);T.baseWidth=r,T.baseHeight=o,T.baseDepth=c,T.width=r,T.height=o,T.depth=c,T.format=h,T.type=p,T.generateMipMaps=f,T.samplingMode=d,i?T.is3D=!0:T.is2DArray=!0,this._doNotHandleContextLost||(T._bufferView=s),i?this.updateRawTexture3D(T,s,h,_,g,p):this.updateRawTexture2DArray(T,s,h,_,g,p),this._bindTextureDirectly(x,T,!0);const R=this._getSamplingParameters(d,f);return this._gl.texParameteri(x,this._gl.TEXTURE_MAG_FILTER,R.mag),this._gl.texParameteri(x,this._gl.TEXTURE_MIN_FILTER,R.min),f&&this._gl.generateMipmap(x),this._bindTextureDirectly(x,null),this._internalTexturesCache.push(T),T}}function t(i){return function(s,r,o,c,h=null,f=0){const _=i?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,d=this._getWebGLTextureType(f),g=this._getInternalFormat(o),p=this._getRGBABufferInternalSizedFormat(f,o);this._bindTextureDirectly(_,s,!0),this._unpackFlipY(c===void 0?!0:!!c),this._doNotHandleContextLost||(s._bufferView=r,s.format=o,s.invertY=c,s._compression=h),s.width%4!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),h&&r?this._gl.compressedTexImage3D(_,0,this.getCaps().s3tc[h],s.width,s.height,s.depth,0,r):this._gl.texImage3D(_,0,p,s.width,s.height,s.depth,0,g,d,r),s.generateMipMaps&&this._gl.generateMipmap(_),this._bindTextureDirectly(_,null),s.isReady=!0}}st.prototype.updateRawTexture=function(i,s,r,o,c=null,h=0,f=!1){if(!i)return;const _=this._getRGBABufferInternalSizedFormat(h,r,f),d=this._getInternalFormat(r),g=this._getWebGLTextureType(h);this._bindTextureDirectly(this._gl.TEXTURE_2D,i,!0),this._unpackFlipY(o===void 0?!0:!!o),this._doNotHandleContextLost||(i._bufferView=s,i.format=r,i.type=h,i.invertY=o,i._compression=c),i.width%4
vendor: 26,996 bytes, line 151
151!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),c&&s?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[c],i.width,i.height,0,s):this._gl.texImage2D(this._gl.TEXTURE_2D,0,_,i.width,i.height,0,d,g,s),i.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),i.isReady=!0},st.prototype.createRawTexture=function(i,s,r,o,c,h,f,_=null,d=0,g=0,p=!1){const x=new is(this,3);x.baseWidth=s,x.baseHeight=r,x.width=s,x.height=r,x.format=o,x.generateMipMaps=c,x.samplingMode=f,x.invertY=h,x._compression=_,x.type=d,x._useSRGBBuffer=this._getUseSRGBBuffer(p,!c),this._doNotHandleContextLost||(x._bufferView=i),this.updateRawTexture(x,i,o,h,_,d,x._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,x,!0);const b=this._getSamplingParameters(f,c);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,b.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,b.min),c&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(x),x},st.prototype.createRawCubeTexture=function(i,s,r,o,c,h,f,_=null){const d=this._gl,g=new is(this,8);g.isCube=!0,g.format=r,g.type=o,this._doNotHandleContextLost||(g._bufferViewArray=i);const p=this._getWebGLTextureType(o);let x=this._getInternalFormat(r);x===d.RGB&&(x=d.RGBA),p===d.FLOAT&&!this._caps.textureFloatLinearFiltering?(c=!1,f=1,me.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):p===this._gl.HALF_FLOAT_OES&&!this._caps.textureHalfFloatLinearFiltering?(c=!1,f=1,me.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):p===d.FLOAT&&!this._caps.textureFloatRender?(c=!1,me.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):p===d.HALF_FLOAT&&!this._caps.colorBufferFloat&&(c=!1,me.Warn("Render to half float textures is not supported. Mipmap generation forced to false."));const b=s,T=b;if(g.width=b,g.height=T,g.invertY=h,g._compression=_,!this.needPOTTextures||Vc(g.width)&&Vc(g.height)||(c=!1),i)this.updateRawCubeTexture(g,i,r,o,h,_);else{const M=this._getRGBABufferInternalSizedFormat(o),I=0;this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,g,!0);for(let A=0;A<6;A++)_?d.compressedTexImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+A,I,this.getCaps().s3tc[_],g.width,g.height,0,void 0):d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+A,I,M,g.width,g.height,0,x,p,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,g,!0),i&&c&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);const S=this._getSamplingParameters(f,c);return d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MAG_FILTER,S.mag),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MIN_FILTER,S.min),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,null),g.generateMipMaps=c,g.samplingMode=f,g.isReady=!0,g},st.prototype.updateRawCubeTexture=function(i,s,r,o,c,h=null,f=0){i._bufferViewArray=s,i.format=r,i.type=o,i.invertY=c,i._compression=h;const _=this._gl,d=this._getWebGLTextureType(o);let g=this._getInternalFormat(r);const p=this._getRGBABufferInternalSizedFormat(o);let x=!1;g===_.RGB&&(g=_.RGBA,x=!0),this._bindTextureDirectly(_.TEXTURE_CUBE_MAP,i,!0),this._unpackFlipY(c===void 0?!0:!!c),i.width%4!==0&&_.pixelStorei(_.UNPACK_ALIGNMENT,1);for(let T=0;T<6;T++){let R=s[T];h?_.compressedTexImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+T,f,this.getCaps().s3tc[h],i.width,i.height,0,R):(x&&(R=a(R,i.width,i.height,o)),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+T,f,p,i.width,i.height,0,g,d,R))}(!this.needPOTTextures||Vc(i.width)&&Vc(i.height))&&i.generateMipMaps&&f===0&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),i.isReady=!0},st.prototype.createRawCubeTextureFromUrl=function(i,s,r,o,c,h,f,_,d=null,g=null,p=3,x=!1){const b=this._gl,T=this.createRawCubeTexture(null,r,o,c,!h,x,p,null);s?.addPendingData(T),T.url=i,T.isReady=!1,this._internalTexturesCache.push(T);const R=(M,I)=>{s?.removePendingData(T),g&&g(M?M.status+" "+M.statusText:"Failed to parse texture data",I)},S=async M=>{if(!T._hardwareTexture)return;const I=f(M);if(!I)return;const A=I instanceof Promise?await I:I,D=T.width;if(_){const C=this._getWebGLTextureType(c);let k=this._getInternalFormat(o);const H=this._getRGBABufferInternalSizedFormat(c);let L=!1;k===b.RGB&&(k=b.RGBA,L=!0),this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,T,!0),this._unpackFlipY(!1);const J=_(A);for(let te=0;te<J.length;te++){const ae=D>>te;for(let B=0;B<6;B++){let $=J[te][B];L&&($=a($,ae,ae,c)),b.texImage2D(B,te,H,ae,ae,0,k,C,$)}}this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(T,A,o,c,x);T.isReady=!0,s?.removePendingData(T),T.onLoadedObservable.notifyObservers(T),T.onLoadedObservable.clear(),d&&d()};return this._loadFile(i,M=>{S(M).catch(I=>{R(void 0,I)})},void 0,s?.offlineProvider,!0,R),T},st.prototype.createRawTexture2DArray=e(!1),st.prototype.createRawTexture3D=e(!0),st.prototype.updateRawTexture2DArray=t(!1),st.prototype.updateRawTexture3D=t(!0)}DD();let Yy=!1;function ID(){Yy||(Yy=!0,st.prototype._readTexturePixelsSync=function(a,e,t,i=-1,s=0,r=null,o=!0,c=!1,h=0,f=0){const _=this._gl;if(!_)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){const g=_.createFramebuffer();if(!g)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=g}_.bindFramebuffer(_.FRAMEBUFFER,this._dummyFramebuffer),i>-1&&(a.is2DArray||a.is3D)?_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,a._hardwareTexture?.underlyingResource,s,i):i>-1?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+i,a._hardwareTexture?.underlyingResource,s):_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,a._hardwareTexture?.underlyingResource,s);let d=a.type!==void 0?this._getWebGLTextureType(a.type):_.UNSIGNED_BYTE;if(c)r||(r=IC(a.type,4*e*t));else switch(d){case _.UNSIGNED_BYTE:r||(r=new Uint8Array(4*e*t)),d=_.UNSIGNED_BYTE;break;default:r||(r=new Float32Array(4*e*t)),d=_.FLOAT;break}return o&&this.flushFramebuffer(),_.readPixels(h,f,e,t,_.RGBA,d,r),_.bindFramebuffer(_.FRAMEBUFFER,this._currentFramebuffer),r},st.prototype._readTexturePixels=function(a,e,t,i=-1,s=0,r=null,o=!0,c=!1,h=0,f=0){return Promise.resolve(this._readTexturePixelsSync(a,e,t,i,s,r,o,c,h,f))})}ID();let Ky=!1;function Jv(){Ky||(Ky=!0,st.prototype.updateDynamicIndexBuffer=function(a,e,t=0){this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(a);let i;a.is32Bits?i=e instanceof Uint32Array?e:new Uint32Array(e):i=e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},st.prototype.updateDynamicVertexBuffer=function(a,e,t,i){this.bindArrayBuffer(a),t===void 0&&(t=0);const s=e.byteLength||e.length;i===void 0||i>=s&&t===0?e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e):e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e).subarray(0,i/4)):(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,i):e=new Uint8Array(e,0,i),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e)),this._resetVertexBufferBinding()})}Jv();let Zy=!1;function wD(){Zy||(Zy=!0,st.prototype._createDepthStencilCubeTexture=function(a,e){const t=new is(this,12);if(t.isCube=!0,this.webGLVersion===1)return me.Error("Depth cube texture is not supported by WebGL 1."),t;const i={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e},s=this._gl;this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,t,!0),this._setupDepthStencilTexture(t,a,i.bilinearFiltering,i.comparisonFunction);for(let r=0;r<6;r++)i.generateStencil?s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,s.DEPTH24_STENCIL8,a,a,0,s.DEPTH_STENCIL,s.UNSIGNED_INT_24_8,null):s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,s.DEPTH_COMPONENT24,a,a,0,s.DEPTH_COMPONENT,s.UNSIGNED_INT,null);return this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(t),t},st.prototype._setCubeMapTextureParams=function(a,e,t){const i=this._gl;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,e?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),a.samplingMode=e?3:2,e&&this.getCaps().textureMaxLevel&&t!==void 0&&t>0&&(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_LEVEL,t),a._maxLodLevel=t),this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)},st.prototype.createCubeTexture=function(a,e,t,i,s=null,r=null,o,c=null,h=!1,f=0,_=0,d=null,g,p=!1,x=null){const b=this._gl;return this.createCubeTextureBase(a,e,t,!!i,s,r,o,c,h,f,_,d,T=>this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,T,!0),(T,R)=>{const S=this.needPOTTextures?Rd(R[0].width,this._caps.maxCubemapTextureSize):R[0].width,M=S,I=[b.TEXTURE_CUBE_MAP_POSITIVE_X,b.TEXTURE_CUBE_MAP_POSITIVE_Y,b.TEXTURE_CUBE_MAP_POSITIVE_Z,b.TEXTURE_CUBE_MAP_NEGATIVE_X,b.TEXTURE_CUBE_MAP_NEGATIVE_Y,b.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,T,!0),this._unpackFlipY(!1);const A=o?this._getInternalFormat(o,T._useSRGBBuffer):T._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:b.RGBA;let D=o?this._getInternalFormat(o):b.RGBA;T._useSRGBBuffer&&this.webGLVersion===1&&(D=A);for(let C=0;C<I.length;C++)if(R[C].width!==S||R[C].height!==M){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext){me.Warn("Cannot create canvas to resize texture.");return}this._workingCanvas.width=S,this._workingCanvas.height=M,this._workingContext.drawImage(R[C],0,0,R[C].width,R[C].height,0,0,S,M),b.texImage2D(I[C],0,A,D,b.UNSIGNED_BYTE,this._workingCanvas)}else b.texImage2D(I[C],0,A,D,b.UNSIGNED_BYTE,R[C]);i||b.generateMipmap(b.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(T,!i),T.width=S,T.height=M,T.isReady=!0,o&&(T.format=o),T.onLoadedObservable.notifyObservers(T),T.onLoadedObservable.clear(),s&&s()},!!p,x)},st.prototype.generateMipMapsForCubemap=function(a,e=!0){if(a.generateMipMaps){const t=this._gl;this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,a,!0),t.generateMipmap(t.TEXTURE_CUBE_MAP),e&&this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,null)}})}wD();class PD{get depthStencilTexture(){return this._depthStencilTexture}setDepthStencilTexture(e,t=!0){t&&this._depthStencilTexture&&this._depthStencilTexture.dispose(),this._depthStencilTexture=e,this._generateDepthBuffer=this._generateStencilBuffer=this._depthStencilTextureWithStencil=!1,e&&(this._generateDepthBuffer=!0,this._generateStencilBuffer=this._depthStencilTextureWithStencil=ll(e.format))}get depthStencilTextureWithStencil(){return this._depthStencilTextureWithStencil}get isCube(){return this._isCube}get isMulti(){return this._isMulti}get is2DArray(){return this.layers>0}get is3D(){return this.depth>0}get size(){return this.width}get width(){return this._size.width??this._size}get height(){return this._size.height??this._size}get layers(){return this._size.layers||0}get depth(){return this._size.depth||0}get texture(){return this._textures?.[0]??null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}getBaseArrayLayer(e){if(!this._textures)return-1;const t=this._textures[e],i=this._layerIndices?.[e]??0,s=this._faceIndices?.[e]??0;return t.isCube?i*6+s:t.is3D?0:i}get samples(){return this._samples}setSamples(e,t=!0,i=!1){if(this.samples===e&&!i)return e;const s=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,s}resolveMSAATextures(){this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){this._engine._currentRenderTarget===this&&(this.isMulti?this._engine.unBindMultiColorAttachmentFramebuffer(this,!0):this._engine.unBindFramebuffer(this,!0)),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,i,s,r){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._isMulti=e,this._isCube=t,this._size=i,this._engine=s,this._depthStencilTexture=null,this.label=r}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,i=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&i&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,i){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),t!==void 0&&t>=0&&(this._layerIndices[e]=t),i!==void 0&&i>=0&&(this._faceIndices[e]=i)}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,r=14,o){return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTextureLabel=o,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this._isCube,samples:s,depthTextureFormat:r,label:o},this),this._depthStencilTexture}_shareDepth(e){this.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){let e=null;if(this._isMulti){const t=this.textures;if(t&&t.length>0){let i=!1,s=t.length,r=-1;const o=t[t.length-1]._source;(o===14||o===12)&&(i=!0,r=t[t.length-1].format,s--);const c=[],h=[],f=[],_=[],d=[],g=[],p=[],x={};for(let R=0;R<s;++R){const S=t[R];c.push(S.samplingMode),h.push(S.type),f.push(S.format),x[S.uniqueId]!==void 0?(_.push(-1),p.push(0)):(x[S.uniqueId]=R,S.is2DArray?(_.push(35866),p.push(S.depth)):S.isCube?(_.push(34067),p.push(0)):S.is3D?(_.push(32879),p.push(S.depth)):(_.push(3553),p.push(0))),this._faceIndices&&d.push(this._faceIndices[R]??0),this._layerIndices&&g.push(this._layerIndices[R]??0)}const b={samplingModes:c,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:i,depthTextureFormat:r,types:h,formats:f,textureCount:s,targetTypes:_,faceIndex:d,layerIndex:g,layerCounts:p,label:this.label},T={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(T,b);for(let R=0;R<s;++R){if(_[R]!==-1)continue;const S=x[t[R].uniqueId];e.setTexture(e.textures[S],R)}}}else{const t={};if(t.generateDepthBuffer=this._generateDepthBuffer,t.generateMipMaps=this.texture?.generateMipMaps??!1,t.generateStencilBuffer=this._generateStencilBuffer,t.samplingMode=this.texture?.samplingMode,t.type=this.texture?.type,t.format=this.texture?.format,t.noColorAttachment=!this._textures,t.label=this.label,this.isCube)e=this._engine.createRenderTargetCubeTexture(this.width,t);else{const i={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(i,t)}e.texture&&(e.texture.isReady=!0)}return e}_swapRenderTargetWrapper(e){if(this._textures&&e._textures)for(let t=0;t<this._textures.length;++t)this._textures[t]._swapAndDie(e._textures[t],!1),e._textures[t].isReady=!0;this._depthStencilTexture&&e._depthStencilTexture&&(this._depthStencilTexture._swapAndDie(e._depthStencilTexture),e._depthStencilTexture.isReady=!0),this._textures=null,this._depthStencilTexture=null}_rebuild(){const e=this._cloneRenderTargetWrapper();if(e){if(this._depthStencilTexture){const t=this._depthStencilTexture.samplingMode,i=this._depthStencilTexture.format,s=t===2||t===3||t===11;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,s,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,i,this._depthStencilTextureLabel)}this.samples>1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){if(this._textures)for(let e=0;e<this._textures.length;++e)this._textures[e].dispose();this._textures=null}dispose(e=!1){e||(this._depthStencilTexture?.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class OD extends PD{setDepthStencilTexture(e,t=!0){if(super.setDepthStencilTexture(e,t),!e)return;const i=this._engine,s=this._context,r=e._hardwareTexture;if(r&&e._autoMSAAManagement&&this._MSAAFramebuffer){const o=i._currentFramebuffer;i._bindUnboundFramebuffer(this._MSAAFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,ll(e.format)?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,s.RENDERBUFFER,r.getMSAARenderBuffer()),i._bindUnboundFramebuffer(o)}}constructor(e,t,i,s,r){super(e,t,i,s),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=r}_cloneRenderTargetWrapper(){let e;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height),e.texture.isReady=!0):e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,r=14,o){if(this._depthStencilBuffer){const c=this._engine,h=c._currentFramebuffer,f=this._context;c._bindUnboundFramebuffer(this._framebuffer),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,null),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,null),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.STENCIL_ATTACHMENT,f.RENDERBUFFER,null),c._bindUnboundFramebuffer(h),f.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,i,s,r,o)}shareDepth(e){super.shareDepth(e);const t=this._context,i=this._depthStencilBuffer,s=e._MSAAFramebuffer||e._framebuffer,r=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==i&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=i;const o=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;r._bindUnboundFramebuffer(s),t.framebufferRenderbuffer(t.FRAMEBUFFER,o,t.RENDERBUFFER,i),r._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,i,s=0){const r=e._hardwareTexture;if(!r)return;const o=this._framebuffer,c=this._engine,h=c._currentFramebuffer;c._bindUnboundFramebuffer(o);let f;if(c.webGLVersion>1){const _=this._context;f=_["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(i=i??this.layerIndices?.[t]??0,_.framebufferTextureLayer(_.FRAMEBUFFER,f,r.underlyingResource,s,i)):e.isCube?(i=i??this.faceIndices?.[t]??0,_.framebufferTexture2D(_.FRAMEBUFFER,f,_.TEXTURE_CUBE_MAP_POSITIVE_X+i,r.underlyingResource,s)):_.framebufferTexture2D(_.FRAMEBUFFER,f,_.TEXTURE_2D,r.underlyingResource,s)}else{const _=this._context;f=_["COLOR_ATTACHMENT"+t+"_WEBGL"];const d=i!==void 0?_.TEXTURE_CUBE_MAP_POSITIVE_X+i:_.TEXTURE_2D;_.framebufferTexture2D(_.FRAMEBUFFER,f,d,r.underlyingResource,s)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){const _=this._context;c._bindUnboundFramebuffer(this._MSAAFramebuffer),_.framebufferRenderbuffer(_.FRAMEBUFFER,f,_.RENDERBUFFER,r.getMSAARenderBuffer())}c._bindUnboundFramebuffer(h)}setTexture(e,t=0,i=!0){super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const i=this._attachments?.length??this.textures.length;for(let s=0;s<i;s++){const r=this.textures[s];r&&(r.is2DArray||r.is3D?this._bindTextureRenderTarget(r,s,this.layerIndices[s]):r.isCube?this._bindTextureRenderTarget(r,s,this.faceIndices[s]):this._bindTextureRenderTarget(r,s))}}setLayerAndFaceIndex(e=0,t,i){if(super.setLayerAndFaceIndex(e,t,i),!this.textures||!this.layerIndices||!this.faceIndices)return;const s=this.textures[e];s.is2DArray||s.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):s.isCube&&this._bindTextureRenderTarget(this.textures[e],e,this.faceIndices[e])}resolveMSAATextures(){const e=this._engine,t=e._currentFramebuffer;e._bindUnboundFramebuffer(this._MSAAFramebuffer),super.resolveMSAATextures(),e._bindUnboundFramebuffer(t)}dispose(e=this._disposeOnlyFramebuffers){const t=this._context;e||(this._colorTextureArray&&(this._context.deleteTexture(this._colorTextureArray),this._colorTextureArray=null),this._depthStencilTextureArray&&(this._context.deleteTexture(this._depthStencilTextureArray),this._depthStencilTextureArray=null)),this._framebuffer&&(t.deleteFramebuffer(this._framebuffer),this._framebuffer=null),this._depthStencilBuffer&&(t.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null),this._MSAAFramebuffer&&(t.deleteFramebuffer(this._MSAAFramebuffer),this._MSAAFramebuffer=null),super.dispose(e)}}let Qy=!1;function FD(){Qy||(Qy=!0,st.prototype._createHardwareRenderTargetWrapper=function(a,e,t){const i=new OD(a,e,t,this,this._gl);return this._renderTargetWrapperCache.push(i),i},st.prototype.createRenderTargetTexture=function(a,e){const t=this._createHardwareRenderTargetWrapper(!1,!1,a);let i=!0,s=!1,r=!1,o,c=1,h;e!==void 0&&typeof e=="object"&&(i=e.generateDepthBuffer??!0,s=!!e.generateStencilBuffer,r=!!e.noColorAttachment,o=e.colorAttachment,c=e.samples??1,h=e.label);const f=o||(r?null:this._createInternalTexture(a,e,!0,5)),_=a.width||a,d=a.height||a,g=this._currentFramebuffer,p=this._gl,x=p.createFramebuffer();if(this._bindUnboundFramebuffer(x),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(s,i,_,d),f&&!f.is2DArray&&!f.is3D&&p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,f._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(g),t.label=h??"RenderTargetWrapper",t._framebuffer=x,t._generateDepthBuffer=i,t._generateStencilBuffer=s,t.setTextures(f),!o)this.updateRenderTargetTextureSampleCount(t,c);else if(t._samples=o.samples,o.samples>1){const b=o._hardwareTexture.getMSAARenderBuffer(0);t._MSAAFramebuffer=p.createFramebuffer(),this._bindUnboundFramebuffer(t._MSAAFramebuffer),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.RENDERBUFFER,b),this._bindUnboundFramebuffer(null)}return t},st.prototype._createDepthStencilTexture=function(a,e,t){const i=this._gl,s=a.layers||0,r=a.depth||0;let o=i.TEXTURE_2D;s!==0?o=i.TEXTURE_2D_ARRAY:r!==0&&(o=i.TEXTURE_3D);const c=new is(this,12);if(c.label=e.label,!this._caps.depthTextureExtension)return me.Error("Depth texture is not supported by your browser or hardware."),c;const h={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e};if(this._bindTextureDirectly(o,c,!0),this._setupDepthStencilTexture(c,a,h.comparisonFunction===0?!1:h.bilinearFiltering,h.comparisonFunction,h.samples),h.depthTextureFormat!==void 0){if(h.depthTextureFormat!==15&&h.depthTextureFormat!==16&&h.depthTextureFormat!==17&&h.depthTextureFormat!==13&&h.depthTextureFormat!==14&&h.depthTextureFormat!==18)return me.Error(`Depth texture ${h.depthTextureFormat} format is not supported.`),c;c.format=h.depthTextureFormat}else c.format=h.generateStencil?13:16;const f=ll(c.format),_=this._getWebGLTextureTypeFromDepthTextureFormat(c.format),d=f?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,g=this._getInternalFormatFromDepthTextureFormat(c.format,!0,f);return c.is2DArray?i.texImage3D(o,0,g,c.width,c.height,s,0,d,_,null):c.is3D?i.texImage3D(o,0,g,c.width,c.height,r,0,d,_,null):i.texImage2D(o,0,g,c.width,c.height,0,d,_,null),this._bindTextureDirectly(o,null),this._internalTexturesCache.push(c),t._depthStencilBuffer&&(i.deleteRenderbuffer(t._depthStencilBuffer),t._depthStencilBuffer=null),this._bindUnboundFramebuffer(t._MSAAFramebuffer??t._framebuffer),t._generateStencilBuffer=f,t._depthStencilTextureWithStencil=f,t._depthStencilBuffer=this._setupFramebufferDepthAttachments(t._generateStencilBuffer,t._generateDepthBuffer,t.width,t.height,t.samples,c.format),this._bindUnboundFramebuffer(null),c},st.prototype.updateRenderTargetTextureSampleCount=function(a,e){if(this.webGLVersion<2||!a)return 1;if(a.samples===e)return e;const t=this._gl;e=Math.min(e,this.getCaps().maxMSAASamples),a._depthStencilBuffer&&(t.deleteRenderbuffer(a._depthStencilBuffer),a._depthStencilBuffer=null),a._MSAAFramebuffer&&(t.deleteFramebuffer(a._MSAAFramebuffer),a._MSAAFramebuffer=null);const i=a.texture?._hardwareTexture;if(i?.releaseMSAARenderBuffers(),a.texture&&e>1&&typeof t.renderbufferStorageMultisample=="function"){const r=t.createFramebuffer();if(!r)throw new Error("Unable to create multi sampled framebuffer");a._MSAAFramebuffer=r,this._bindUnboundFramebuffer(a._MSAAFramebuffer);const o=this._createRenderBuffer(a.texture.width,a.texture.height,e,-1,this._getRGBABufferInternalSizedFormat(a.texture.type,a.texture.format,a.texture._useSRGBBuffer),t.COLOR_ATTACHMENT0,!1);if(!o)throw new Error("Unable to create multi sampled framebuffer");i?.addMSAARenderBuffer(o)}this._bindUnboundFramebuffer(a._MSAAFramebuffer??a._framebuffer),a.texture&&(a.texture.samples=e),a._samples=e;const s=a._depthStencilTexture?a._depthStencilTexture.format:void 0;return a._depthStencilBuffer=this._setupFramebufferDepthAttachments(a._generateStencilBuffer,a._generateDepthBuffer,a.width,a.height,e,s),this._bindUnboundFramebuffer(null),e},st.prototype._setupDepthStencilTexture=function(a,e,t,i,s=1){const r=e.width??e,o=e.height??e,c=e.layers||0,h=e.depth||0;a.baseWidth=r,a.baseHeight=o,a.width=r,a.height=o,a.is2DArray=c>0,a.depth=c||h,a.isReady=!0,a.samples=s,a.generateMipMaps=!1,a.samplingMode=t?2:1,a.type=0,a._c
151omparisonFunction=i;const f=this._gl,_=this._getTextureTarget(a),d=this._getSamplingParameters(a.samplingMode,!1);f.texParameteri(_,f.TEXTURE_MAG_FILTER,d.mag),f.texParameteri(_,f.TEXTURE_MIN_FILTER,d.min),f.texParameteri(_,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(_,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),this.webGLVersion>1&&(i===0?(f.texParameteri(_,f.TEXTURE_COMPARE_FUNC,515),f.texParameteri(_,f.TEXTURE_COMPARE_MODE,f.NONE)):(f.texParameteri(_,f.TEXTURE_COMPARE_FUNC,i),f.texParameteri(_,f.TEXTURE_COMPARE_MODE,f.COMPARE_REF_TO_TEXTURE)))})}FD();let $y=!1;function BD(){$y||($y=!0,st.prototype.setDepthStencilTexture=function(a,e,t,i){a!==void 0&&(e&&(this._boundUniforms[a]=e),!t||!t.depthStencilTexture?this._setTexture(a,null,void 0,void 0,i):this._setTexture(a,t,!1,!0,i))})}BD();let Jy=!1;function LD(){Jy||(Jy=!0,st.prototype.createRenderTargetCubeTexture=function(a,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,a),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...e};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(i.type===1&&!this._caps.textureFloatLinearFiltering||i.type===2&&!this._caps.textureHalfFloatLinearFiltering)&&(i.samplingMode=1);const s=this._gl,r=new is(this,5);this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,r,!0);const o=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);i.type===1&&!this._caps.textureFloat&&(i.type=0,me.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,o.mag),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,o.min),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE);for(let h=0;h<6;h++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),a,a,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);const c=s.createFramebuffer();return this._bindUnboundFramebuffer(c),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,a,a),i.generateMipMaps&&s.generateMipmap(s.TEXTURE_CUBE_MAP),this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),t._framebuffer=c,t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer,r.width=a,r.height=a,r.isReady=!0,r.isCube=!0,r.samples=1,r.generateMipMaps=i.generateMipMaps,r.samplingMode=i.samplingMode,r.type=i.type,r.format=i.format,this._internalTexturesCache.push(r),t.setTextures(r),t})}LD();const UD="modulepreload",kD=function(a){return"/"+a},eb={},Ji=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let h=function(f){return Promise.all(f.map(_=>Promise.resolve(_).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");s=h(t.map(f=>{if(f=kD(f),f in eb)return;eb[f]=!0;const _=f.endsWith(".css"),d=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${d}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":UD,_||(g.as="script"),g.crossOrigin="",g.href=f,c&&g.setAttribute("nonce",c),document.head.appendChild(g),_)return new Promise((p,x)=>{g.addEventListener("load",p),g.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function r(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return s.then(o=>{for(const c of o||[])c.status==="rejected"&&r(c.reason);return e().catch(r)})},ND=1/2.2,zD=2.2,di=(1+Math.sqrt(5))/2;let Bt=.001;function xr(a,e){const t=[];for(let i=0;i<a;++i)t.push(e());return t}function Mr(a,e){return xr(a,e)}function VD(a,e,t){const i=a[e];if(typeof i!="function")return null;const s=function(){const r=a.length,o=s.previous.apply(a,arguments);return t(e,r),o};return i.next=s,s.previous=i,a[e]=s,()=>{const r=s.previous;if(!r)return;const o=s.next;o?(r.next=o,o.previous=r):(r.next=void 0,a[e]=r),s.next=void 0,s.previous=void 0}}const GD=["push","splice","pop","shift","unshift"];function HD(a,e){const t=GD.map(i=>VD(a,i,e));return()=>{for(const i of t)i?.()}}function wt(a,e,t=1401298e-51){return Math.abs(a-e)<=t}function ci(a,e){return a===e?a:Math.random()*(e-a)+a}function Md(a,e,t){return a+(e-a)*t}function _i(a,e=0,t=1){return Math.min(t,Math.max(e,a))}function WD(a){return a-=Math.PI*2*Math.floor((a+Math.PI)/(Math.PI*2)),a}function nn(a){const e=a.toString(16);return a<=15?("0"+e).toUpperCase():e.toUpperCase()}function PP(a){if(Math.log2)return Math.floor(Math.log2(a));if(a<0)return NaN;if(a===0)return-1/0;let e=0;if(a<1){for(;a<1;)e++,a=a*2;e=-e}else if(a>1)for(;a>1;)e++,a=Math.floor(a/2);return e}function Sd(a,e){const t=a%e;return t===0?e:Sd(e,t)}class $d{}$d._UpdateFlagSeed=0;function e1(a){a.updateFlag=$d._UpdateFlagSeed++}function t1(a,e,t,i=0){const s=a.asArray(),r=e.asArray(),o=s[0],c=s[1],h=s[2],f=s[3],_=s[4],d=s[5],g=s[6],p=s[7],x=s[8],b=s[9],T=s[10],R=s[11],S=s[12],M=s[13],I=s[14],A=s[15],D=r[0],C=r[1],k=r[2],H=r[3],L=r[4],J=r[5],te=r[6],ae=r[7],B=r[8],$=r[9],z=r[10],X=r[11],q=r[12],G=r[13],j=r[14],w=r[15];t[i]=o*D+c*L+h*B+f*q,t[i+1]=o*C+c*J+h*$+f*G,t[i+2]=o*k+c*te+h*z+f*j,t[i+3]=o*H+c*ae+h*X+f*w,t[i+4]=_*D+d*L+g*B+p*q,t[i+5]=_*C+d*J+g*$+p*G,t[i+6]=_*k+d*te+g*z+p*j,t[i+7]=_*H+d*ae+g*X+p*w,t[i+8]=x*D+b*L+T*B+R*q,t[i+9]=x
vendor: 75,973 bytes, lines 151-154
151*C+b*J+T*$+R*G,t[i+10]=x*k+b*te+T*z+R*j,t[i+11]=x*H+b*ae+T*X+R*w,t[i+12]=S*D+M*L+I*B+A*q,t[i+13]=S*C+M*J+I*$+A*G,t[i+14]=S*k+M*te+I*z+A*j,t[i+15]=S*H+M*ae+I*X+A*w}function cl(a,e,t,i=0){t1(a,e,t.asArray(),i),e1(t)}function XD(a,e,t=0){const i=a.asArray();e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15]}function th(a,e){const t=i1(a,e.asArray());return t&&e1(e),t}function i1(a,e){const t=a.asArray(),i=t[0],s=t[1],r=t[2],o=t[3],c=t[4],h=t[5],f=t[6],_=t[7],d=t[8],g=t[9],p=t[10],x=t[11],b=t[12],T=t[13],R=t[14],S=t[15],M=p*S-R*x,I=g*S-T*x,A=g*R-T*p,D=d*S-b*x,C=d*R-p*b,k=d*T-b*g,H=+(h*M-f*I+_*A),L=-(c*M-f*D+_*C),J=+(c*I-h*D+_*k),te=-(c*A-h*C+f*k),ae=i*H+s*L+r*J+o*te;if(ae===0)return!1;const B=1/ae,$=f*S-R*_,z=h*S-T*_,X=h*R-T*f,q=c*S-b*_,G=c*R-b*f,j=c*T-b*h,w=f*x-p*_,O=h*x-g*_,U=h*p-g*f,W=c*x-d*_,oe=c*p-d*f,le=c*g-d*h,be=-(s*M-r*I+o*A),Ee=+(i*M-r*D+o*C),Fe=-(i*I-s*D+o*k),Y=+(i*A-s*C+r*k),ue=+(s*$-r*z+o*X),de=-(i*$-r*q+o*G),we=+(i*z-s*q+o*j),qe=-(i*X-s*G+r*j),ke=-(s*w-r*O+o*U),ut=+(i*w-r*W+o*oe),Gt=-(i*O-s*W+o*le),Ot=+(i*U-s*oe+r*le);return e[0]=H*B,e[1]=be*B,e[2]=ue*B,e[3]=ke*B,e[4]=L*B,e[5]=Ee*B,e[6]=de*B,e[7]=ut*B,e[8]=J*B,e[9]=Fe*B,e[10]=we*B,e[11]=Gt*B,e[12]=te*B,e[13]=Y*B,e[14]=qe*B,e[15]=Ot*B,!0}const s1={};function pr(a,e){s1[a]=e}function Ed(a){return s1[a]}const ts=a=>parseInt(a.toString().replace(/\W/g,""));class Ue{constructor(e=0,t=0){this.x=e,this.y=t}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){const e=ts(this.x),t=ts(this.y);let i=e;return i=i*397^t,i}toArray(e,t=0){return e[t]=this.x,e[t+1]=this.y,this}fromArray(e,t=0){return Ue.FromArrayToRef(e,t,this),this}asArray(){return[this.x,this.y]}copyFrom(e){return this.x=e.x,this.y=e.y,this}copyFromFloats(e,t){return this.x=e,this.y=t,this}set(e,t){return this.copyFromFloats(e,t)}setAll(e){return this.copyFromFloats(e,e)}add(e){return new Ue(this.x+e.x,this.y+e.y)}addToRef(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addInPlaceFromFloats(e,t){return this.x+=e,this.y+=t,this}addVector3(e){return new Ue(this.x+e.x,this.y+e.y)}subtract(e){return new Ue(this.x-e.x,this.y-e.y)}subtractToRef(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this}multiply(e){return new Ue(this.x*e.x,this.y*e.y)}multiplyToRef(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByFloats(e,t){return new Ue(this.x*e,this.y*t)}divide(e){return new Ue(this.x/e.x,this.y/e.y)}divideToRef(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t}divideInPlace(e){return this.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,t){return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this}maximizeInPlaceFromFloats(e,t){return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this}subtractFromFloats(e,t){return new Ue(this.x-e,this.y-t)}subtractFromFloatsToRef(e,t,i){return i.x=this.x-e,i.y=this.y-t,i}negate(){return new Ue(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){return new Ue(this.x*e,this.y*e)}scaleToRef(e,t){return t.x=this.x*e,t.y=this.y*e,t}scaleAndAddToRef(e,t){return t.x+=this.x*e,t.y+=this.y*e,t}equals(e){return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,t=Bt){return e&&wt(this.x,e.x,t)&&wt(this.y,e.y,t)}equalsToFloats(e,t){return this.x===e&&this.y===t}floor(){return new Ue(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){return new Ue(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}rotate(e){return this.rotateToRef(e,new Ue)}rotateToRef(e,t){const i=Math.cos(e),s=Math.sin(e);return t.x=i*this.x-s*this.y,t.y=s*this.x+i*this.y,t}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new Ue;return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0&&(e.x=this.x,e.y=this.y),this.scaleToRef(1/t,e)}clone(){return new Ue(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new Ue(0,0)}static One(){return new Ue(1,1)}static Random(e=0,t=1){return new Ue(ci(e,t),ci(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(ci(e,t),ci(e,t))}static get ZeroReadOnly(){return Ue._ZeroReadOnly}static FromArray(e,t=0){return new Ue(e[t],e[t+1])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i}static FromFloatsToRef(e,t,i){return i.copyFromFloats(e,t),i}static CatmullRom(e,t,i,s,r){const o=r*r,c=r*o,h=.5*(2*t.x+(-e.x+i.x)*r+(2*e.x-5*t.x+4*i.x-s.x)*o+(-e.x+3*t.x-3*i.x+s.x)*c),f=.5*(2*t.y+(-e.y+i.y)*r+(2*e.y-5*t.y+4*i.y-s.y)*o+(-e.y+3*t.y-3*i.y+s.y)*c);return new Ue(h,f)}static ClampToRef(e,t,i,s){return s.x=_i(e.x,t.x,i.x),s.y=_i(e.y,t.y,i.y),s}static Clamp(e,t,i){const s=_i(e.x,t.x,i.x),r=_i(e.y,t.y,i.y);return new Ue(s,r)}static Hermite(e,t,i,s,r){const o=r*r,c=r*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+r,d=c-o,g=e.x*h+i.x*f+t.x*_+s.x*d,p=e.y*h+i.y*f+t.y*_+s.y*d;return new Ue(g,p)}static Hermite1stDerivative(e,t,i,s,r){return this.Hermite1stDerivativeToRef(e,t,i,s,r,new Ue)}static Hermite1stDerivativeToRef(e,t,i,s,r,o){const c=r*r;return o.x=(c-r)*6*e.x+(3*c-4*r+1)*t.x+(-c+r)*6*i.x+(3*c-2*r)*s.x,o.y=(c-r)*6*e.y+(3*c-4*r+1)*t.y+(-c+r)*6*i.y+(3*c-2*r)*s.y,o}static Lerp(e,t,i){return Ue.LerpToRef(e,t,i,new Ue)}static LerpToRef(e,t,i,s){return s.x=e.x+(t.x-e.x)*i,s.y=e.y+(t.y-e.y)*i,s}static Dot(e,t){return e.x*t.x+e.y*t.y}static Normalize(e){return Ue.NormalizeToRef(e,new Ue)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=e.x<t.x?e.x:t.x,s=e.y<t.y?e.y:t.y;return new Ue(i,s)}static Maximize(e,t){const i=e.x>t.x?e.x:t.x,s=e.y>t.y?e.y:t.y;return new Ue(i,s)}static Transform(e,t){return Ue.TransformToRef(e,t,new Ue)}static TransformToRef(e,t,i){const s=t.m,r=e.x*s[0]+e.y*s[4]+s[12],o=e.x*s[1]+e.y*s[5]+s[13];return i.x=r,i.y=o,i}static PointInTriangle(e,t,i,s){const r=.5*(-i.y*s.x+t.y*(-i.x+s.x)+t.x*(i.y-s.y)+i.x*s.y),o=r<0?-1:1,c=(t.y*s.x-t.x*s.y+(s.y-t.y)*e.x+(t.x-s.x)*e.y)*o,h=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*o;return c>0&&h>0&&c+h<2*r*o}static Distance(e,t){return Math.sqrt(Ue.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y;return i*i+s*s}static Center(e,t){return Ue.CenterToRef(e,t,new Ue)}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)}static DistanceOfPointFromSegment(e,t,i){const s=Ue.DistanceSquared(t,i);if(s===0)return Ue.Distance(e,t);const r=i.subtract(t),o=Math.max(0,Math.min(1,Ue.Dot(e.subtract(t),r)/s)),c=t.add(r.multiplyByFloats(o,o));return Ue.Distance(e,c)}}Ue._V8PerformanceHack=new Ue(.5,.5);Ue._ZeroReadOnly=Ue.Zero();class E{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}constructor(e=0,t=0,i=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){const e=ts(this._x),t=ts(this._y),i=ts(this._z);let s=e;return s=s*397^t,s=s*397^i,s}asArray(){return[this._x,this._y,this._z]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this}fromArray(e,t=0){return E.FromArrayToRef(e,t,this),this}toQuaternion(){return Oe.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,t,i){return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this}add(e){return new E(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._isDirty=!0,t}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){return new E(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)}subtractFromFloats(e,t,i){return new E(this._x-e,this._y-t,this._z-i)}subtractFromFloatsToRef(e,t,i,s){return s._x=this._x-e,s._y=this._y-t,s._z=this._z-i,s._isDirty=!0,s}negate(){return new E(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){return e._x=this._x*-1,e._y=this._y*-1,e._z=this._z*-1,e._isDirty=!0,e}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){return new E(this._x*e,this._y*e,this._z*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._isDirty=!0,t}getNormalToRef(e){const t=this.length();let i=Math.acos(this._y/t);const s=Math.atan2(this._z,this._x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;const r=t*Math.sin(i)*Math.cos(s),o=t*Math.cos(i),c=t*Math.sin(i)*Math.sin(s);return e.set(r,o,c),e}applyRotationQuaternionToRef(e,t){const i=this._x,s=this._y,r=this._z,o=e._x,c=e._y,h=e._z,f=e._w,_=2*(c*r-h*s),d=2*(h*i-o*r),g=2*(o*s-c*i);return t._x=i+f*_+c*g-h*d,t._y=s+f*d+h*_-o*g,t._z=r+f*g+o*d-c*_,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new E)}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._isDirty=!0,t}projectOnPlane(e,t){return this.projectOnPlaneToRef(e,t,new E)}projectOnPlaneToRef(e,t,i){const s=e.normal,r=e.d,o=Ie.Vector3[0];this.subtractToRef(t,o),o.normalize();const c=E.Dot(o,s);if(Math.abs(c)<1e-10)i.setAll(1/0);else{const h=-(E.Dot(t,s)+r)/c,f=o.scaleInPlace(h);t.addToRef(f,i)}return i}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,t=Bt){return e&&wt(this._x,e._x,t)&&wt(this._y,e._y,t)&&wt(this._z,e._z,t)}equalsToFloats(e,t,i){return this._x===e&&this._y===t&&this._z===i}multiplyInPlace(e){return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,t){return t._x=this._x*e._x,t._y=this._y*e._y,t._z=this._z*e._z,t._isDirty=!0,t}multiplyByFloats(e,t,i){return new E(this._x*e,this._y*t,this._z*i)}divide(e){return new E(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,t){return t._x=this._x/e._x,t._y=this._y/e._y,t._z=this._z/e._z,t._isDirty=!0,t}divideInPlace(e){return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,t,i){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),i<this._z&&(this.z=i),this}maximizeInPlaceFromFloats(e,t,i){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){const t=Math.abs(this._x),i=Math.abs(this._y);if(!wt(t,i,e))return!0;const s=Math.abs(this._z);return!wt(t,s,e)||!wt(i,s,e)}get isNonUniform(){const e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;const i=Math.abs(this._z);return e!==i}floorToRef(e){return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){return new E(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(e){return e._x=this._x-Math.floor(this._x),e._y=this._y-Math.floor(this._y),e._z=this._z-Math.floor(this._z),e._isDirty=!0,e}fract(){return new E(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z===0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(e){if(e=e.toLowerCase(),e==="xyz")return this;const t=Ie.Vector3[0].copyFrom(this);return this.x=t[e[0]],this.y=t[e[1]],this.z=t[e[2]],this}rotateByQuaternionToRef(e,t){return e.toRotationMatrix(Ie.Matrix[0]),E.TransformCoordinatesToRef(this,Ie.Matrix[0],t),t}rotateByQuaternionAroundPointToRef(e,t,i){return this.subtractToRef(t,Ie.Vector3[0]),Ie.Vector3[0].rotateByQuaternionToRef(e,Ie.Vector3[0]),t.addToRef(Ie.Vector3[0],i),i}cross(e){return E.CrossToRef(this,e,new E)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new E)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e._x=this._x,e._y=this._y,e._z=this._z,e._isDirty=!0,e):this.scaleToRef(1/t,e)}clone(){return new E(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,t,i){return this._x=e,this._y=t,this._z=i,this._isDirty=!0,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,t,i,s){const r=E.Dot(e,i),o=E.Dot(t,i);return(r-s)/(r-o)}static GetAngleBetweenVectors(e,t,i){const s=e.normalizeToRef(Ie.Vector3[1]),r=t.normalizeToRef(Ie.Vector3[2]);let o=E.Dot(s,r);o=_i(o,-1,1);const c=Math.acos(o),h=Ie.Vector3[3];return E.CrossToRef(s,r,h),E.Dot(h,i)>0?isNaN(c)?0:c:isNaN(c)?-Math.PI:-Math.acos(o)}static GetAngleBetweenVectorsOnPlane(e,t,i){Ie.Vector3[0].copyFrom(e);const s=Ie.Vector3[0];Ie.Vector3[1].copyFrom(t);const r=Ie.Vector3[1];Ie.Vector3[2].copyFrom(i);const o=Ie.Vector3[2],c=Ie.Vector3[3],h=Ie.Vector3[4];s.normalize(),r.normalize(),o.normalize(),E.CrossToRef(o,s,c),E.CrossToRef(c,o,h);const f=Math.atan2(E.Dot(r,c),E.Dot(r,h));return WD(f)}static PitchYawRollToMoveBetweenPointsToRef(e,t,i){const s=fe.Vector3[0];return t.subtractToRef(e,s),i._y=Math.atan2(s.x,s.z)||0,i._x=Math.atan2(Math.sqrt(s.x**2+s.z**2),s.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,t){const i=E.Zero();return E.PitchYawRollToMoveBetweenPointsToRef(e,t,i)}static SlerpToRef(e,t,i,s){i=_i(i,0,1);const r=Ie.Vector3[0],o=Ie.Vector3[1];r.copyFrom(e);const c=r.length();r.normalizeFromLength(c),o.copyFrom(t);const h=o.length();o.normalizeFromLength(h);const f=E.Dot(r,o);let _,d;if(f<1-Bt){const g=Math.acos(f),p=1/Math.sin(g);_=Math.sin((1-i)*g)*p,d=Math.sin(i*g)*p}else _=1-i,d=i;return r.scaleInPlace(_),o.scaleInPlace(d),s.copyFrom(r).addInPlace(o),s.scaleInPlace(Md(c,h,i)),s}static SmoothToRef(e,t,i,s,r){return E.SlerpToRef(e,t,s===0?1:i/s,r),r}static FromArray(e,t=0){return new E(e[t],e[t+1],e[t+2])}static FromFloatArray(e,t){return E.FromArray(e,t)}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,t,i){return E.FromArrayToRef(e,t,i)}static FromFloatsToRef(e,t,i,s){return s.copyFromFloats(e,t,i),s}static Zero(){return new E(0,0,0)}static One(){return new E(1,1,1)}static Up(){return new E(0,1,0)}static get UpReadOnly(){return E._UpReadOnly}static get DownReadOnly(){return E._DownReadOnly}static get RightReadOnly(){return E._RightReadOnly}static get LeftReadOnly(){return E._LeftReadOnly}static get LeftHandedForwardReadOnly(){return E._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return E._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return E._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return E._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return E._ZeroReadOnly}static get OneReadOnly(){return E._OneReadOnly}static Down(){return new E(0,-1,0)}static Forward(e=!1){return new E(0,0,e?-1:1)}static Backward(e=!1){return new E(0,0,e?1:-1)}static Right(){return new E(1,0,0)}static Left(){return new E(-1,0,0)}static Random(e=0,t=1){return new E(ci(e,t),ci(e,t),ci(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(ci(e,t),ci(e,t),ci(e,t))}static TransformCoordinates(e,t){const i=E.Zero();return E.TransformCoordinatesToRef(e,t,i),i}static TransformCoordinatesToRef(e,t,i){return E.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,r){const o=s.m,c=e*o[0]+t*o[4]+i*o[8]+o[12],h=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],_=1/(e*o[3]+t*o[7]+i*o[11]+o[15]);return r._x=c*_,r._y=h*_,r._z=f*_,r._isDirty=!0,r}static TransformNormal(e,t){const i=E.Zero();return E.TransformNormalToRef(e,t,i),i}static TransformNormalToRef(e,t,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformNormalFromFloatsToRef(e,t,i,s,r){const o=s.m;return r._x=e*o[0]+t*o[4]+i*o[8],r._y=e*o[1]+t*o[5]+i*o[9],r._z=e*o[2]+t*o[6]+i*o[10],r._isDirty=!0,r}static CatmullRom(e,t,i,s,r){const o=r*r,c=r*o,h=.5*(2*t._x+(-e._x+i._x)*r+(2*e._x-5*t._x+4*i._x-s._x)*o+(-e._x+3*t._x-3*i._x+s._x)*c),f=.5*(2*t._y+(-e._y+i._y)*r+(2*e._y-5*t._y+4*i._y-s._y)*o+(-e._y+3*t._y-3*i._y+s._y)*c),_=.5*(2*t._z+(-e._z+i._z)*r+(2*e._z-5*t._z+4*i._z-s._z)*o+(-e._z+3*t._z-3*i._z+s._z)*c);return new E(h,f,_)}static Clamp(e,t,i){const s=new E;return E.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){let r=e._x;r=r>i._x?i._x:r,r=r<t._x?t._x:r;let o=e._y;o=o>i._y?i._y:o,o=o<t._y?t._y:o;let c=e._z;return c=c>i._z?i._z:c,c=c<t._z?t._z:c,s.copyFromFloats(r,o,c),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static Hermite(e,t,i,s,r){const o=r*r,c=r*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+r,d=c-o,g=e._x*h+i._x*f+t._x*_+s._x*d,p=e._y*h+i._y*f+t._y*_+s._y*d,x=e._z*h+i._z*f+t._z*_+s._z*d;return new E(g,p,x)}static Hermite1stDerivative(e,t,i,s,r){const o=new E;return this.Hermite1stDerivativeToRef(e,t,i,s,r,o),o}static Hermite1stDerivativeToRef(e,t,i,s,r,o){const c=r*r;return o._x=(c-r)*6*e._x+(3*c-4*r+1)*t._x+(-c+r)*6*i._x+(3*c-2*r)*s._x,o._y=(c-r)*6*e._y+(3*c-4*r+1)*t._y+(-c+r)*6*i._y+(3*c-2*r)*s._y,o._z=(c-r)*6*e._z+(3*c-4*r+1)*t._z+(-c+r)*6*i._z+(3*c-2*r)*s._z,o._isDirty=!0,o}static Lerp(e,t,i){const s=new E(0,0,0);return E.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){return s._x=e._x+(t._x-e._x)*i,s._y=e._y+(t._y-e._y)*i,s._z=e._z+(t._z-e._z)*i,s._isDirty=!0,s}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z}static Cross(e,t){const i=new E;return E.CrossToRef(e,t,i),i}static CrossToRef(e,t,i){const s=e._y*t._z-e._z*t._y,r=e._z*t._x-e._x*t._z,o=e._x*t._y-e._y*t._x;return i.copyFromFloats(s,r,o),i}static Normalize(e){const t=E.Zero();return E.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Project(e,t,i,s){const r=new E;return E.ProjectToRef(e,t,i,s,r),r}static ProjectToRef(e,t,i,s,r){const o=s.width,c=s.height,h=s.x,f=s.y,_=Ie.Matrix[1],d=ft.LastCreatedEngine?.isNDCHalfZRange,g=d?1:.5,p=d?0:.5;se.FromValuesToRef(o/2,0,0,0,0,-c/2,0,0,0,0,g,0,h+o/2,c/2+f,p,1,_);const x=Ie.Matrix[0];return t.multiplyToRef(i,x),x.multiplyToRef(_,x),E.TransformCoordinatesToRef(e,x,r),r}static Reflect(e,t){return this.ReflectToRef(e,t,new E)}static ReflectToRef(e,t,i){const s=fe.Vector3[0];return s.copyFrom(t).scaleInPlace(2*E.Dot(e,t)),i.copyFrom(e).subtractInPlace(s)}static UnprojectFromTransform(e,t,i,s,r){return this.Unproject(e,t,i,s,r,se.IdentityReadOnly)}static Unproject(e,t,i,s,r,o){const c=new E;return E.UnprojectToRef(e,t,i,s,r,o,c),c}static UnprojectToRef(e,t,i,s,r,o,c){return E.UnprojectFloatsToRef(e._x,e._y,e._z,t,i,s,r,o,c),c}static UnprojectFloatsToRef(e,t,i,s,r,o,c,h,f){const _=Ie.Matrix[0];o.multiplyToRef(c,_),_.multiplyToRef(h,_),_.invert();const d=Ie.Vector3[0];return d.x=e/s*2-1,d.y=-(t/r*2-1),ft.LastCreatedEngine?.isNDCHalfZRange?d.z=i:d.z=2*i-1,E.TransformCoordinatesToRef(d,_,f),f}static Minimize(e,t){const i=new E;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new E;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(E.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e._x-t._x,s=e._y-t._y,r=e._z-t._z;return i*i+s*s+r*r}static ProjectOnTriangleToRef(e,t,i,s,r){const o=Ie.Vector3[0],c=Ie.Vector3[1],h=Ie.Vector3[2],f=Ie.Vector3[3],_=Ie.Vector3[4];i.subtractToRef(t,o),s.subtractToRef(t,c),s.subtractToRef(i,h);const d=o.length(),g=c.length(),p=h.length();if(d<Bt||g<Bt||p<Bt)return r.copyFrom(t),E.Distance(e,t);e.subtractToRef(t,_),E.CrossToRef(o,c,f);const x=f.length();if(x<Bt)return r.copyFrom(t),E.Distance(e,t);f.normalizeFromLength(x);let b=_.length();if(b<Bt)return r.copyFrom(t),0;_.normalizeFromLength(b);const T=E.Dot(f,_),R=Ie.Vector3[5],S=Ie.Vector3[6];R.copyFrom(f).scaleInPlace(-b*T),S.copyFrom(e).addInPlace(R);const M=Ie.Vector3[4],I=Ie.Vector3[5],A=Ie.Vector3[7],D=Ie.Vector3[8];M.copyFrom(o).scaleInPlace(1/d),D.copyFrom(c).scaleInPlace(1/g),M.addInPlace(D).scaleInPlace(-1),I.copyFrom(o).scaleInPlace(-1/d),D.copyFrom(h).scaleInPlace(1/p),I.addInPlace(D).scaleInPlace(-1),A.copyFrom(h).scaleInPlace(-1/p),D.copyFrom(c).scaleInPlace(-1/g),A.addInPlace(D).scaleInPlace(-1);const C=Ie.Vector3[9];let k;C.copyFrom(S).subtractInPlace(t),E.CrossToRef(M,C,D),k=E.Dot(D,f);const H=k;C.copyFrom(S).subtractInPlace(i),E.CrossToRef(I,C,D),k=E.Dot(D,f);const L=k;C.copyFrom(S).subtractInPlace(s),E.CrossToRef(A,C,D),k=E.Dot(D,f);const J=k,te=Ie.Vector3[10];let ae,B;H>0&&L<0?(te.copyFrom(o),ae=t,B=i):L>0&&J<0?(te.copyFrom(h),ae=i,B=s):(te.copyFrom(c).scaleInPlace(-1),ae=s,B=t);const $=Ie.Vector3[9],z=Ie.Vector3[4];if(ae.subtractToRef(S,D),B.subtractToRef(S,$),E.CrossToRef(D,$,z),!(E.Dot(z,f)<0))return r.copyFrom(S),Math.abs(b*T);const q=Ie.Vector3[5];E.CrossToRef(te,z,q),q.normalize();const G=Ie.Vector3[9];G.copyFrom(ae).subtractInPlace(S);const j=G.length();if(j<Bt)return r.copyFrom(ae),E.Distance(e,ae);G.normalizeFromLength(j);const w=E.Dot(q,G),O=Ie.Vector3[7];O.copyFrom(S).addInPlace(q.scaleInPlace(j*w)),D.copyFrom(O).subtractInPlace(ae),b=te.length(),te.normalizeFromLength(b);let U=E.Dot(D,te)/Math.max(b,Bt);return U=_i(U,0,1),O.copyFrom(ae).addInPlace(te.scaleInPlace(U*b)),r.copyFrom(O),E.Distance(e,O)}static Center(e,t){return E.CenterToRef(e,t,E.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e._x+t._x)/2,(e._y+t._y)/2,(e._z+t._z)/2)}static RotationFromAxis(e,t,i){const s=new E;return E.RotationFromAxisToRef(e,t,i,s),s}static RotationFromAxisToRef(e,t,i,s){const r=Ie.Quaternion[0];return Oe.RotationQuaternionFromAxisToRef(e,t,i,r),r.toEulerAnglesToRef(s),s}}E._V8PerformanceHack=new E(.5,.5,.5);E._UpReadOnly=E.Up();E._DownReadOnly=E.Down();E._LeftHandedForwardReadOnly=E.Forward(!1);E._RightHandedForwardReadOnly=E.Forward(!0);E._LeftHandedBackwardReadOnly=E.Backward(!1);E._RightHandedBackwardReadOnly=E.Backward(!0);E._RightReadOnly=E.Right();E._LeftReadOnly=E.Left();E._ZeroReadOnly=E.Zero();E._OneReadOnly=E.One();class it{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,s=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){const e=ts(this._x),t=ts(this._y),i=ts(this._z),s=ts(this._w);let r=e;return r=r*397^t,r=r*397^i,r=r*397^s,r}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t){return t===void 0&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){return it.FromArrayToRef(e,t,this),this}addInPlace(e){return this.x+=e._x,this.y+=e._y,this.z+=e._z,this.w+=e._w,this}addInPlaceFromFloats(e,t,i,s){return this.x+=e,this.y+=t,this.z+=i,this.w+=s,this}add(e){return new it(this._x+e.x,this._y+e.y,this._z+e.z,this._w+e.w)}addToRef(e,t){return t.x=this._x+e.x,t.y=this._y+e.y,t.z=this._z+e.z,t.w=this._w+e.w,t}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subtract(e){return new it(this._x-e.x,this._y-e.y,this._z-e.z,this._w-e.w)}subtractToRef(e,t){return t.x=this._x-e.x,t.y=this._y-e.y,t.z=this._z-e.z,t.w=this._w-e.w,t}subtractFromFloats(e,t,i,s){return new it(this._x-e,this._y-t,this._z-i,this._w-s)}subtractFromFloatsToRef(e,t,i,s,r){return r.x=this._x-e,r.y=this._y-t,r.z=this._z-i,r.w=this._w-s,r}negate(){return new it(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(e){return e.x=-this._x,e.y=-this._y,e.z=-this._z,e.w=-this._w,e}scaleInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}scale(e){return new it(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,t}scaleAndAddToRef(e,t){return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,t}equals(e){return e&&this._x===e.x&&this._y===e.y&&this._z===e.z&&this._w===e.w}equalsWithEpsilon(e,t=Bt){return e&&wt(this._x,e.x,t)&&wt(this._y,e.y,t)&&wt(this._z,e.z,t)&&wt(this._w,e.w,t)}equalsToFloats(e,t,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiply(e){return new it(this._x*e.x,this._y*e.y,this._z*e.z,this._w*e.w)}multiplyToRef(e,t){return t.x=this._x*e.x,t.y=this._y*e.y,t.z=this._z*e.z,t.w=this._w*e.w,t}multiplyByFloats(e,t,i,s){return new it(this._x*e,this._y*t,this._z*i,this._w*s)}divide(e){return new it(this._x/e.x,this._y/e.y,this._z/e.z,this._w/e.w)}divideToRef(e,t){return t.x=this._x/e.x,t.y=this._y/e.y,t.z=this._z/e.z,t.w=this._w/e.w,t}divideInPlace(e){return this.divideToRef(e,this)}minimizeInPlace(e){return e.x<this._x&&(this.x=e.x),e.y<this._y&&(this.y=e.y),e.z<this._z&&(this.z=e.z),e.w<this._w&&(this.w=e.w),this}maximizeInPlace(e){return e.x>this._x&&(this.x=e.x),e.y>this._y&&(this.y=e.y),e.z>this._z&&(this.z=e.z),e.w>this._w&&(this.w=e.w),this}minimizeInPlaceFromFloats(e,t,i,s){return this.x=Math.min(e,this._x),this.y=Math.min(t,this._y),this.z=Math.min(i,this._z),this.w=Math.min(s,this._w),this}maximizeInPlaceFromFloats(e,t,i,s){return this.x=Math.max(e,this._x),this.y=Math.max(t,this._y),this.z=Math.max(i,this._z),this.w=Math.max(s,this._w),this}floorToRef(e){return e.x=Math.floor(this._x),e.y=Math.floor(this._y),e.z=Math.floor(this._z),e.w=Math.floor(this._w),e}floor(){return new it(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(e){return e.x=this._x-Math.floor(this._x),e.y=this._y-Math.floor(this._y),e.z=this._z-Math.floor(this._z),e.w=this._w-Math.floor(this._w),e}fract(){return new it(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new it)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w,e):this.scaleToRef(1/t,e)}toVector3(){return new E(this._x,this._y,this._z)}clone(){return new it(this._x,this._y,this._z,this._w)}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.x=this.y=this.z=this.w=e,this}dot(e){return this._x*e.x+this._y*e.y+this._z*e.z+this._w*e.w}static FromArray(e,t){return t||(t=0),new it(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i}static FromFloatArrayToRef(e,t,i){return it.FromArrayToRef(e,t,i),i}static FromFloatsToRef(e,t,i,s,r){return r.x=e,r.y=t,r.z=i,r.w=s,r}static Zero(){return new it(0,0,0,0)}static One(){return new it(1,1,1,1)}static Random(e=0,t=1){return new it(ci(e,t),ci(e,t),ci(e,t),ci(e,t))}static RandomToRef(e=0,t=1,i){return i.x=ci(e,t),i.y=ci(e,t),i.z=ci(e,t),i.w=ci(e,t),i}static Clamp(e,t,i){return it.ClampToRef(e,t,i,new it)}static ClampToRef(e,t,i,s){return s.x=_i(e.x,t.x,i.x),s.y=_i(e.y,t.y,i.y),s.z=_i(e.z,t.z,i.z),s.w=_i(e.w,t.w,i.w),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){return it._ZeroReadOnly}static Normalize(e){return it.NormalizeToRef(e,new it)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=new it;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new it;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(it.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,r=e.z-t.z,o=e.w-t.w;return i*i+s*s+r*r+o*o}static Center(e,t){return it.CenterToRef(e,t,new it)}static CenterToRef(e,t,i){return i.x=(e.x+t.x)/2,i.y=(e.y+t.y)/2,i.z=(e.z+t.z)/2,i.w=(e.w+t.w)/2,i}static TransformCoordinates(e,t){return it.TransformCoordinatesToRef(e,t,new it)}static TransformCoordinatesToRef(e,t,i){return it.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,r){const o=s.m,c=e*o[0]+t*o[4]+i*o[8]+o[12],h=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],_=e*o[3]+t*o[7]+i*o[11]+o[15];return r.x=c,r.y=h,r.z=f,r.w=_,r}static TransformNormal(e,t){return it.TransformNormalToRef(e,t,new it)}static TransformNormalToRef(e,t,i){const s=t.m,r=e.x*s[0]+e.y*s[4]+e.z*s[8],o=e.x*s[1]+e.y*s[5]+e.z*s[9],c=e.x*s[2]+e.y*s[6]+e.z*s[10];return i.x=r,i.y=o,i.z=c,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,t,i,s,r,o){const c=r.m;return o.x=e*c[0]+t*c[4]+i*c[8],o.y=e*c[1]+t*c[5]+i*c[9],o.z=e*c[2]+t*c[6]+i*c[10],o.w=s,o}static FromVector3(e,t=0){return new it(e._x,e._y,e._z,t)}static Dot(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}}it._V8PerformanceHack=new it(.5,.5,.5,.5);it._ZeroReadOnly=it.Zero();class Oe{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,s=1){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){const e=ts(this._x),t=ts(this._y),i=ts(this._z),s=ts(this._w);let r=e;return r=r*397^t,r=r*397^i,r=r*397^s,r}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){return Oe.FromArrayToRef(e,t,this)}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,t=Bt){return e&&wt(this._x,e._x,t)&&wt(this._y,e._y,t)&&wt(this._z,e._z,t)&&wt(this._w,e._w,t)}isApprox(e,t=Bt){return e&&(wt(this._x,e._x,t)&&wt(this._y,e._y,t)&&wt(this._z,e._z,t)&&wt(this._w,e._w,t)||wt(this._x,-e._x,t)&&wt(this._y,-e._y,t)&&wt(this._z,-e._z,t)&&wt(this._w,-e._w,t))}clone(){return new Oe(this._x,this._y,this._z,this._w)}copyFrom(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._isDirty=!0,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new Oe(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._w=this._w+e._w,t._isDirty=!0,t}addInPlaceFromFloats(e,t,i,s){return this._x+=e,this._y+=t,this._z+=i,this._w+=s,this._isDirty=!0,this}subtractToRef(e,t){return t._x=this._x-e._x,t._y=this._y-e._y,t._z=this._z-e._z,t._w=this._w-e._w,t._isDirty=!0,t}subtractFromFloats(e,t,i,s){return this.subtractFromFloatsToRef(e,t,i,s,new Oe)}subtractFromFloatsToRef(e,t,i,s,r){return r._x=this._x-e,r._y=this._y-t,r._z=this._z-i,r._w=this._w-s,r._isDirty=!0,r}subtract(e){return new Oe(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){return new Oe(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._w=this._w*e,t._isDirty=!0,t}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._w+=this._w*e,t._isDirty=!0,t}multiply(e){const t=new Oe(0,0,0,1);return this.multiplyToRef(e,t),t}multiplyToRef(e,t){const i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,s=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,r=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,s,r,o),t}multiplyInPlace(e){return this.multiplyToRef(e,this)}multiplyByFloats(e,t,i,s){return this._x*=e,this._y*=t,this._z*=i,this._w*=s,this._isDirty=!0,this}divide(e){throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,t){throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw new ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new Oe)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,t,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}floorToRef(e){throw new ReferenceError("Can not floor a quaternion")}floor(){throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){throw new ReferenceError("Can not fract a quaternion")}fract(){throw new ReferenceError("Can not fract a quaternion")}conjugateToRef(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new Oe(-this._x,-this._y,-this._z,this._w)}invert(){const e=this.conjugate(),t=this.lengthSquared();return t==0||t==1||e.scaleInPlace(1/t),e}invertInPlace(){this.conjugateInPlace();const e=this.lengthSquared();return e==0||e==1?this:(this.scaleInPlace(1/e),this)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new Oe(0,0,0,1);return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0||t===1?e.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/t,e)}toEulerAngles(){const e=E.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){const t=this._z,i=this._x,s=this._y,r=this._w,o=s*t-i*r,c=.4999999;if(o<-c)e._y=2*Math.atan2(s,r),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(o>c)e._y=2*Math.atan2(s,r),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{const h=r*r,f=t*t,_=i*i,d=s*s;e._z=Math.atan2(2*(i*s+t*r),-f-_+d+h),e._x=Math.asin(-2*o),e._y=Math.atan2(2*(t*i+s*r),f-_-d+h),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){const t=this._z,i=this._x,s=this._y,r=this._w,o=Math.sqrt(i*i+s*s),c=Math.sqrt(t*t+r*r),h=2*Math.atan2(o,c),f=2*Math.atan2(t,r),_=2*Math.atan2(s,i),d=(f+_)/2,g=(f-_)/2;return e.set(g,h,d),e}toRotationMatrix(e){return se.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return Oe.FromRotationMatrixToRef(e,this),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}toAxisAngle(){const e=E.Zero(),t=this.toAxisAngleToRef(e);return{axis:e,angle:t}}toAxisAngleToRef(e){let t;const i=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),s=this._w;return i>0?(t=2*Math.atan2(i,s),e.set(this._x/i,this._y/i,this._z/i)):(t=0,e.set(1,0,0)),t}static FromRotationMatrix(e){const t=new Oe;return Oe.FromRotationMatrixToRef(e,t),t}static FromRotationMatrixToRef(e,t){const i=e.m,s=i[0],r=i[4],o=i[8],c=i[1],h=i[5],f=i[9],_=i[2],d=i[6],g=i[10],p=s+h+g;let x;return p>0?(x=.5/Math.sqrt(p+1),t._w=.25/x,t._x=(d-f)*x,t._y=(o-_)*x,t._z=(c-r)*x,t._isDirty=!0):s>h&&s>g?(x=2*Math.sqrt(1+s-h-g),t._w=(d-f)/x,t._x=.25*x,t._y=(r+c)/x,t._z=(o+_)/x,t._isDirty=!0):h>g?(x=2*Math.sqrt(1+h-s-g),t._w=(o-_)/x,t._x=(r+c)/x,t._y=.25*x,t._z=(f+d)/x,t._isDirty=!0):(x=2*Math.sqrt(1+g-s-h),t._w=(c-r)/x,t._x=(o+_)/x,t._y=(f+d)/x,t._z=.25*x,t._isDirty=!0),t}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w}static AreClose(e,t,i=.1){const s=Oe.Dot(e,t);return 1-s*s<=i}static SmoothToRef(e,t,i,s,r){let o=s===0?1:i/s;return o=_i(o,0,1),Oe.SlerpToRef(e,t,o,r),r}static Zero(){return new Oe(0,0,0,0)}static Inverse(e){return new Oe(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t}static Identity(){return new Oe(0,0,0,1)}static IsIdentity(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1}static RotationAxis(e,t){return Oe.RotationAxisToRef(e,t,new Oe)}static RotationAxisToRef(e,t,i){i._w=Math.cos(t/2);const s=Math.sin(t/2)/e.length();return i._x=e._x*s,i._y=e._y*s,i._z=e._z*s,i._isDirty=!0,i}static FromArray(e,t){return t||(t=0),new Oe(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._w=e[t+3],i._isDirty=!0,i}static FromFloatsToRef(e,t,i,s,r){return r.copyFromFloats(e,t,i,s),r}static FromEulerAngles(e,t,i){const s=new Oe;return Oe.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerAnglesToRef(e,t,i,s){return Oe.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerVector(e){const t=new Oe;return Oe.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){return Oe.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,i,s=Bt){const r=E.Dot(e,t)+1;return r<s?Math.abs(e.x)>Math.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(E.CrossToRef(e,t,fe.Vector3[0]),i.set(fe.Vector3[0].x,fe.Vector3[0].y,fe.Vector3[0].z,r)),i.normalize()}static RotationYawPitchRoll(e,t,i){const s=new Oe;return Oe.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){const r=i*.5,o=t*.5,c=e*.5,h=Math.sin(r),f=Math.cos(r),_=Math.sin(o),d=Math.cos(o),g=Math.sin(c),p=Math.cos(c);return s._x=p*_*f+g*d*h,s._y=g*d*f-p*_*h,s._z=p*d*h-g*_*f,s._w=p*d*f+g*_*h,s._isDirty=!0,s}static RotationAlphaBetaGamma(e,t,i){const s=new Oe;return Oe.RotationAlphaBetaGammaToRef(e,t,i,s),s}static RotationAlphaBetaGammaToRef(e,t,i,s){const r=(i+e)*.5,o=(i-e)*.5,c=t*.5;return s._x=Math.cos(o)*Math.sin(c),s._y=Math.sin(o)*Math.sin(c),s._z=Math.sin(r)*Math.cos(c),s._w=Math.cos(r)*Math.cos(c),s._isDirty=!0,s}static RotationQuaternionFromAxis(e,t,i){const s=new Oe(0,0,0,0);return Oe.RotationQuaternionFromAxisToRef(e,t,i,s),s}static RotationQuaternionFromAxisToRef(e,t,i,s){const r=Ie.Matrix[0];return e=e.normalizeToRef(Ie.Vector3[0]),t=t.normalizeToRef(Ie.Vector3[1]),i=i.normalizeToRef(Ie.Vector3[2]),se.FromXYZAxesToRef(e,t,i,r),Oe.FromRotationMatrixToRef(r,s),s}static FromLookDirectionLH(e,t){const i=new Oe;return Oe.FromLookDirectionLHToRef(e,t,i),i}static FromLookDirectionLHToRef(e,t,i){const s=Ie.Matrix[0];return se.LookDirectionLHToRef(e,t,s),Oe.FromRotationMatrixToRef(s,i),i}static FromLookDirectionRH(e,t){const i=new Oe;return Oe.FromLookDirectionRHToRef(e,t,i),i}static FromLookDirectionRHToRef(e,t,i){const s=Ie.Matrix[0];return se.LookDirectionRHToRef(e,t,s),Oe.FromRotationMatrixToRef(s,i)}static Slerp(e,t,i){const s=Oe.Identity();return Oe.SlerpToRef(e,t,i,s),s}static SlerpToRef(e,t,i,s){let r,o,c=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,h=!1;if(c<0&&(h=!0,c=-c),c>.999999)o=1-i,r=h?-i:i;else{const f=Math.acos(c),_=1/Math.sin(f);o=Math.sin((1-i)*f)*_,r=h?-Math.sin(i*f)*_:Math.sin(i*f)*_}return s._x=o*e._x+r*t._x,s._y=o*e._y+r*t._y,s._z=o*e._z+r*t._z,s._w=o*e._w+r*t._w,s._isDirty=!0,s}static Hermite(e,t,i,s,r){const o=r*r,c=r*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+r,d=c-o,g=e._x*h+i._x*f+t._x*_+s._x*d,p=e._y*h+i._y*f+t._y*_+s._y*d,x=e._z*h+i._z*f+t._z*_+s._z*d,b=e._w*h+i._w*f+t._w*_+s._w*d;return new Oe(g,p,x,b)}static Hermite1stDerivative(e,t,i,s,r){const o=new Oe;return this.Hermite1stDerivativeToRef(e,t,i,s,r,o),o}static Hermite1stDerivativeToRef(e,t,i,s,r,o){const c=r*r;return o._x=(c-r)*6*e._x+(3*c-4*r+1)*t._x+(-c+r)*6*i._x+(3*c-2*r)*s._x,o._y=(c-r)*6*e._y+(3*c-4*r+1)*t._y+(-c+r)*6*i._y+(3*c-2*r)*s._y,o._z=(c-r)*6*e._z+(3*c-4*r+1)*t._z+(-c+r)*6*i._z+(3*c-2*r)*s._z,o._w=(c-r)*6*e._w+(3*c-4*r+1)*t._w+(-c+r)*6*i._w+(3*c-2*r)*s._w,o._isDirty=!0,o}static Normalize(e){const t=Oe.Zero();return Oe.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Clamp(e,t,i){const s=new Oe;return Oe.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){return s.copyFromFloats(_i(e.x,t.x,i.x),_i(e.y,t.y,i.y),_i(e.z,t.z,i.z),_i(e.w,t.w,i.w))}static Random(e=0,t=1){return new Oe(ci(e,t),ci(e,t),ci(e,t),ci(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(ci(e,t),ci(e,t),ci(e,t),ci(e,t))}static Minimize(){throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,t){return Math.sqrt(Oe.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,r=e.z-t.z,o=e.w-t.w;return i*i+s*s+r*r+o*o}static Center(e,t){return Oe.CenterToRef(e,t,Oe.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)}}Oe._V8PerformanceHack=new Oe(.5,.5,.5,.5);class se{static get Use64Bits(){return Si.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=$d._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,t=!1,i=!1,s=!0){this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:s}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,Si.MatrixTrackPrecisionChange&&Si.MatrixTrackedMatrices.push(this),this._m=new Si.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;const e=this._m;this._isIdentity=e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(this._isIdentity===!0)return 1;const e=this._m,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],c=e[5],h=e[6],f=e[7],_=e[8],d=e[9],g=e[10],p=e[11],x=e[12],b=e[13],T=e[14],R=e[15],S=g*R-T*p,M=d*R-b*p,I=d*T-b*g,A=_*R-x*p,D=_*T-g*x,C=_*b-x*d,k=+(c*S-h*M+f*I),H=-(o*S-h*A+f*D),L=+(o*M-c*A+f*C),J=-(o*I-c*D+h*C);return t*k+i*H+s*L+r*J}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
152${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
153${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
154${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(e=null,t=0){if(!e)return this._m;const i=this._m;for(let s=0;s<16;s++)e[t+s]=i[s];return this}asArray(){return this._m}fromArray(e,t=0){return se.FromArrayToRef(e,t,this)}copyFromFloats(...e){return se.FromArrayToRef(e,0,this)}set(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=e[i];return this.markAsUpdated(),this}setAll(e){const t=this._m;for(let i=0;i<16;i++)t[i]=e;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return se.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(e){const t=new se;return this.addToRef(e,t),t}addToRef(e,t){const i=this._m,s=t._m,r=e.m;for(let o=0;o<16;o++)s[o]=i[o]+r[o];return t.markAsUpdated(),t}addToSelf(e){const t=this._m,i=e.m;return t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],t[3]+=i[3],t[4]+=i[4],t[5]+=i[5],t[6]+=i[6],t[7]+=i[7],t[8]+=i[8],t[9]+=i[9],t[10]+=i[10],t[11]+=i[11],t[12]+=i[12],t[13]+=i[13],t[14]+=i[14],t[15]+=i[15],this.markAsUpdated(),this}addInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]+=i[s];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]+=e[i];return this.markAsUpdated(),this}subtract(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractToRef(e,t){const i=this._m,s=e.m,r=t._m;for(let o=0;o<16;o++)r[o]=i[o]-s[o];return t.markAsUpdated(),t}subtractInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractFromFloats(...e){return this.subtractFromFloatsToRef(...e,new se)}subtractFromFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,r=e;for(let o=0;o<16;o++)s[o]=i[o]-r[o];return t.markAsUpdated(),t}invertToRef(e){return this._isIdentity===!0?(se.IdentityToRef(e),e):(i1(this,e.asArray())?e.markAsUpdated():e.copyFrom(this),e)}addAtIndex(e,t){return this._m[e]+=t,this.markAsUpdated(),this}multiplyAtIndex(e,t){return this._m[e]*=t,this.markAsUpdated(),this}setTranslationFromFloats(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this.markAsUpdated(),this}addTranslationFromFloats(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this.markAsUpdated(),this}setTranslation(e){return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){return new E(this._m[12],this._m[13],this._m[14])}getTranslationToRef(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e}removeRotationAndScaling(){const e=this.m;return se.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1),this}copyFrom(e){e.copyToArray(this._m);const t=e;return this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(e,t=0){return XD(this,e,t),this}multiply(e){const t=new se;return this.multiplyToRef(e,t),t}multiplyInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]*=i[s];return this.markAsUpdated(),this}multiplyByFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e[i];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,r=e;for(let o=0;o<16;o++)s[o]=i[o]*r[o];return t.markAsUpdated(),t}multiplyToRef(e,t){return this._isIdentity?(t.copyFrom(e),t):e._isIdentity?(t.copyFrom(this),t):(this.multiplyToArray(e,t._m,0),t.markAsUpdated(),t)}multiplyToArray(e,t,i){return t1(this,e,t,i),this}divide(e){return this.divideToRef(e,new se)}divideToRef(e,t){const i=this._m,s=e.m,r=t._m;for(let o=0;o<16;o++)r[o]=i[o]/s[o];return t.markAsUpdated(),t}divideInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]/=i[s];return this.markAsUpdated(),this}minimizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}maximizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new se)}negateInPlace(){const e=this._m;for(let t=0;t<16;t++)e[t]=-e[t];return this.markAsUpdated(),this}negateToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=-t[s];return e.markAsUpdated(),e}equals(e){const t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;const i=this.m,s=t.m;return i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]&&i[3]===s[3]&&i[4]===s[4]&&i[5]===s[5]&&i[6]===s[6]&&i[7]===s[7]&&i[8]===s[8]&&i[9]===s[9]&&i[10]===s[10]&&i[11]===s[11]&&i[12]===s[12]&&i[13]===s[13]&&i[14]===s[14]&&i[15]===s[15]}equalsWithEpsilon(e,t=0){const i=this._m,s=e.m;for(let r=0;r<16;r++)if(!wt(i[r],s[r],t))return!1;return!0}equalsToFloats(...e){const t=this._m;for(let i=0;i<16;i++)if(t[i]!=e[i])return!1;return!0}floor(){return this.floorToRef(new se)}floorToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=Math.floor(t[s]);return e.markAsUpdated(),e}fract(){return this.fractToRef(new se)}fractToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=t[s]-Math.floor(t[s]);return e.markAsUpdated(),e}clone(){const e=new se;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=ts(this._m[0]);for(let t=1;t<16;t++)e=e*397^ts(this._m[t]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new Oe,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,i,s,r=!0){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const o=this._m;if(i&&i.copyFromFloats(o[12],o[13],o[14]),e=e||Ie.Vector3[0],e.x=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]),e.y=Math.sqrt(o[4]*o[4]+o[5]*o[5]+o[6]*o[6]),e.z=Math.sqrt(o[8]*o[8]+o[9]*o[9]+o[10]*o[10]),s){const c=(r?s.absoluteScaling.x:s.scaling.x)<0?-1:1,h=(r?s.absoluteScaling.y:s.scaling.y)<0?-1:1,f=(r?s.absoluteScaling.z:s.scaling.z)<0?-1:1;e.x*=c,e.y*=h,e.z*=f}else this.determinant()<=0&&(e.y*=-1);if(e._x===0||e._y===0||e._z===0)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){const c=1/e._x,h=1/e._y,f=1/e._z;se.FromValuesToRef(o[0]*c,o[1]*c,o[2]*c,0,o[4]*h,o[5]*h,o[6]*h,0,o[8]*f,o[9]*f,o[10]*f,0,0,0,0,1,Ie.Matrix[0]),Oe.FromRotationMatrixToRef(Ie.Matrix[0],t)}return!0}getRow(e){if(e<0||e>3)return null;const t=e*4;return new it(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])}getRowToRef(e,t){if(e>=0&&e<=3){const i=e*4;t.x=this._m[i+0],t.y=this._m[i+1],t.z=this._m[i+2],t.w=this._m[i+3]}return t}setRow(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)}transpose(){const e=new se;return se.TransposeToRef(this,e),e}transposeToRef(e){return se.TransposeToRef(this,e),e}setRowFromFloats(e,t,i,s,r){if(e<0||e>3)return this;const o=e*4;return this._m[o+0]=t,this._m[o+1]=i,this._m[o+2]=s,this._m[o+3]=r,this.markAsUpdated(),this}scale(e){const t=new se;return this.scaleToRef(e,t),t}scaleToRef(e,t){for(let i=0;i<16;i++)t._m[i]=this._m[i]*e;return t.markAsUpdated(),t}scaleAndAddToRef(e,t){for(let i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t.markAsUpdated(),t}scaleInPlace(e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){const t=Ie.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const i=e._m;return se.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,e),e}getRotationMatrix(){const e=new se;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){const t=Ie.Vector3[0];if(!this.decompose(t))return se.IdentityToRef(e),e;const i=this._m,s=1/t._x,r=1/t._y,o=1/t._z;return se.FromValuesToRef(i[0]*s,i[1]*s,i[2]*s,0,i[4]*r,i[5]*r,i[6]*r,0,i[8]*o,i[9]*o,i[10]*o,0,0,0,0,1,e),e}toggleModelMatrixHandInPlace(){const e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){const e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this}_convertProjectionToHalfZRangeInPlace(){return this.multiplyToRef(gr,this),this}static FromArray(e,t=0){const i=new se;return se.FromArrayToRef(e,t,i),i}static FromArrayToRef(e,t,i){for(let s=0;s<16;s++)i._m[s]=e[s+t];return i.markAsUpdated(),i}static FromFloat32ArrayToRefScaled(e,t,i,s){return s._m[0]=e[0+t]*i,s._m[1]=e[1+t]*i,s._m[2]=e[2+t]*i,s._m[3]=e[3+t]*i,s._m[4]=e[4+t]*i,s._m[5]=e[5+t]*i,s._m[6]=e[6+t]*i,s._m[7]=e[7+t]*i,s._m[8]=e[8+t]*i,s._m[9]=e[9+t]*i,s._m[10]=e[10+t]*i,s._m[11]=e[11+t]*i,s._m[12]=e[12+t]*i,s._m[13]=e[13+t]*i,s._m[14]=e[14+t]*i,s._m[15]=e[15+t]*i,s.markAsUpdated(),s}static get IdentityReadOnly(){return se._IdentityReadOnly}static FromValuesToRef(e,t,i,s,r,o,c,h,f,_,d,g,p,x,b,T,R){const S=R._m;S[0]=e,S[1]=t,S[2]=i,S[3]=s,S[4]=r,S[5]=o,S[6]=c,S[7]=h,S[8]=f,S[9]=_,S[10]=d,S[11]=g,S[12]=p,S[13]=x,S[14]=b,S[15]=T,R.markAsUpdated()}static FromValues(e,t,i,s,r,o,c,h,f,_,d,g,p,x,b,T){const R=new se,S=R._m;return S[0]=e,S[1]=t,S[2]=i,S[3]=s,S[4]=r,S[5]=o,S[6]=c,S[7]=h,S[8]=f,S[9]=_,S[10]=d,S[11]=g,S[12]=p,S[13]=x,S[14]=b,S[15]=T,R.markAsUpdated(),R}static Compose(e,t,i){const s=new se;return se.ComposeToRef(e,t,i,s),s}static ComposeToRef(e,t,i,s){const r=s._m,o=t._x,c=t._y,h=t._z,f=t._w,_=o+o,d=c+c,g=h+h,p=o*_,x=o*d,b=o*g,T=c*d,R=c*g,S=h*g,M=f*_,I=f*d,A=f*g,D=e._x,C=e._y,k=e._z;return r[0]=(1-(T+S))*D,r[1]=(x+A)*D,r[2]=(b-I)*D,r[3]=0,r[4]=(x-A)*C,r[5]=(1-(p+S))*C,r[6]=(R+M)*C,r[7]=0,r[8]=(b+I)*k,r[9]=(R-M)*k,r[10]=(1-(p+T))*k,r[11]=0,r[12]=i._x,r[13]=i._y,r[14]=i._z,r[15]=1,s.markAsUpdated(),s}static Identity(){const e=se.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e}static IdentityToRef(e){return se.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0),e}static Zero(){const e=se.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e}static RotationX(e){const t=new se;return se.RotationXToRef(e,t),t}static Invert(e){const t=new se;return e.invertToRef(t),t}static RotationXToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return se.FromValuesToRef(1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationY(e){const t=new se;return se.RotationYToRef(e,t),t}static RotationYToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return se.FromValuesToRef(s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationZ(e){const t=new se;return se.RotationZToRef(e,t),t}static RotationZToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return se.FromValuesToRef(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationAxis(e,t){const i=new se;return se.RotationAxisToRef(e,t,i),i}static RotationAxisToRef(e,t,i){const s=Math.sin(-t),r=Math.cos(-t),o=1-r;e=e.normalizeToRef(Ie.Vector3[0]);const c=i._m;return c[0]=e._x*e._x*o+r,c[1]=e._x*e._y*o-e._z*s,c[2]=e._x*e._z*o+e._y*s,c[3]=0,c[4]=e._y*e._x*o+e._z*s,c[5]=e._y*e._y*o+r,c[6]=e._y*e._z*o-e._x*s,c[7]=0,c[8]=e._z*e._x*o-e._y*s,c[9]=e._z*e._y*o+e._x*s,c[10]=e._z*e._z*o+r,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,i.markAsUpdated(),i}static RotationAlignToRef(e,t,i,s=!1){const r=E.Dot(t,e),o=i._m;if(r<-1+Bt)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s?1:-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s?-1:1,o[11]=0;else{const c=E.Cross(t,e),h=1/(1+r);o[0]=c._x*c._x*h+r,o[1]=c._y*c._x*h-c._z,o[2]=c._z*c._x*h+c._y,o[3]=0,o[4]=c._x*c._y*h+c._z,o[5]=c._y*c._y*h+r,o[6]=c._z*c._y*h-c._x,o[7]=0,o[8]=c._x*c._z*h-c._y,o[9]=c._y*c._z*h+c._x,o[10]=c._z*c._z*h+r,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,t,i){const s=new se;return se.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){return Oe.RotationYawPitchRollToRef(e,t,i,Ie.Quaternion[0]),Ie.Quaternion[0].toRotationMatrix(s),s}static Scaling(e,t,i){const s=new se;return se.ScalingToRef(e,t,i,s),s}static ScalingToRef(e,t,i,s){return se.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,s),s._updateIdentityStatus(e===1&&t===1&&i===1),s}static Translation(e,t,i){const s=new se;return se.TranslationToRef(e,t,i,s),s}static TranslationToRef(e,t,i,s){return se.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,s),s._updateIdentityStatus(e===0&&t===0&&i===0),s}static Lerp(e,t,i){const s=new se;return se.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){const r=s._m,o=e.m,c=t.m;for(let h=0;h<16;h++)r[h]=o[h]*(1-i)+c[h]*i;return s.markAsUpdated(),s}static DecomposeLerp(e,t,i){const s=new se;return se.DecomposeLerpToRef(e,t,i,s),s}static DecomposeLerpToRef(e,t,i,s){const r=Ie.Vector3[0],o=Ie.Quaternion[0],c=Ie.Vector3[1];e.decompose(r,o,c);const h=Ie.Vector3[2],f=Ie.Quaternion[1],_=Ie.Vector3[3];t.decompose(h,f,_);const d=Ie.Vector3[4];E.LerpToRef(r,h,i,d);const g=Ie.Quaternion[2];Oe.SlerpToRef(o,f,i,g);const p=Ie.Vector3[5];return E.LerpToRef(c,_,i,p),se.ComposeToRef(d,g,p,s),s}static LookAtLH(e,t,i){const s=new se;return se.LookAtLHToRef(e,t,i,s),s}static LookAtLHToRef(e,t,i,s){const r=Ie.Vector3[0],o=Ie.Vector3[1],c=Ie.Vector3[2];t.subtractToRef(e,c),c.normalize(),E.CrossToRef(i,c,r);const h=r.lengthSquared();h===0?r.x=1:r.normalizeFromLength(Math.sqrt(h)),E.CrossToRef(c,r,o),o.normalize();const f=-E.Dot(r,e),_=-E.Dot(o,e),d=-E.Dot(c,e);return se.FromValuesToRef(r._x,o._x,c._x,0,r._y,o._y,c._y,0,r._z,o._z,c._z,0,f,_,d,1,s),s}static LookAtRH(e,t,i){const s=new se;return se.LookAtRHToRef(e,t,i,s),s}static LookAtRHToRef(e,t,i,s){const r=Ie.Vector3[0],o=Ie.Vector3[1],c=Ie.Vector3[2];e.subtractToRef(t,c),c.normalize(),E.CrossToRef(i,c,r);const h=r.lengthSquared();h===0?r.x=1:r.normalizeFromLength(Math.sqrt(h)),E.CrossToRef(c,r,o),o.normalize();const f=-E.Dot(r,e),_=-E.Dot(o,e),d=-E.Dot(c,e);return se.FromValuesToRef(r._x,o._x,c._x,0,r._y,o._y,c._y,0,r._z,o._z,c._z,0,f,_,d,1,s),s}static LookDirectionLH(e,t){const i=new se;return se.LookDirectionLHToRef(e,t,i),i}static LookDirectionLHToRef(e,t,i){const s=Ie.Vector3[0];s.copyFrom(e),s.scaleInPlace(-1);const r=Ie.Vector3[1];return E.CrossToRef(t,s,r),se.FromValuesToRef(r._x,r._y,r._z,0,t._x,t._y,t._z,0,s._x,s._y,s._z,0,0,0,0,1,i),i}static LookDirectionRH(e,t){const i=new se;return se.LookDirectionRHToRef(e,t,i),i}static LookDirectionRHToRef(e,t,i){const s=Ie.Vector3[2];return E.CrossToRef(t,e,s),se.FromValuesToRef(s._x,s._y,s._z,0,t._x,t._y,t._z,0,e._x,e._y,e._z,0,0,0,0,1,i),i}static OrthoLH(e,t,i,s,r){const o=new se;return se.OrthoLHToRef(e,t,i,s,o,r),o}static OrthoLHToRef(e,t,i,s,r,o){const c=i,h=s,f=2/e,_=2/t,d=2/(h-c),g=-(h+c)/(h-c);return se.FromValuesToRef(f,0,0,0,0,_,0,0,0,0,d,0,0,0,g,1,r),o&&r.multiplyToRef(gr,r),r._updateIdentityStatus(f===1&&_===1&&d===1&&g===0),r}static OrthoOffCenterLH(e,t,i,s,r,o,c){const h=new se;return se.OrthoOffCenterLHToRef(e,t,i,s,r,o,h,c),h}static OrthoOffCenterLHToRef(e,t,i,s,r,o,c,h){const f=r,_=o,d=2/(t-e),g=2/(s-i),p=2/(_-f),x=-(_+f)/(_-f),b=(e+t)/(e-t),T=(s+i)/(i-s);return se.FromValuesToRef(d,0,0,0,0,g,0,0,0,0,p,0,b,T,x,1,c),h&&c.multiplyToRef(gr,c),c.markAsUpdated(),c}static ObliqueOffCenterLHToRef(e,t,i,s,r,o,c,h,f,_,d){const g=-c*Math.cos(h),p=-c*Math.sin(h);return se.TranslationToRef(0,0,-f,Ie.Matrix[1]),se.FromValuesToRef(1,0,0,0,0,1,0,0,g,p,1,0,0,0,0,1,Ie.Matrix[0]),Ie.Matrix[1].multiplyToRef(Ie.Matrix[0],Ie.Matrix[0]),se.TranslationToRef(0,0,f,Ie.Matrix[1]),Ie.Matrix[0].multiplyToRef(Ie.Matrix[1],Ie.Matrix[0]),se.OrthoOffCenterLHToRef(e,t,i,s,r,o,_,d),Ie.Matrix[0].multiplyToRef(_,_),_}static OrthoOffCenterRH(e,t,i,s,r,o,c){const h=new se;return se.OrthoOffCenterRHToRef(e,t,i,s,r,o,h,c),h}static OrthoOffCenterRHToRef(e,t,i,s,r,o,c,h){return se.OrthoOffCenterLHToRef(e,t,i,s,r,o,c,h),c._m[10]*=-1,c}static ObliqueOffCenterRHToRef(e,t,i,s,r,o,c,h,f,_,d){const g=c*Math.cos(h),p=c*Math.sin(h);return se.TranslationToRef(0,0,f,Ie.Matrix[1]),se.FromValuesToRef(1,0,0,0,0,1,0,0,g,p,1,0,0,0,0,1,Ie.Matrix[0]),Ie.Matrix[1].multiplyToRef(Ie.Matrix[0],Ie.Matrix[0]),se.TranslationToRef(0,0,-f,Ie.Matrix[1]),Ie.Matrix[0].multiplyToRef(Ie.Matrix[1],Ie.Matrix[0]),se.OrthoOffCenterRHToRef(e,t,i,s,r,o,_,d),Ie.Matrix[0].multiplyToRef(_,_),_}static PerspectiveLH(e,t,i,s,r,o=0){const c=new se,h=i,f=s,_=2*h/e,d=2*h/t,g=(f+h)/(f-h),p=-2*f*h/(f-h),x=Math.tan(o);return se.FromValuesToRef(_,0,0,0,0,d,0,x,0,0,g,1,0,0,p,0,c),r&&c.multiplyToRef(gr,c),c._updateIdentityStatus(!1),c}static PerspectiveFovLH(e,t,i,s,r,o=0,c=!1){const h=new se;return se.PerspectiveFovLHToRef(e,t,i,s,h,!0,r,o,c),h}static PerspectiveFovLHToRef(e,t,i,s,r,o=!0,c,h=0,f=!1){const _=i,d=s,g=1/Math.tan(e*.5),p=o?g/t:g,x=o?g:g*t,b=f&&_===0?-1:d!==0?(d+_)/(d-_):1,T=f&&_===0?2*d:d!==0?-2*d*_/(d-_):-2*_,R=Math.tan(h);return se.FromValuesToRef(p,0,0,0,0,x,0,R,0,0,b,1,0,0,T,0,r),c&&r.multiplyToRef(gr,r),r._updateIdentityStatus(!1),r}static PerspectiveFovReverseLHToRef(e,t,i,s,r,o=!0,c,h=0){const f=1/Math.tan(e*.5),_=o?f/t:f,d=o?f:f*t,g=Math.tan(h);return se.FromValuesToRef(_,0,0,0,0,d,0,g,0,0,-i,1,0,0,1,0,r),c&&r.multiplyToRef(gr,r),r._updateIdentityStatus(!1),r}static PerspectiveFovRH(e,t,i,s,r,o=0,c=!1){const h=new se;return se.PerspectiveFovRHToRef(e,t,i,s,h,!0,r,o,c),h}static PerspectiveFovRHToRef(e,t,i,s,r,o=!0,c,h=0,f=!1){const _=i,d=s,g=1/Math.tan(e*.5),p=o?g/t:g,x=o?g:g*t,b=f&&_===0?1:d!==0?-(d+_)/(d-_):-1,T=f&&_===0?2*d:d!==0?-2*d*_/(d-_):-2*_,R=Math.tan(h);return se.FromValuesToRef(p,0,0,0,0,x,0,R,0,0,b,-1,0,0,T,0,r),c&&r.multiplyToRef(gr,r),r._updateIdentityStatus(!1),r}static PerspectiveFovReverseRHToRef(e,t,i,s,r,o=!0,c,h=0){const f=1/Math.tan(e*.5),_=o?f/t:f,d=o?f:f*t,g=Math.tan(h);return se.FromValuesToRef(_,0,0,0,0,d,0,g,0,0,-i,-1,0,0,-1,0,r),c&&r.multiplyToRef(gr,r),r._updateIdentityStatus(!1),r}static GetFinalMatrix(e,t,i,s,r,o){const c=e.width,h=e.height,f=e.x,_=e.y,d=se.FromValues(c/2,0,0,0,0,-h/2,0,0,0,0,o-r,0,f+c/2,h/2+_,r,1),g=new se;return t.multiplyToRef(i,g),g.multiplyToRef(s,g),g.multiplyToRef(d,g)}static GetAsMatrix2x2(e){const t=e.m,i=[t[0],t[1],t[4],t[5]];return Si.MatrixUse64Bits?i:new Float32Array(i)}static GetAsMatrix3x3(e){const t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return Si.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){const t=new se;return se.TransposeToRef(e,t),t}static TransposeToRef(e,t){const i=e.m,s=i[0],r=i[4],o=i[8],c=i[12],h=i[1],f=i[5],_=i[9],d=i[13],g=i[2],p=i[6],x=i[10],b=i[14],T=i[3],R=i[7],S=i[11],M=i[15],I=t._m;return I[0]=s,I[1]=r,I[2]=o,I[3]=c,I[4]=h,I[5]=f,I[6]=_,I[7]=d,I[8]=g,I[9]=p,I[10]=x,I[11]=b,I[12]=T,I[13]=R,I[14]=S,I[15]=M,t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){const t=new se;return se.ReflectionToRef(e,t),t}static ReflectionToRef(e,t){e.normalize();const i=e.normal.x,s=e.normal.y,r=e.normal.z,o=-2*i,c=-2*s,h=-2*r;return se.FromValuesToRef(o*i+1,c*i,h*i,0,o*s,c*s+1,h*s,0,o*r,c*r,h*r+1,0,o*e.d,c*e.d,h*e.d,1,t),t}static FromXYZAxesToRef(e,t,i,s){return se.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,s),s}static FromQuaternionToRef(e,t){const i=e._x*e._x,s=e._y*e._y,r=e._z*e._z,o=e._x*e._y,c=e._z*e._w,h=e._z*e._x,f=e._y*e._w,_=e._y*e._z,d=e._x*e._w;return t._m[0]=1-2*(s+r),t._m[1]=2*(o+c),t._m[2]=2*(h-f),t._m[3]=0,t._m[4]=2*(o-c),t._m[5]=1-2*(r+i),t._m[6]=2*(_+d),t._m[7]=0,t._m[8]=2*(h+f),t._m[9]=2*(_-d),t._m[10]=1-2*(s+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t}}se._IdentityReadOnly=se.Identity();class Ie{}Ie.Vector3=Mr(11,E.Zero);Ie.Matrix=Mr(2,se.Identity);Ie.Quaternion=Mr(3,Oe.Zero);class fe{}fe.Vector2=Mr(3,Ue.Zero);fe.Vector3=Mr(13,E.Zero);fe.Vector4=Mr(3,it.Zero);fe.Quaternion=Mr(3,Oe.Zero);fe.Matrix=Mr(8,se.Identity);const gr=se.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);let tb=!1;function qD(){tb||(tb=!0,Object.defineProperties(Ue.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(E.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(it.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(Oe.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(se.prototype,{dimension:{value:[4,4]},rank:{value:2}}),pr("BABYLON.Vector2",Ue),pr("BABYLON.Vector3",E),pr("BABYLON.Vector4",it),pr("BABYLON.Matrix",se))}var ib;(function(a){a[a.LOCAL=0]="LOCAL",a[a.WORLD=1]="WORLD",a[a.BONE=2]="BONE"})(ib||(ib={}));class ea{}ea.X=new E(1,0,0);ea.Y=new E(0,1,0);ea.Z=new E(0,0,1);var sb;(function(a){a[a.X=0]="X",a[a.Y=1]="Y",a[a.Z=2]="Z"})(sb||(sb={}));function ja(a){return Math.pow(a,zD)}function Ya(a){return a<=.04045?.0773993808*a:Math.pow(.947867299*(a+.055),2.4)}function Ka(a){return Math.pow(a,ND)}function Za(a){return a<=.0031308?12.92*a:1.055*Math.pow(a,.41666)-.055}class lt{constructor(e=0,t=0,i=0){this.r=e,this.g=t,this.b=i}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"}getClassName(){return"Color3"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this}fromArray(e,t=0){return lt.FromArrayToRef(e,t,this),this}toColor4(e=1){return new dt(this.r,this.g,this.b,e)}asArray(){return[this.r,this.g,this.b]}toLuminance(){return this.r*.3+this.g*.59+this.b*.11}multiply(e){return new lt(this.r*e.r,this.g*e.g,this.b*e.b)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyByFloats(e,t,i){return new lt(this.r*e,this.g*t,this.b*i)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.r,e.g,e.b)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.r,e.g,e.b)}minimizeInPlaceFromFloats(e,t,i){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this}maximizeInPlaceFromFloats(e,t,i){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b}equalsFloats(e,t,i){return this.equalsToFloats(e,t,i)}equalsToFloats(e,t,i){return this.r===e&&this.g===t&&this.b===i}equalsWithEpsilon(e,t=Bt){return wt(this.r,e.r,t)&&wt(this.g,e.g,t)&&wt(this.b,e.b,t)}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}scale(e){return new lt(this.r*e,this.g*e,this.b*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t}clampToRef(e=0,t=1,i){return i.r=_i(this.r,e,t),i.g=_i(this.g,e,t),i.b=_i(this.b,e,t),i}add(e){return new lt(this.r+e.r,this.g+e.g,this.b+e.b)}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addInPlaceFromFloats(e,t,i){return this.r+=e,this.g+=t,this.b+=i,this}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t}subtract(e){return new lt(this.r-e.r,this.g-e.g,this.b-e.b)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this}subtractFromFloats(e,t,i){return new lt(this.r-e,this.g-t,this.b-i)}subtractFromFloatsToRef(e,t,i,s){return s.r=this.r-e,s.g=this.g-t,s.b=this.b-i,s}clone(){return new lt(this.r,this.g,this.b)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyFromFloats(e,t,i){return this.r=e,this.g=t,this.b=i,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this.r=this.g=this.b=e,this}toHexString(){const e=Math.round(this.r*255),t=Math.round(this.g*255),i=Math.round(this.b*255);return"#"+nn(e)+nn(t)+nn(i)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,this)}toHSV(){return this.toHSVToRef(new lt)}toHSVToRef(e){const t=this.r,i=this.g,s=this.b,r=Math.max(t,i,s),o=Math.min(t,i,s);let c=0,h=0;const f=r,_=r-o;return r!==0&&(h=_/r),r!=o&&(r==t?(c=(i-s)/_,i<s&&(c+=6)):r==i?c=(s-t)/_+2:r==s&&(c=(t-i)/_+4),c*=60),e.r=c,e.g=h,e.b=f,e}toLinearSpace(e=!1){const t=new lt;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=Ya(this.r),e.g=Ya(this.g),e.b=Ya(this.b)):(e.r=ja(this.r),e.g=ja(this.g),e.b=ja(this.b)),this}toGammaSpace(e=!1){const t=new lt;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=Za(this.r),e.g=Za(this.g),e.b=Za(this.b)):(e.r=Ka(this.r),e.g=Ka(this.g),e.b=Ka(this.b)),this}static HSVtoRGBToRef(e,t,i,s){const r=i*t,o=e/60,c=r*(1-Math.abs(o%2-1));let h=0,f=0,_=0;o>=0&&o<=1?(h=r,f=c):o>=1&&o<=2?(h=c,f=r):o>=2&&o<=3?(f=r,_=c):o>=3&&o<=4?(f=c,_=r):o>=4&&o<=5?(h=c,_=r):o>=5&&o<=6&&(h=r,_=c);const d=i-r;return s.r=h+d,s.g=f+d,s.b=_+d,s}static FromHSV(e,t,i){const s=new lt(0,0,0);return lt.HSVtoRGBToRef(e,t,i,s),s}static FromHexString(e){return new lt(0,0,0).fromHexString(e)}static FromArray(e,t=0){return new lt(e[t],e[t+1],e[t+2])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2]}static FromInts(e,t,i){return new lt(e/255,t/255,i/255)}static Lerp(e,t,i){const s=new lt(0,0,0);return lt.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i}static Hermite(e,t,i,s,r){const o=r*r,c=r*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+r,d=c-o,g=e.r*h+i.r*f+t.r*_+s.r*d,p=e.g*h+i.g*f+t.g*_+s.g*d,x=e.b*h+i.b*f+t.b*_+s.b*d;return new lt(g,p,x)}static Hermite1stDerivative(e,t,i,s,r){const o=lt.Black();return this.Hermite1stDerivativeToRef(e,t,i,s,r,o),o}static Hermite1stDerivativeToRef(e,t,i,s,r,o){const c=r*r;o.r=(c-r)*6*e.r+(3*c-4*r+1)*t.r+(-c+r)*6*i.r+(3*c-2*r)*s.r,o.g=(c-r)*6*e.g+(3*c-4*r+1)*t.g+(-c+r)*6*i.g+(3*c-2*r)*s.g,o.b=(c-r)*6*e.b+(3*c-4*r+1)*t.b+(-c+r)*6*i.b+(3*c-2*r)*s.b}static Red(){return new lt(1,0,0)}static Green(){return new lt(0,1,0)}static Blue(){return new lt(0,0,1)}static Black(){return new lt(0,0,0)}static get BlackReadOnly(){return lt._BlackReadOnly}static White(){return new lt(1,1,1)}static Purple(){return new lt(.5,0,.5)}static Magenta(){return new lt(1,0,1)}static Yellow(){return new lt(1,1,0)}static Gray(){return new lt(.5,.5,.5)}static Teal(){return new lt(0,1,1)}static Random(){return new lt(Math.random(),Math.random(),Math.random())}}lt._V8PerformanceHack=new lt(.5,.5,.5);lt._BlackReadOnly=lt.Black();class dt{constructor(e=0,t=0,i=0,s=1){this.r=e,this.g=t,this.b=i,this.a=s}asArray(){return[this.r,this.g,this.b,this.a]}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}add(e){return new dt(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t.a=this.a+e.a,t}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this}addInPlaceFromFloats(e,t,i,s){return this.r+=e,this.g+=t,this.b+=i,this.a+=s,this}subtract(e){return new dt(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this.a-=e.a,this}subtractFromFloats(e,t,i,s){return new dt(this.r-e,this.g-t,this.b-i,this.a-s)}subtractFromFloatsToRef(e,t,i,s,r){return r.r=this.r-e,r.g=this.g-t,r.b=this.b-i,r.a=this.a-s,r}scale(e){return new dt(this.r*e,this.g*e,this.b*e,this.a*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this.a*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,t}clampToRef(e=0,t=1,i){return i.r=_i(this.r,e,t),i.g=_i(this.g,e,t),i.b=_i(this.b,e,t),i.a=_i(this.a,e,t),i}multiply(e){return new dt(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this.a*=e.a,this}multiplyByFloats(e,t,i,s){return new dt(this.r*e,this.g*t,this.b*i,this.a*s)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.r=Math.min(this.r,e.r),this.g=Math.min(this.g,e.g),this.b=Math.min(this.b,e.b),this.a=Math.min(this.a,e.a),this}maximizeInPlace(e){return this.r=Math.max(this.r,e.r),this.g=Math.max(this.g,e.g),this.b=Math.max(this.b,e.b),this.a=Math.max(this.a,e.a),this}minimizeInPlaceFromFloats(e,t,i,s){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this.a=Math.min(s,this.a),this}maximizeInPlaceFromFloats(e,t,i,s){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this.a=Math.max(s,this.a),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}equalsWithEpsilon(e,t=Bt){return wt(this.r,e.r,t)&&wt(this.g,e.g,t)&&wt(this.b,e.b,t)&&wt(this.a,e.a,t)}equalsToFloats(e,t,i,s){return this.r===e&&this.g===t&&this.b===i&&this.a===s}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"}getClassName(){return"Color4"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e=e*397^(this.a*255|0),e}clone(){return new dt().copyFrom(this)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromFloats(e,t,i,s){return this.r=e,this.g=t,this.b=i,this.a=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.r=this.g=this.b=this.a=e,this}toHexString(e=!1){const t=Math.round(this.r*255),i=Math.round(this.g*255),s=Math.round(this.b*255);if(e)return"#"+nn(t)+nn(i)+nn(s);const r=Math.round(this.a*255);return"#"+nn(t)+nn(i)+nn(s)+nn(r)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,e.length===9&&(this.a=parseInt(e.substring(7,9),16)/255),this)}toLinearSpace(e=!1){const t=new dt;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=Ya(this.r),e.g=Ya(this.g),e.b=Ya(this.b)):(e.r=ja(this.r),e.g=ja(this.g),e.b=ja(this.b)),e.a=this.a,this}toGammaSpace(e=!1){const t=new dt;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=Za(this.r),e.g=Za(this.g),e.b=Za(this.b)):(e.r=Ka(this.r),e.g=Ka(this.g),e.b=Ka(this.b)),e.a=this.a,this}static FromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?new dt(0,0,0,0):new dt(0,0,0,1).fromHexString(e)}static Lerp(e,t,i){return dt.LerpToRef(e,t,i,new dt)}static LerpToRef(e,t,i,s){return s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i,s.a=e.a+(t.a-e.a)*i,s}static Hermite(e,t,i,s,r){const o=r*r,c=r*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+r,d=c-o,g=e.r*h+i.r*f+t.r*_+s.r*d,p=e.g*h+i.g*f
154+t.g*_+s.g*d,x=e.b*h+i.b*f+t.b*_+s.b*d,b=e.a*h+i.a*f+t.a*_+s.a*d;return new dt(g,p,x,b)}static Hermite1stDerivative(e,t,i,s,r){const o=new dt;return this.Hermite1stDerivativeToRef(e,t,i,s,r,o),o}static Hermite1stDerivativeToRef(e,t,i,s,r,o){const c=r*r;o.r=(c-r)*6*e.r+(3*c-4*r+1)*t.r+(-c+r)*6*i.r+(3*c-2*r)*s.r,o.g=(c-r)*6*e.g+(3*c-4*r+1)*t.g+(-c+r)*6*i.g+(3*c-2*r)*s.g,o.b=(c-r)*6*e.b+(3*c-4*r+1)*t.b+(-c+r)*6*i.b+(3*c-2*r)*s.b,o.a=(c-r)*6*e.a+(3*c-4*r+1)*t.a+(-c+r)*6*i.a+(3*c-2*r)*s.a}static FromColor3(e,t=1){return new dt(e.r,e.g,e.b,t)}static FromArray(e,t=0){return new dt(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]}static FromInts(e,t,i,s){return new dt(e/255,t/255,i/255,s/255)}static CheckColors4(e,t){if(e.length===t*3){const i=[];for(let s=0;s<e.length;s+=3){const r=s/3*4;i[r]=e[s],i[r+1]=e[s+1],i[r+2]=e[s+2],i[r+3]=1}return i}return e}}dt._V8PerformanceHack=new dt(.5,.5,.5,.5);lt.Black;let nb=!1;function jD(){nb||(nb=!0,Object.defineProperties(lt.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(dt.prototype,{dimension:{value:[4]},rank:{value:1}}),pr("BABYLON.Color3",lt),pr("BABYLON.Color4",dt))}class an{constructor(e,t,i,s){this.normal=new E(e,t,i),this.d=s}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new an(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){return"Plane"}getHashCode(){let e=this.normal.getHashCode();return e=e*397^(this.d|0),e}normalize(){const e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z);let t=0;return e!==0&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this}transform(e){const t=an._TmpMatrix;e.invertToRef(t);const i=t.m,s=this.normal.x,r=this.normal.y,o=this.normal.z,c=this.d,h=s*i[0]+r*i[1]+o*i[2]+c*i[3],f=s*i[4]+r*i[5]+o*i[6]+c*i[7],_=s*i[8]+r*i[9]+o*i[10]+c*i[11],d=s*i[12]+r*i[13]+o*i[14]+c*i[15];return new an(h,f,_,d)}dotCoordinate(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,i){const s=t.x-e.x,r=t.y-e.y,o=t.z-e.z,c=i.x-e.x,h=i.y-e.y,f=i.z-e.z,_=r*f-o*h,d=o*c-s*f,g=s*h-r*c,p=Math.sqrt(_*_+d*d+g*g);let x;return p!==0?x=1/p:x=0,this.normal.x=_*x,this.normal.y=d*x,this.normal.z=g*x,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,t){return E.Dot(this.normal,e)<=t}signedDistanceTo(e){return E.Dot(e,this.normal)+this.d}static FromArray(e){return new an(e[0],e[1],e[2],e[3])}static FromPoints(e,t,i){const s=new an(0,0,0,0);return s.copyFromPoints(e,t,i),s}static FromPositionAndNormal(e,t){const i=new an(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,i)}static FromPositionAndNormalToRef(e,t,i){return i.normal.copyFrom(t),i.normal.normalize(),i.d=-e.dot(i.normal),i}static SignedDistanceToPlaneFromPositionAndNormal(e,t,i){const s=-(t.x*e.x+t.y*e.y+t.z*e.z);return E.Dot(i,t)+s}}an._TmpMatrix=se.Identity();class Ns{static GetPlanes(e){const t=[];for(let i=0;i<6;i++)t.push(new an(0,0,0,0));return Ns.GetPlanesToRef(e,t),t}static GetNearPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[2],t.normal.y=i[7]+i[6],t.normal.z=i[11]+i[10],t.d=i[15]+i[14],t.normalize()}static GetFarPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[2],t.normal.y=i[7]-i[6],t.normal.z=i[11]-i[10],t.d=i[15]-i[14],t.normalize()}static GetLeftPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[0],t.normal.y=i[7]+i[4],t.normal.z=i[11]+i[8],t.d=i[15]+i[12],t.normalize()}static GetRightPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[0],t.normal.y=i[7]-i[4],t.normal.z=i[11]-i[8],t.d=i[15]-i[12],t.normalize()}static GetTopPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[1],t.normal.y=i[7]-i[5],t.normal.z=i[11]-i[9],t.d=i[15]-i[13],t.normalize()}static GetBottomPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[1],t.normal.y=i[7]+i[5],t.normal.z=i[11]+i[9],t.d=i[15]+i[13],t.normalize()}static GetPlanesToRef(e,t){Ns.GetNearPlaneToRef(e,t[0]),Ns.GetFarPlaneToRef(e,t[1]),Ns.GetLeftPlaneToRef(e,t[2]),Ns.GetRightPlaneToRef(e,t[3]),Ns.GetTopPlaneToRef(e,t[4]),Ns.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){for(let i=0;i<6;i++)if(t[i].dotCoordinate(e)<0)return!1;return!0}}var rb;(function(a){a[a.CW=0]="CW",a[a.CCW=1]="CCW"})(rb||(rb={}));class on{constructor(e){this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return this._radians*180/Math.PI}radians(){return this._radians}static BetweenTwoPoints(e,t){const i=t.subtract(e),s=Math.atan2(i.y,i.x);return new on(s)}static BetweenTwoVectors(e,t){let i=e.lengthSquared()*t.lengthSquared();if(i===0)return new on(Math.PI/2);i=Math.sqrt(i);let s=e.dot(t)/i;s=_i(s,-1,1);const r=Math.acos(s);return new on(r)}static FromRadians(e){return new on(e)}static FromDegrees(e){return new on(e*Math.PI/180)}}class YD{constructor(e,t,i){this.startPoint=e,this.midPoint=t,this.endPoint=i;const s=Math.pow(t.x,2)+Math.pow(t.y,2),r=(Math.pow(e.x,2)+Math.pow(e.y,2)-s)/2,o=(s-Math.pow(i.x,2)-Math.pow(i.y,2))/2,c=(e.x-t.x)*(t.y-i.y)-(t.x-i.x)*(e.y-t.y);this.centerPoint=new Ue((r*(t.y-i.y)-o*(e.y-t.y))/c,((e.x-t.x)*o-(t.x-i.x)*r)/c),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=on.BetweenTwoPoints(this.centerPoint,this.startPoint);const h=this.startAngle.degrees();let f=on.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),_=on.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();f-h>180&&(f-=360),f-h<-180&&(f+=360),_-f>180&&(_-=360),_-f<-180&&(_+=360),this.orientation=f-h<0?0:1,this.angle=on.FromDegrees(this.orientation===0?h-_
154:_-h)}}class Th{constructor(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new Ue(e,t))}addLineTo(e,t){if(this.closed)return this;const i=new Ue(e,t),s=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(s).length(),this}addArcTo(e,t,i,s,r=36){if(this.closed)return this;const o=this._points[this._points.length-1],c=new Ue(e,t),h=new Ue(i,s),f=new YD(o,c,h);let _=f.angle.radians()/r;f.orientation===0&&(_*=-1);let d=f.startAngle.radians()+_;for(let g=0;g<r;g++){const p=Math.cos(d)*f.radius+f.centerPoint.x,x=Math.sin(d)*f.radius+f.centerPoint.y;this.addLineTo(p,x),d+=_}return this}addQuadraticCurveTo(e,t,i,s,r=36){if(this.closed)return this;const o=(h,f,_,d)=>(1-h)*(1-h)*f+2*h*(1-h)*_+h*h*d,c=this._points[this._points.length-1];for(let h=0;h<=r;h++){const f=h/r,_=o(f,c.x,e,i),d=o(f,c.y,t,s);this.addLineTo(_,d)}return this}addBezierCurveTo(e,t,i,s,r,o,c=36){if(this.closed)return this;const h=(_,d,g,p,x)=>(1-_)*(1-_)*(1-_)*d+3*_*(1-_)*(1-_)*g+3*_*_*(1-_)*p+_*_*_*x,f=this._points[this._points.length-1];for(let _=0;_<=c;_++){const d=_/c,g=h(d,f.x,e,i,r),p=h(d,f.y,t,s,o);this.addLineTo(g,p)}return this}isPointInside(e){let t=!1;const i=this._points.length;for(let s=i-1,r=0;r<i;s=r++){let o=this._points[s],c=this._points[r],h=c.x-o.x,f=c.y-o.y;if(Math.abs(f)>Number.EPSILON){if(f<0&&(o=this._points[r],h=-h,c=this._points[s],f=-f),e.y<o.y||e.y>c.y)continue;if(e.y===o.y&&e.x===o.x)return!0;{const _=f*(e.x-o.x)-h*(e.y-o.y);if(_===0)return!0;if(_<0)continue;t=!t}}else{if(e.y!==o.y)continue;if(c.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=c.x)return!0}}return t}close(){return this.closed=!0,this}length(){let e=this._length;if(this.closed){const t=this._points[this._points.length-1],i=this._points[0];e+=i.subtract(t).length()}return e}area(){const e=this._points.length;let t=0;for(let i=e-1,s=0;s<e;i=s++)t+=this._points[i].x*this._points[s].y-this._points[s].x*this._points[i].y;return t*.5}getPoints(){return this._points}getPointAtLengthPosition(e){if(e<0||e>1)return Ue.Zero();const t=e*this.length();let i=0;for(let s=0;s<this._points.length;s++){const r=(s+1)%this._points.length,o=this._points[s],h=this._points[r].subtract(o),f=h.length()+i;if(t>=i&&t<=f){const _=h.normalize(),d=t-i;return new Ue(o.x+_.x*d,o.y+_.y*d)}i=f}return Ue.Zero()}static StartingAt(e,t){return new Th(e,t)}}class hl{constructor(e,t=null,i,s=!1){this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:E.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:se.Identity()};for(let r=0;r<e.length;r++)this._curve[r]=e[r].clone();this._raw=i||!1,this._alignTangentsWithPath=s,this._compute(t,s)}getCurve(){return this._curve}getPoints(){return this._curve}length(){return this._distances[this._distances.length-1]}getTangents(){return this._tangents}getNormals(){return this._normals}getBinormals(){return this._binormals}getDistances(){return this._distances}getPointAt(e){return this._updatePointAtData(e).point}getTangentAt(e,t=!1){return this._updatePointAtData(e,t),t?E.TransformCoordinates(E.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(e,t=!1){return this._updatePointAtData(e,t),t?E.TransformCoordinates(E.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(e,t=!1){return this._updatePointAtData(e,t),t?E.TransformCoordinates(E.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(e){return this.length()*e}getPreviousPointIndexAt(e){return this._updatePointAtData(e),this._pointAtData.previousPointArrayIndex}getSubPositionAt(e){return this._updatePointAtData(e),this._pointAtData.subPosition}getClosestPositionTo(e){let t=Number.MAX_VALUE,i=0;for(let s=0;s<this._curve.length-1;s++){const r=this._curve[s+0],o=this._curve[s+1].subtract(r).normalize(),c=this._distances[s+1]-this._distances[s+0],h=Math.min(Math.max(E.Dot(o,e.subtract(r).normalize()),0)*E.Distance(r,e)/c,1),f=E.Distance(r.add(o.scale(h*c)),e);f<t&&(t=f,i=(this._distances[s+0]+c*h)/this.length())}return i}slice(e=0,t=1){if(e<0&&(e=1-e*-1%1),t<0&&(t=1-t*-1%1),e>t){const f=e;e=t,t=f}
154const i=this.getCurve(),s=this.getPointAt(e);let r=this.getPreviousPointIndexAt(e);const o=this.getPointAt(t),c=this.getPreviousPointIndexAt(t)+1,h=[];return e!==0&&(r++,h.push(s)),h.push(...i.slice(r,c)),(t!==1||e===1)&&h.push(o),new hl(h,this.getNormalAt(e),this._raw,this._alignTangentsWithPath)}update(e,t=null,i=!1){for(let s=0;s<e.length;s++)this._curve[s].x=e[s].x,this._curve[s].y=e[s].y,this._curve[s].z=e[s].z;return this._compute(t,i),this}_compute(e,t=!1){const i=this._curve.length;if(i<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[i-1]=this._curve[i-1].subtract(this._curve[i-2]),this._raw||this._tangents[i-1].normalize();const s=this._tangents[0],r=this._normalVector(s,e);this._normals[0]=r,this._raw||this._normals[0].normalize(),this._binormals[0]=E.Cross(s,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;let o,c,h,f,_;for(let d=1;d<i;d++)o=this._getLastNonNullVector(d),d<i-1&&(c=this._getFirstNonNullVector(d),this._tangents[d]=t?c:o.add(c),this._tangents[d].normalize()),this._distances[d]=this._distances[d-1]+this._curve[d].subtract(this._curve[d-1]).length(),h=this._tangents[d],_=this._binormals[d-1],this._normals[d]=E.Cross(_,h),this._raw||(this._normals[d].length()===0?(f=this._normals[d-1],this._normals[d]=f.clone()):this._normals[d].normalize()),this._binormals[d]=E.Cross(h,this._normals[d]),this._raw||this._binormals[d].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(e){let t=1,i=this._curve[e+t].subtract(this._curve[e]);for(;i.length()===0&&e+t+1<this._curve.length;)t++,i=this._curve[e+t].subtract(this._curve[e]);return i}_getLastNonNullVector(e){let t=1,i=this._curve[e].subtract(this._curve[e-t]);for(;i.length()===0&&e>t+1;)t++,i=this._curve[e].subtract(this._curve[e-t]);return i}_normalVector(e,t){let i,s=e.length();if(s===0&&(s=1),t==null){let r;wt(Math.abs(e.y)/s,1,Bt)?wt(Math.abs(e.x)/s,1,Bt)?wt(Math.abs(e.z)/s,1,Bt)?r=E.Zero():r=new E(0,0,1):r=new E(1,0,0):r=new E(0,-1,0),i=E.Cross(e,r)}else i=E.Cross(e,t),E.CrossToRef(i,e,i);return i.normalize(),i}_updatePointAtData(e,t=!1){if(this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;const i=this.getPoints();if(e<=0)return this._setPointAtData(0,0,i[0],0,t);if(e>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,t);let s=i[0],r,o=0;const c=e*this.length();for(let h=1;h<i.length;h++){r=i[h];const f=E.Distance(s,r);if(o+=f,o===c)return this._setPointAtData(e,1,r,h,t);if(o>c){const d=(o-c)/f,g=s.subtract(r),p=r.add(g.scaleInPlace(d));return this._setPointAtData(e,1-d,p,h-1,t)}s=r}return this._pointAtData}_setPointAtData(e,t,i,s,r){return this._pointAtData.point=i,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=s,this._pointAtData.interpolateReady=r,r&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=se.Identity();const e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){const t=e+1,i=this._tangents[e].clone(),s=this._normals[e].clone(),r=this._binormals[e].clone(),o=this._tangents[t].clone(),c=this._normals[t].clone(),h=this._binormals[t].clone(),f=Oe.RotationQuaternionFromAxis(s,r,i),_=Oe.RotationQuaternionFromAxis(c,h,o);Oe.Slerp(f,_,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class rn{constructor(e,t){this.width=e,this.height=t}toString(){return`{W: ${this.width}, H: ${this.height}}`}getClassName(){return"Size"}getHashCode(){let e=this.width|0;return e=e*397^(this.height|0),e}copyFrom(e){this.width=e.width,this.height=e.height}copyFromFloats(e,t){return this.width=e,this.height=t,this}set(e,t){return this.copyFromFloats(e,t)}multiplyByFloats(e,t){return new rn(this.width*e,this.height*t)}clone(){return new rn(this.width,this.height)}equals(e){return e?this.width===e.width&&this.height===e.height:!1}get surface(){return this.width*this.height}static Zero(){return new rn(0,0)}add(e){return new rn(this.width+e.width,this.height+e.height)}subtract(e){return new rn(this.width-e.width,this.height-e.height)}scale(e){return new rn(this.width*e,this.height*e)}static Lerp(e,t,i){const s=e.width+(t.width-e.width)*i,r=e.height+(t.height-e.height)*i;return new rn(s,r)}}class ih{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,t){return new ih(this.x*e,this.y*t,this.width*e,this.height*t)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new ih(this.x,this.y,this.width,this.height)}}const sn=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],KD=[()=>1,a=>a.y,a=>a.z,a=>a.x,a=>a.x*a.y,a=>a.y*a.z,a=>3*a.z*a.z-1,a=>a.x*a.z,a=>a.x*a.x-a.y*a.y],Fn=(a,e)=>sn[a]*KD[a](e),Bn=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4];class sh{constructor(){this.preScaled=!1,this.l00=E.Zero(),this.l1_1=E.Zero(),this.l10=E.Zero(),this.l11=E.Zero(),this.l2_2=E.Zero(),this.l2_1=E.Zero(),this.l20=E.Zero(),this.l21=E.Zero(),this.l22=E.Zero()}
vendor: 5,074 bytes, line 154
154addLight(e,t,i){fe.Vector3[0].set(t.r,t.g,t.b);const s=fe.Vector3[0],r=fe.Vector3[1];s.scaleToRef(i,r),r.scaleToRef(Fn(0,e),fe.Vector3[2]),this.l00.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(1,e),fe.Vector3[2]),this.l1_1.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(2,e),fe.Vector3[2]),this.l10.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(3,e),fe.Vector3[2]),this.l11.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(4,e),fe.Vector3[2]),this.l2_2.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(5,e),fe.Vector3[2]),this.l2_1.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(6,e),fe.Vector3[2]),this.l20.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(7,e),fe.Vector3[2]),this.l21.addInPlace(fe.Vector3[2]),r.scaleToRef(Fn(8,e),fe.Vector3[2]),this.l22.addInPlace(fe.Vector3[2])}scaleInPlace(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)}convertIncidentRadianceToIrradiance(){this.l00.scaleInPlace(Bn[0]),this.l1_1.scaleInPlace(Bn[1]),this.l10.scaleInPlace(Bn[2]),this.l11.scaleInPlace(Bn[3]),this.l2_2.scaleInPlace(Bn[4]),this.l2_1.scaleInPlace(Bn[5]),this.l20.scaleInPlace(Bn[6]),this.l21.scaleInPlace(Bn[7]),this.l22.scaleInPlace(Bn[8])}convertIrradianceToLambertianRadiance(){this.scaleInPlace(1/Math.PI)}preScaleForRendering(){this.preScaled=!0,this.l00.scaleInPlace(sn[0]),this.l1_1.scaleInPlace(sn[1]),this.l10.scaleInPlace(sn[2]),this.l11.scaleInPlace(sn[3]),this.l2_2.scaleInPlace(sn[4]),this.l2_1.scaleInPlace(sn[5]),this.l20.scaleInPlace(sn[6]),this.l21.scaleInPlace(sn[7]),this.l22.scaleInPlace(sn[8])}updateFromArray(e){return E.FromArrayToRef(e[0],0,this.l00),E.FromArrayToRef(e[1],0,this.l1_1),E.FromArrayToRef(e[2],0,this.l10),E.FromArrayToRef(e[3],0,this.l11),E.FromArrayToRef(e[4],0,this.l2_2),E.FromArrayToRef(e[5],0,this.l2_1),E.FromArrayToRef(e[6],0,this.l20),E.FromArrayToRef(e[7],0,this.l21),E.FromArrayToRef(e[8],0,this.l22),this}updateFromFloatsArray(e){return E.FromFloatsToRef(e[0],e[1],e[2],this.l00),E.FromFloatsToRef(e[3],e[4],e[5],this.l1_1),E.FromFloatsToRef(e[6],e[7],e[8],this.l10),E.FromFloatsToRef(e[9],e[10],e[11],this.l11),E.FromFloatsToRef(e[12],e[13],e[14],this.l2_2),E.FromFloatsToRef(e[15],e[16],e[17],this.l2_1),E.FromFloatsToRef(e[18],e[19],e[20],this.l20),E.FromFloatsToRef(e[21],e[22],e[23],this.l21),E.FromFloatsToRef(e[24],e[25],e[26],this.l22),this}static FromArray(e){return new sh().updateFromArray(e)}static FromPolynomial(e){const t=new sh;return t.l00=e.xx.scale(.376127).add(e.yy.scale(.376127)).add(e.zz.scale(.376126)),t.l1_1=e.y.scale(.977204),t.l10=e.z.scale(.977204),t.l11=e.x.scale(.977204),t.l2_2=e.xy.scale(1.16538),t.l2_1=e.yz.scale(1.16538),t.l20=e.zz.scale(1.34567).subtract(e.xx.scale(.672834)).subtract(e.yy.scale(.672834)),t.l21=e.zx.scale(1.16538),t.l22=e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)),t.l1_1.scaleInPlace(-1),t.l11.scaleInPlace(-1),t.l2_1.scaleInPlace(-1),t.l21.scaleInPlace(-1),t.scaleInPlace(Math.PI),t}}class nh{constructor(){this.x=E.Zero(),this.y=E.Zero(),this.z=E.Zero(),this.xx=E.Zero(),this.yy=E.Zero(),this.zz=E.Zero(),this.xy=E.Zero(),this.yz=E.Zero(),this.zx=E.Zero()}get preScaledHarmonics(){return this._harmonics||(this._harmonics=sh.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics}addAmbient(e){fe.Vector3[0].copyFromFloats(e.r,e.g,e.b);const t=fe.Vector3[0];this.xx.addInPlace(t),this.yy.addInPlace(t),this.zz.addInPlace(t)}scaleInPlace(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)}updateFromHarmonics(e){return this._harmonics=e,this.x.copyFrom(e.l11),this.x.scaleInPlace(1.02333).scaleInPlace(-1),this.y.copyFrom(e.l1_1),this.y.scaleInPlace(1.02333).scaleInPlace(-1),this.z.copyFrom(e.l10),this.z.scaleInPlace(1.02333),this.xx.copyFrom(e.l00),fe.Vector3[0].copyFrom(e.l20).scaleInPlace(.247708),fe.Vector3[1].copyFrom(e.l22).scaleInPlace(.429043),this.xx.scaleInPlace(.886277).subtractInPlace(fe.Vector3[0]).addInPlace(fe.Vector3[1]),this.yy.copyFrom(e.l00),this.yy.scaleInPlace(.886277).subtractInPlace(fe.Vector3[0]).subtractInPlace(fe.Vector3[1]),this.zz.copyFrom(e.l00),fe.Vector3[0].copyFrom(e.l20).scaleInPlace(.495417),this.zz.scaleInPlace(.886277).addInPlace(fe.Vector3[0]),this.yz.copyFrom(e.l2_1),this.yz.scaleInPlace(.858086).scaleInPlace(-1),this.zx.copyFrom(e.l21),this.zx.scaleInPlace(.858086).scaleInPlace(-1),this.xy.copyFrom(e.l2_2),this.xy.scaleInPlace(.858086),this.scaleInPlace(1/Math.PI),this}static FromHarmonics(e){return new nh().updateFromHarmonics(e)}static FromArray(e){const t=new nh;return E.FromArrayToRef(e[0],0,t.x),E.FromArrayToRef(e[1],0,t.y),E.FromArrayToRef(e[2],0,t.z),E.FromArrayToRef(e[3],0,t.xx),E.FromArrayToRef(e[4],0,t.yy),E.FromArrayToRef(e[5],0,t.zz),E.FromArrayToRef(e[6],0,t.yz),E.FromArrayToRef(e[7],0,t.zx),E.FromArrayToRef(e[8],0,t.xy),t}}
154function he(a,e,t,i,s,r){function o(R){if(R!==void 0&&typeof R!="function")throw new TypeError("Function expected");return R}for(var c=i.kind,h=c==="getter"?"get":c==="setter"?"set":"value",f=!e&&a?i.static?a:a.prototype:null,_=e||(f?Object.getOwnPropertyDescriptor(f,i.name):{}),d,g=!1,p=t.length-1;p>=0;p--){var x={};for(var b in i)x[b]=b==="access"?{}:i[b];for(var b in i.access)x.access[b]=i.access[b];x.addInitializer=function(R){if(g)throw new TypeError("Cannot add initializers after decoration has completed");r.push(o(R||null))};var T=(0,t[p])(c==="accessor"?{get:_.get,set:_.set}:_[h],x);if(c==="accessor"){if(T===void 0)continue;if(T===null||typeof T!="object")throw new TypeError("Object expected");(d=o(T.get))&&(_.get=d),(d=o(T.set))&&(_.set=d),(d=o(T.init))&&s.unshift(d)}else(d=o(T))&&(c==="field"?s.unshift(d):_[h]=d)}f&&Object.defineProperty(f,i.name,_),g=!0}function Z(a,e,t){for(var i=arguments.length>2,s=0;s<e.length;s++)t=i?e[s].call(a,t):e[s].call(a);return i?t:void 0}const tl="__bjs_serializable__",ab=new WeakMap;function n1(a,e){return Object.prototype.hasOwnProperty.call(a,e)}function ZD(){let a=Symbol.metadata;return a||(a=Symbol("Symbol.metadata"),Object.defineProperty(Symbol,"metadata",{configurable:!0,writable:!0,value:a})),a}const r1=ZD();function QD(a){return typeof a=="function"?a:a?.constructor}function $D(a){if(!a)throw new Error(`Decorator metadata is unavailable; the Symbol.metadata (${String(r1)}) polyfill must run before decorated classes are evaluated.`);return n1(a,tl)||(a[tl]={}),a[tl]}function Cd(a){const e=QD(a),t=e?e[r1]:void 0;if(!t)return{};const i=ab.get(t);if(i)return i;const s={},r=[];let o=t;for(;o;)r.push(o),o=Object.getPrototypeOf(o);for(const c of r)if(n1(c,tl)){const h=c[tl];for(const f in h)s[f]=h[f]}return ab.set(t,s),s}function na(a,e){return(t,i)=>{if(!i.metadata)return;const s=String(i.name),r=$D(i.metadata);r[s]||(r[s]={type:a,sourceName:e})}}function pe(a){return na(0,a)}function a1(a){return na(1,a)}function vr(a){return na(5,a)}function JD(a){return na(6,a)}function eI(a){return na(7,a)}function tI(a){return na(8,a)}function iI(a){return na(10,a)}function o1(a,e,t){const i=String(e.name);let s=null;const r=function(...o){if(s===null){s=a,typeof _native<"u"&&_native[i]&&(s=t(_native[i],a));const c=this&&(e.static?this:Object.getPrototypeOf(this));c?.[i]===r&&(c[i]=s)}return s.apply(this,o)};return r}function yr(a,e){return o1(a,e,t=>t)}yr.filter=function(a){return(e,t)=>o1(e,t,(i,s)=>function(...r){return a(...r)?i(...r):s.apply(this,r)})};function l1(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const e=Math.random()*16|0;return(a==="x"?e:e&3|8).toString(16)})}class Jd{get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get coordinatesMode(){return 0}get isCube(){return this._texture?this._texture.isCube:!1}set isCube(e){this._texture&&(this._texture.isCube=e)}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}getClassName(){return"ThinTexture"}static _IsRenderTargetWrapper(e){return e?.shareDepth!==void 0}constructor(e){this._wrapU=1,this._wrapV=1,this.wrapR=1,this.anisotropicFilteringLevel=4,this.delayLoadState=0,this._texture=null,this._engine=null,this._cachedSize=rn.Zero(),this._cachedBaseSize=rn.Zero(),this._initialSamplingMode=2,this._texture=Jd._IsRenderTargetWrapper(e)?e.texture:e,this._texture&&(this._engine=this._texture.getEngine(),this.wrapU=this._texture._cachedWrapU??this.wrapU,this.wrapV=this._texture._cachedWrapV??this.wrapV,this.wrapR=this._texture._cachedWrapR??this.wrapR)}isReady(){return this.delayLoadState===4?(this.delayLoad(),!1):this._texture?this._texture.isReady:!1}delayLoad(){}getInternalTexture(){return this._texture}getSize(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;
vendor: 7,777 bytes, line 154
154if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize}getBaseSize(){return!this.isReady()||!this._texture?(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0,this._cachedBaseSize):this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size,this._cachedBaseSize):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight,this._cachedBaseSize)}get samplingMode(){return this._texture?this._texture.samplingMode:this._initialSamplingMode}updateSamplingMode(e,t=!1){this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture,this._texture.generateMipMaps&&t)}releaseInternalTexture(){this._texture&&(this._texture.dispose(),this._texture=null)}dispose(){this._texture&&(this.releaseInternalTexture(),this._engine=null)}}class Kr{static Eval(e,t){return e.match(/\([^()]*\)/g)?e=e.replace(/\([^()]*\)/g,i=>(i=i.slice(1,i.length-1),Kr._HandleParenthesisContent(i,t))):e=Kr._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:Kr.Eval(e,t)}static _HandleParenthesisContent(e,t){t=t||(r=>r==="true");let i;const s=e.split("||");for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){let o=Kr._SimplifyNegation(s[r].trim());const c=o.split("&&");if(c.length>1)for(let h=0;h<c.length;++h){const f=Kr._SimplifyNegation(c[h].trim());if(f!=="true"&&f!=="false"?f[0]==="!"?i=!t(f.substring(1)):i=t(f):i=f==="true",!i){o="false";break}}if(i||o==="true"){i=!0;break}o!=="true"&&o!=="false"?o[0]==="!"?i=!t(o.substring(1)):i=t(o):i=o==="true"}return i?"true":"false"}static _SimplifyNegation(e){return e=e.replace(/^[\s!]+/,t=>(t=t.replace(/[\s]/g,()=>""),t.length%2?"!":"")),e=e.trim(),e==="!true"?e="false":e==="!false"&&(e="true"),e}}class xt{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>xt.HasTags(e),e.addTags=t=>xt.AddTagsTo(e,t),e.removeTags=t=>xt.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>xt.MatchesQuery(e,t)}static DisableFor(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){if(!e._tags)return!1;const t=e._tags;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(t){const i=[];for(const s in e._tags)Object.prototype.hasOwnProperty.call(e._tags,s)&&e._tags[s]===!0&&i.push(s);return i.join(" ")}else return e._tags}static AddTagsTo(e,t){if(!t||typeof t!="string")return;const i=t.split(" ");for(const s of i)xt._AddTagTo(e,s)}static _AddTagTo(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(xt.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){if(!xt.HasTags(e))return;const i=t.split(" ");for(const s in i)xt._RemoveTagFrom(e,i[s])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return t===void 0?!0:t===""?xt.HasTags(e):Kr.Eval(t,i=>xt.HasTags(e)&&e._tags[i])}}const ob=function(a,e,t,i={}){const s=a();xt&&xt.HasTags(e)&&xt.AddTagsTo(s,xt.GetTags(e,!0));const r=Cd(s),o={};for(const c in r){const h=r[c],f=e[c],_=h.type;if(f!=null&&(c!=="uniqueId"||Rt.AllowLoadingUniqueId))switch(_){case 0:case 6:case 9:case 11:typeof f.slice=="function"?s[c]=f.slice():s[c]=f;break;case 1:i.cloneTexturesOnlyOnce&&o[f.uniqueId]?s[c]=o[f.uniqueId]:(s[c]=t||f.isRenderTarget?f:f.clone(),o[f.uniqueId]=s[c]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:case 13:s[c]=t?f:f.clone();break}}return s};class Rt{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let i=0;i<e.animations.length;i++){const s=e.animations[i];t.animations.push(s.serialize())}}}static Serialize(e,t){t||(t={}),xt&&(t.tags=xt.GetTags(e));const i=Cd(e);for(const s in i){const r=i[s],o=r.sourceName||s,c=r.type,h=e[s];if(h!=null&&(s!=="uniqueId"||Rt.AllowLoadingUniqueId))switch(c){case 0:Array.isArray(h)?t[o]=h.slice():t[o]=h;break;case 1:t[o]=h.serialize();break;case 2:t[o]=h.asArray();break;case 3:t[o]=h.serialize();break;case 4:t[o]=h.asArray();break;case 5:t[o]=h.asArray();break;case 6:t[o]=h.id;break;case 7:t[o]=h.serialize();break;case 8:t[o]=h.asArray();break;case 9:t[o]=h.serialize();break;case 10:t[o]=h.asArray();break;case 11:t[o]=h.id;break;case 12:t[o]=h.asArray();break;case 13:t[o]=h.asArray();break}}return t}static ParseProperties(e,t,i,s){s||(s="");const r=Cd(t);for(const o in r){const c=r[o],h=e[c.sourceName||o],f=c.type;if(h!=null&&(o!=="uniqueId"||Rt.AllowLoadingUniqueId)){const _=t;switch(f){case 0:_[o]=h;break;case 1:i&&(_[o]=Rt._TextureParser(h,i,s));break;case 2:_[o]=lt.FromArray(h);break;case 3:_[o]=Rt._FresnelParametersParser(h);break;case 4:_[o]=Ue.FromArray(h);break;case 5:_[o]=E.FromArray(h);break;case 6:i&&(_[o]=i.getLastMeshById(h));break;case 7:_[o]=Rt._ColorCurvesParser(h);break;case 8:_[o]=dt.FromArray(h);break;case 9:_[o]=Rt._ImageProcessingConfigurationParser(h);break;case 10:_[o]=Oe.FromArray(h);break;case 11:i&&(_[o]=i.getCameraById(h));break;case 12:_[o]=se.FromArray(h);break;case 13:_[o]=it.FromArray(h);break}}}}static Parse(e,t,i,s=null){const r=e();return xt&&xt.AddTagsTo(r,t.tags),Rt.ParseProperties(t,r,i,s),r}static Clone(e,t,i={}){return ob(e,t,!1,i)}static Instanciate(e,t){return ob(e,t,!0)}}Rt.AllowLoadingUniqueId=!1;Rt._ImageProcessingConfigurationParser=a=>{throw je("ImageProcessingConfiguration")};Rt._FresnelParametersParser=a=>{throw je("FresnelParameters")};Rt._ColorCurvesParser=a=>{throw je("ColorCurves")};Rt._TextureParser=(a,e,t)=>{throw je("Texture")};var lb;let rh=(()=>{var a;let e=Jd,t=[],i,s=[],r=[],o,c=[],h=[],f,_=[],d=[],g,p=[],x=[],b,T=[],R=[],S,M=[],I=[],A,D=[],C=[],k,H=[],L=[],J,te=[],ae=[],B,$=[],z=[],X,q,G,j=[],w=[],O,U=[],W=[],oe,le,be,Ee,Fe,Y=[],ue=[],de,we=[],qe=[],ke,ut,Gt,Ot,pt,Nt=[],Ft=[];return a=class extends e{set hasAlpha(ie){this._hasAlpha!==ie&&(this._hasAlpha=ie,this._scene&&this._scene.markAllMaterialsAsDirty(1,Pe=>Pe.hasTexture(this)))}get hasAlpha(){return this._hasAlpha}set getAlphaFromRGB(ie){this._getAlphaFromRGB!==ie&&(this._getAlphaFromRGB=ie,this._scene&&this._scene.markAllMaterialsAsDirty(1,Pe=>Pe.hasTexture(this)))}get getAlphaFromRGB(){return this._getAlphaFromRGB}set coordinatesIndex(ie){this._coordinatesIndex!==ie&&(this._coordinatesIndex=ie,this._scene&&this._scene.markAllMaterialsAsDirty(1,Pe=>Pe.hasTexture(this)))}get coordinatesIndex(){return this._coordinatesIndex}set coordinatesMode(ie){this._coordinatesMode!==ie&&(this._coordinatesMode=ie,this._scene&&this._scene.markAllMaterialsAsDirty(1,Pe=>Pe.hasTexture(this)))}get coordinatesMode(){return this._coordinatesMode}get wrapU(){return this._wrapU}set wrapU(ie){this._wrapU=ie}get wrapV(){return this._wrapV}set wrapV(ie){this._wrapV=ie}get isCube(){return this._texture?this._texture.isCube:this._isCube}set isCube(ie){this._texture?this._texture.isCube=ie:this._isCube=ie}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(ie){this._texture&&(this._texture.is3D=ie)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(ie){this._texture&&(this._texture.is2DArray=ie)}get gammaSpace(){if(this._texture)this._texture._gammaSpace===null&&(this._texture._gammaSpace=this._gammaSpace);else return this._gammaSpace;return this._texture._gammaSpace&&!this._texture._useSRGBBuffer}set gammaSpace(ie){if(this._texture){if(this._texture._gammaSpace===ie)return;this._texture._gammaSpace=ie}else{if(this._gammaSpace===ie)return;this._gammaSpace=ie}this.getScene()?.markAllMaterialsAsDirty(1,Pe=>Pe.hasTexture(this))}get isRGBD(){return this._texture!=null&&this._texture._isRGBD}set isRGBD(ie){ie!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=ie),this.get
vendor: 2,953 bytes, line 154
154Scene()?.markAllMaterialsAsDirty(1,Pe=>Pe.hasTexture(this)))}get noMipmap(){return!1}get lodGenerationOffset(){return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(ie){this._texture&&(this._texture._lodGenerationOffset=ie)}get lodGenerationScale(){return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(ie){this._texture&&(this._texture._lodGenerationScale=ie)}get linearSpecularLOD(){return this._texture?this._texture._linearSpecularLOD:!1}set linearSpecularLOD(ie){this._texture&&(this._texture._linearSpecularLOD=ie)}get irradianceTexture(){return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(ie){this._texture&&(this._texture._irradianceTexture=ie)}get uid(){return this._uid||(this._uid=l1()),this._uid}toString(){return this.name}getClassName(){return"BaseTexture"}set onDispose(ie){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(ie)}get isBlocking(){return!0}get loadingError(){return this._loadingError}get errorObject(){return this._errorObject}constructor(ie,Pe=null){super(null),this.uniqueId=(Z(this,t),Z(this,s,void 0)),this.name=(Z(this,r),Z(this,c,void 0)),this.displayName=(Z(this,h),Z(this,_,void 0)),this.metadata=(Z(this,d),Z(this,p,null)),this._internalMetadata=Z(this,x),this.reservedDataStore=null,this._hasAlpha=Z(this,T,!1),this._getAlphaFromRGB=(Z(this,R),Z(this,M,!1)),this.level=(Z(this,I),Z(this,D,1)),this._coordinatesIndex=(Z(this,C),Z(this,H,0)),this.optimizeUVAllocation=(Z(this,L),Z(this,te,!0)),this._coordinatesMode=(Z(this,ae),Z(this,$,0)),this.wrapR=(Z(this,z),Z(this,j,1)),this.anisotropicFilteringLevel=(Z(this,w),Z(this,U,a.DEFAULT_ANISOTROPIC_FILTERING_LEVEL)),this._isCube=(Z(this,W),!1),this._gammaSpace=!0,this.invertZ=Z(this,Y,!1),this.lodLevelInAlpha=(Z(this,ue),Z(this,we,!1)),this._dominantDirection=(Z(this,qe),null),this.isRenderTarget=Z(this,Nt,!1),this._prefiltered=(Z(this,Ft),!1),this._forceSerialize=!1,this.animations=[],this.onDisposeObservable=new Ae,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,ie?a._IsScene(ie)?this._scene=ie:this._engine=ie:this._scene=ft.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._texture=Pe,this._uid=null}getScene(){return this._scene}_getEngine(){return this._engine}getTextureMatrix(){return se.IdentityReadOnly}getReflectionTextureMatrix(){return se.IdentityReadOnly}getRefractionTextureMatrix(){return this.getReflectionTextureMatrix()}isReadyOrNotBlocking(){return!this.isBlocking||this.isReady()||this.loadingError}scale(ie){}get canRescale(){return!1}_getFromCache(ie,Pe,ei,Xt,ai,Kt){const Zt=this._getEngine();if(!Zt)return null;const At=Zt._getUseSRGBBuffer(!!ai,Pe),ti=Zt.getLoadedTexturesCache();for(let Dt=0;Dt<ti.length;
154Dt++){const zt=ti[Dt];if((ai===void 0||At===zt._useSRGBBuffer)&&(Xt===void 0||Xt===zt.invertY)&&zt.url===ie&&zt.generateMipMaps===!Pe&&(!ei||ei===zt.samplingMode)&&(Kt===void 0||Kt===zt.isCube))return zt.incrementReferences(),zt}return null}_rebuild(ie=!1){}clone(){return null}get textureType(){return this._texture&&this._texture.type!==void 0?this._texture.type:0}get textureFormat(){return this._texture&&this._texture.format!==void 0?this._texture.format:5}_markAllSubMeshesAsTexturesDirty(){const ie=this.getScene();ie&&ie.markAllMaterialsAsDirty(1)}readPixels(ie=0,Pe=0,ei=null,Xt=!0,ai=!1,Kt=0,Zt=0,At=Number.MAX_VALUE,ti=Number.MAX_VALUE){if(!this._texture)return null;const Dt=this._getEngine();if(!Dt)return null;const zt=this.getSize();let ii=zt.width,mi=zt.height;Pe!==0&&(ii=ii/Math.pow(2,Pe),mi=mi/Math.pow(2,Pe),ii=Math.round(ii),mi=Math.round(mi)),At=Math.min(ii,At),ti=Math.min(mi,ti);try{return this._texture.isCube||this._texture.is2DArray?Dt._readTexturePixels(this._texture,At,ti,ie,Pe,ei,Xt,ai,Kt,Zt):Dt._readTexturePixels(this._texture,At,ti,-1,Pe,ei,Xt,ai,Kt,Zt)}catch{return null}}_readPixelsSync(ie=0,Pe=0,ei=null,Xt=!0,ai=!1){if(!this._texture)return null;const Kt=this.getSize();let Zt=Kt.width,At=Kt.height;const ti=this._getEngine();if(!ti)return null;Pe!=0&&(Zt=Zt/Math.pow(2,Pe),At=At/Math.pow(2,Pe),Zt=Math.round(Zt),At=Math.round(At));try{return this._texture.isCube?ti._readTexturePixelsSync(this._texture,Zt,At,ie,Pe,ei,Xt,ai):ti._readTexturePixelsSync(this._texture,Zt,At,-1,Pe,ei,Xt,ai)}catch{return null}}get _lodTextureHigh(){return this._texture?this._texture._lodTextureHigh:null}get _lodTextureMid(){return this._texture?this._texture._lodTextureMid:null}get _lodTextureLow(){return this._texture?this._texture._lodTextureLow:null}dispose(){if(this._scene){this._scene.stopAnimation&&this._scene.stopAnimation(this),this._scene.removePendingData(this);const ie=this._scene.textures.indexOf(this);if(ie>=0&&this._scene.textures.splice(ie,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null,this._parentContainer){const Pe=this._parentContainer.textures.indexOf(this);Pe>-1&&this._parentContainer.textures.splice(Pe,1),this._parentContainer=null}}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null,super.dispose()}serialize(ie=!1){if(!this.name&&!ie)return null;const Pe=Rt.Serialize(this);return Rt.AppendSerializedAnimations(this,Pe),Pe}static WhenAllReady(ie,Pe){let ei=ie.length;if(ei===0){Pe();return}for(let Xt=0;Xt<ie.length;Xt++){const ai=ie[Xt];if(ai.isReady())--ei===0&&Pe();else{const Kt=ai.onLoadObservable;Kt?Kt.addOnce(()=>{--ei===0&&Pe()}):--ei===0&&Pe()}}}static _IsScene(ie){return ie.getClassName()==="Scene"}},(()=>{const $e=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[pe()],o=[pe()],f=[pe()],g=[pe()],b=[pe("hasAlpha")],S=[pe("getAlphaFromRGB")],A=[pe()],k=[pe("coordinatesIndex")],J=[pe()],B=[pe("coordinatesMode")],X=[pe()],q=[pe()],G=[pe()],O=[pe()],oe=[pe()],le=[pe()],be=[pe()],Ee=[pe()],Fe=[pe()],de=[pe()],ke=[pe()],ut=[pe()],Gt=[pe()],Ot=[a1()],pt=[pe()],he(a,null,X,{kind:"getter",name:"wrapU",static:!1,private:!1,access:{has:ie=>"wrapU"in ie,get:ie=>ie.wrapU},metadata:$e},null,t),he(a,null,q,{kind:"getter",name:"wrapV",static:!1,private:!1,access:{has:ie=>"wrapV"in ie,get:ie=>ie.wrapV},metadata:$e},null,t),he(a,null,oe,{kind:"getter",name:"isCube",static:!1,private:!1,access:{has:ie=>"isCube"in ie,get:ie=>ie.isCube},metadata:$e},null,t),he(a,null,le,{kind:"getter",name:"is3D",static:!1,private:!1,access:{has:ie=>"is3D"in ie,get:ie=>ie.is3D},metadata:$e},null,t),he(a,null,be,{kind:"getter",name:"is2DArray",static:!1,private:!1,access:{has:ie=>"is2DArray"in ie,get:ie=>ie.is2DArray},metadata:$e},null,t),he(a,null,Ee,{kind:"getter",name:"gammaSpace",static:!1,private:!1,access:{has:ie=>"gammaSpace"in ie,get:ie=>ie.gammaSpace},metadata:$e},null,t),he(a,null,ke,{kind:"getter",name:"lodGenerationOffset",static:!1,private:!1,access:{has:ie=>"lodGenerationOffset"in ie,get:ie=>ie.lodGenerationOffset},metadata:$e},null,t),he(a,null,ut,{kind:"getter",name:"lodGenerationScale",static:!1,private:!1,access:{has:ie=>"lodGenerationScale"in ie,get:ie=>ie.lodGenerationScale},metadata:$e},null,t),he(a,null,Gt,{kind:"getter",name:"linearSpecularLOD",static:!1,private:!1,access:{has:ie=>"linearSpecularLOD"in ie,get:ie=>ie.linearSpecularLOD},metadata:$e},null,t),he(a,null,Ot,{kind:"getter",name:"irradianceTexture",static:!1,private:!1,access:{has:ie=>"irradianceTexture"in ie,get:ie=>ie.irradianceTexture},metadata:$e},null,t),he(null,null,i,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:ie=>
154"uniqueId"in ie,get:ie=>ie.uniqueId,set:(ie,Pe)=>{ie.uniqueId=Pe}},metadata:$e},s,r),he(null,null,o,{kind:"field",name:"name",static:!1,private:!1,access:{has:ie=>"name"in ie,get:ie=>ie.name,set:(ie,Pe)=>{ie.name=Pe}},metadata:$e},c,h),he(null,null,f,{kind:"field",name:"displayName",static:!1,private:!1,access:{has:ie=>"displayName"in ie,get:ie=>ie.displayName,set:(ie,Pe)=>{ie.displayName=Pe}},metadata:$e},_,d),he(null,null,g,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:ie=>"metadata"in ie,get:ie=>ie.metadata,set:(ie,Pe)=>{ie.metadata=Pe}},metadata:$e},p,x),he(null,null,b,{kind:"field",name:"_hasAlpha",static:!1,private:!1,access:{has:ie=>"_hasAlpha"in ie,get:ie=>ie._hasAlpha,set:(ie,Pe)=>{ie._hasAlpha=Pe}},metadata:$e},T,R),he(null,null,S,{kind:"field",name:"_getAlphaFromRGB",static:!1,private:!1,access:{has:ie=>"_getAlphaFromRGB"in ie,get:ie=>ie._getAlphaFromRGB,set:(ie,Pe)=>{ie._getAlphaFromRGB=Pe}},metadata:$e},M,I),he(null,null,A,{kind:"field",name:"level",static:!1,private:!1,access:{has:ie=>"level"in ie,get:ie=>ie.level,set:(ie,Pe)=>{ie.level=Pe}},metadata:$e},D,C),he(null,null,k,{kind:"field",name:"_coordinatesIndex",static:!1,private:!1,access:{has:ie=>"_coordinatesIndex"in ie,get:ie=>ie._coordinatesIndex,set:(ie,Pe)=>{ie._coordinatesIndex=Pe}},metadata:$e},H,L),he(null,null,J,{kind:"field",name:"optimizeUVAllocation",static:!1,private:!1,access:{has:ie=>"optimizeUVAllocation"in ie,get:ie=>ie.optimizeUVAllocation,set:(ie,Pe)=>{ie.optimizeUVAllocation=Pe}},metadata:$e},te,ae),he(null,null,B,{kind:"field",name:"_coordinatesMode",static:!1,private:!1,access:{has:ie=>"_coordinatesMode"in ie,get:ie=>ie._coordinatesMode,set:(ie,Pe)=>{ie._coordinatesMode=Pe}},metadata:$e},$,z),he(null,null,G,{kind:"field",name:"wrapR",static:!1,private:!1,access:{has:ie=>"wrapR"in ie,get:ie=>ie.wrapR,set:(ie,Pe)=>{ie.wrapR=Pe}},metadata:$e},j,w),he(null,null,O,{kind:"field",name:"anisotropicFilteringLevel",static:!1,private:!1,access:{has:ie=>"anisotropicFilteringLevel"in ie,get:ie=>ie.anisotropicFilteringLevel,set:(ie,Pe)=>{ie.anisotropicFilteringLevel=Pe}},metadata:$e},U,W),he(null,null,Fe,{kind:"field",name:"invertZ",static:!1,private:!1,access:{has:ie=>"invertZ"in ie,get:ie=>ie.invertZ,set:(ie,Pe)=>{ie.invertZ=Pe}},metadata:$e},Y,ue),he(null,null,de,{kind:"field",name:"lodLevelInAlpha",static:!1,private:!1,access:{has:ie=>"lodLevelInAlpha"in ie,get:ie=>ie.lodLevelInAlpha,set:(ie,Pe)=>{ie.lodLevelInAlpha=Pe}},metadata:$e},we,qe),he(null,null,pt,{kind:"field",name:"isRenderTarget",static:!1,private:!1,access:{has:ie=>"isRenderTarget"in ie,get:ie=>ie.isRenderTarget,set:(ie,Pe)=>{ie.isRenderTarget=Pe}},metadata:$e},Nt,Ft),$e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$e})})(),a.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,a})();(lb=rh.prototype).forceSphericalPolynomialsRecompute??(lb.forceSphericalPolynomialsRecompute=He("BaseTexture","forceSphericalPolynomialsRecompute"));Object.getOwnPropertyDescriptor(rh.prototype,"sphericalPolynomial")||Object.defineProperty(rh.prototype,"sphericalPolynomial",mt("BaseTexture","sphericalPolynomial"));let cb=!1;function sI(){cb||(cb=!0,st.prototype.createPrefilteredCubeTexture=function(a,e,t,i,s=null,r=null,o,c=null,h=!0){const f=async _=>{if(!_){s&&s(null);return}const d=_.texture;if(h?_.info.sphericalPolynomial&&(d._sphericalPolynomial=_.info.sphericalPolynomial):d._sphericalPolynomial=d._sphericalPolynomial??new nh,d._source=9,this.getCaps().textureLOD){s&&s(d);return}const g=3,p=this._gl,x=_.width;if(!x)return;const{DDSTools:b}=await Ji(async()=>{const{DDSTools:R}=await import("./dds-BtJrYueF.js");return{DDSTools:R}},__vite__mapDeps([0,1,2])),T=[];for(let R=0;R<g;R++){const M=1-R/(g-1),I=i,A=Math.log2(x)*t+i,D=I+(A-I)*M,C=Math.round(Math.min(Math.max(D,0),A)),k=new is(this,2);if(k.type=d.type,k.format=d.format,k.width=Math.pow(2,Math.max(Math.log2(x)-C,0)),k.height=k.width,k.isCube=!0,k._cachedWrapU=0,k._cachedWrapV=0,this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,k,!0),k.samplingMode=2,p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_MAG_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_MIN_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),_.
154isDDS){const L=_.info,J=_.data;this._unpackFlipY(L.isCompressed),b.UploadDDSLevels(this,k,J,L,!0,6,C)}else me.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null);const H=new rh(e);H._isCube=!0,H._texture=k,k.isReady=!0,T.push(H)}d._lodTextureHigh=T[2],d._lodTextureMid=T[1],d._lodTextureLow=T[0],s&&s(d)};return this.createCubeTexture(a,e,null,!1,f,r,o,c,h,t,i)})}sI();let hb=!1;function nI(){hb||(hb=!0,st.prototype.createUniformBuffer=function(a,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");const i=new ol(t);return this.bindUniformBuffer(i),a instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,a,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(a),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},st.prototype.createDynamicUniformBuffer=function(a,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");const i=new ol(t);return this.bindUniformBuffer(i),a instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,a,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(a),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},st.prototype.updateUniformBuffer=function(a,e,t,i){this.bindUniformBuffer(a),t===void 0&&(t=0),i===void 0?e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,e):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,new Float32Array(e)):e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,e.subarray(t,t+i)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(e).subarray(t,t+i)),this.bindUniformBuffer(null)},st.prototype.bindUniformBuffer=function(a){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,a?a.underlyingResource:null)},st.prototype.bindUniformBufferBase=function(a,e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,e,a?a.underlyingResource:null)},st.prototype.bindUniformBlock=function(a,e,t){const i=a.program,s=this._gl.getUniformBlockIndex(i,e);s!==4294967295&&this._gl.uniformBlockBinding(i,s,t)})}nI();let ub=!1;function rI(){ub||(ub=!0,Ve.prototype.displayLoadingUI=function(){if(!Bi())return;const a=this.loadingScreen;a&&a.displayLoadingUI()},Ve.prototype.hideLoadingUI=function(){if(!Bi())return;const a=this._loadingScreen;a&&a.hideLoadingUI()},Object.defineProperty(Ve.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=Ve.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(a){this._loadingScreen=a},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"loadingUIText",{set:function(a){this.loadingScreen.loadingUIText=a},enumerable:!0,configurable:!0}),Object.defineProperty(Ve.prototype,"loadingUIBackgroundColor",{set:function(a){this.loadingScreen.loadingUIBackgroundColor=a},enumerable:!0,configurable:!0}))}rI();$v();let fb=!1;function aI(){fb||(fb=!0,Ve.prototype.getInputElement=function(){return this._renderingCanvas},Ve.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},Ve.prototype.setDepthFunction=function(a){this._depthCullingState.depthFunc=a},Ve.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)},Ve.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)},Ve.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)},Ve.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)},Ve.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},Ve.prototype.setDepthWrite=function(a){this._depthCullingState.depthMask=a},Ve.prototype.setAlphaConstants=function(a,e,t,i){this._alphaState.setAlphaBlendConstants(a,e,t,i)},Ve.prototype.getAlphaMode=function(a=0){return this._alphaMode[a]},Ve.prototype.getAlphaEquation=function(a=0){return this._alphaEquation[a]})}aI();let db=!1;function oI(){db||(db=!0,Ve.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},Ve.prototype.setStencilBuffer=function(a){this._stencilState.stencilTest=a},Ve.prototype.getStencilMask=function(){return this._stencilState.stencilMask},Ve.prototype.setStencilMask=function(a){this._stencilState.stencilMask=a},Ve.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},Ve.prototype.getStencilBackFunction=function(){return this._stencilState.stencilBackFunc},Ve.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},Ve.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},Ve.prototype.setStencilFunction=function(a){this._stencilState.stencilFunc=a},Ve.prototype.setStencilBackFunction=function(a){this._stencilState.stencilBackFunc=a},Ve.prototype.setStencilFunctionReference=function(a){this._stencilState.stencilFuncRef=a},Ve.prototype.setStencilFunctionMask=function(a){this._stencilState.stencilFuncMask=a},Ve.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},Ve.prototype.getStencilBackOperationFail=function(){return this._stencilState.stencilBackOpStencilFail},Ve.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},Ve.prototype.getStencilBackOperationDepthFail=function(){return this._stencilState.stencilBackOpDepthFail},Ve.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},Ve.prototype.getStencilBackOperationPass=function(){return this._stencilState.stencilBackOpStencilDepthPass},Ve.prototype.setStencilOperationFail=function(a){this._stencilState.stencilOpStencilFail=a},Ve.prototype.setStencilBackOperationFail=function(a){this._stencilState.stencilBackOpStencilFail=a},Ve.prototype.setStencilOperationDepthFail=function(a){this._stencilState.stencilOpDepthFail=a},Ve.prototype.setStencilBackOperationDepthFail=function(a){this._stencilState.stencilBackOpDepthFail=a},Ve.prototype.setStencilOperationPass=function(a){this._stencilState.stencilOpStencilDepthPass=a},Ve.prototype.setStencilBackOperationPass=function(a){this._stencilState.stencilBackOpStencilDepthPass=a},Ve.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},Ve.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)})}oI();Qd();let _b=!1;function lI(){_b||(_b=!0,Ve.prototype.createDepthStencilTexture=function(a,e,t){if(e.isCube){const i=a.width||a;return this._createDepthStencilCubeTexture(i,e)}else return this._createDepthStencilTexture(a,e,t)})}lI();function cI(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}class Ti{constructor(){this._xhr=cI(),this._requestURL=""}static get IsCustomRequestAvailable(){return Object.keys(Ti.CustomRequestHeaders).length>0||Ti.CustomRequestModifiers.length>0}static _CleanUrl(e){return e=e.replace("file:http:","http:"),e=e.replace("file:https:","https:"),e}static _ShouldSkipRequestModifications(e){return Ti.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}static _CollectCustomizations(e,t={}){const i={...t};if(Ti._ShouldSkipRequestModifications(e))return{url:e,headers:i};for(const r in Ti.CustomRequestHeaders){const o=Ti.CustomRequestHeaders[r];o&&(i[r]=o)}const s={setRequestHeader:(r,o)=>{i[r]=o}};for(const r of Ti.CustomRequestModifiers){if(Ti._ShouldSkipRequestModifications(e))break;const o=r(s,e);
154typeof o=="string"&&(e=o)}return{url:e,headers:i}}static async FetchAsync(e,t={}){const i=t.method??"GET";if(typeof fetch<"u"){const{url:s,headers:r}=Ti._CollectCustomizations(Ti._CleanUrl(e),t.headers??{});return await fetch(s,{method:i,headers:r,body:t.body??void 0})}return await new Promise((s,r)=>{const o=new Ti;o.responseType="arraybuffer",o.addEventListener("readystatechange",()=>{if(o.readyState===4)if(o.status>=200&&o.status<300){const c=typeof Headers<"u"?new Headers:void 0,h=o.getResponseHeader("Content-Type");h&&c&&c.set("Content-Type",h),s(typeof Response<"u"?new Response(o.response,{status:o.status,statusText:o.statusText,headers:c}):{ok:!0,status:o.status,statusText:o.statusText,headers:{get:f=>o.getResponseHeader(f)},arrayBuffer:async()=>await Promise.resolve(o.response)})}else r(new Error(`HTTP ${o.status} loading '${o.requestURL}': ${o.statusText}`))}),o.open(i,e,t.headers),o.send(t.body??null)})}get requestURL(){return this._requestURL}get onprogress(){return this._xhr.onprogress}set onprogress(e){this._xhr.onprogress=e}get readyState(){return this._xhr.readyState}get status(){return this._xhr.status}get statusText(){return this._xhr.statusText}get response(){return this._xhr.response}get responseURL(){return this._xhr.responseURL}get responseText(){return this._xhr.responseText}get responseType(){return this._xhr.responseType}set responseType(e){this._xhr.responseType=e}get timeout(){return this._xhr.timeout}set timeout(e){this._xhr.timeout=e}addEventListener(e,t,i){this._xhr.addEventListener(e,t,i)}removeEventListener(e,t,i){this._xhr.removeEventListener(e,t,i)}abort(){this._xhr.abort()}send(e){this._xhr.send(e)}open(e,t,i){const{url:s,headers:r}=Ti._CollectCustomizations(t,i);this._requestURL=Ti._CleanUrl(s),this._xhr.open(e,this._requestURL,!0);for(const o in r)this._xhr.setRequestHeader(o,r[o])}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}Ti.CustomRequestHeaders={};Ti.CustomRequestModifiers=new Array;Ti.SkipRequestModificationForBabylonCDN=!0;class il{}il.FilesToLoad={};class hI{static ExponentialBackoff(e=3,t=500){return(i,s,r)=>s.status!==0||r>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,r)*t}}
154class Ja extends Error{}Ja._setPrototypeOf=Object.setPrototypeOf||((a,e)=>(a.__proto__=e,a));const Rh={MeshInvalidPositionsError:0,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class ro extends Ja{constructor(e,t,i){super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",Ja._setPrototypeOf(this,ro.prototype)}}function uI(a){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",i,s,r,o,c,h,f,_=0;for(;_<a.length;)i=a[_++],s=_<a.length?a[_++]:Number.NaN,r=_<a.length?a[_++]:Number.NaN,o=i>>2,c=(i&3)<<4|s>>4,h=(s&15)<<2|r>>6,f=r&63,isNaN(s)?h=f=64:isNaN(r)&&(f=64),t+=e.charAt(o)+e.charAt(c)+e.charAt(h)+e.charAt(f);return t}function fI(a){const e=c1(a),t=e.length,i=new Uint8Array(new ArrayBuffer(t));for(let s=0;s<t;s++)i[s]=e.charCodeAt(s);return i.buffer}const dI=a=>{const e=ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a);return typeof e.toBase64=="function"?e.toBase64():uI(e)},c1=a=>atob(a),_I=a=>typeof Uint8Array.fromBase64=="function"?Uint8Array.fromBase64(a).buffer:fI(a);let Gc=null;function h1(){if(Gc)return Gc;const a=new ArrayBuffer(4),e=new Float32Array(a),t=new Uint32Array(a),i=new Uint32Array(512),s=new Uint32Array(512);for(let h=0;h<256;++h){const f=h-127;f<-24?(i[h]=0,i[h|256]=32768,s[h]=24,s[h|256]=24):f<-14?(i[h]=1024>>-f-14,i[h|256]=1024>>-f-14|32768,s[h]=-f-1,s[h|256]=-f-1):f<=15?(i[h]=f+15<<10,i[h|256]=f+15<<10|32768,s[h]=13,s[h|256]=13):f<128?(i[h]=31744,i[h|256]=64512,s[h]=24,s[h|256]=24):(i[h]=31744,i[h|256]=64512,s[h]=13,s[h|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let f=h<<13,_=0;for(;(f&8388608)===0;)f<<=1,_-=8388608;f&=-8388609,_+=947912704,r[h]=f|_}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return Gc={floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:c},Gc}const FP=65504;function mI(a){const e=h1();e.floatView[0]=a;const t=e.uint32View[0],i=t>>23&511;return e.baseTable[i]+((t&8388607)>>e.shiftTable[i])}function Wi(a){const e=h1();return e.uint32View[0]=e.mantissaTable[e.offsetTable[a>>10]+(a&1023)]+e.exponentTable[a>>10],e.floatView[0]}function gI(a,e,t,i){switch(e){case 5120:{let s=a.getInt8(t);return i&&(s=Math.max(s/127,-1)),s}case 5121:{let s=a.getUint8(t);return i&&(s=s/255),s}case 5122:{let s=a.getInt16(t,!0);return i&&(s=Math.max(s/32767,-1)),s}case 5123:{let s=a.getUint16(t,!0);return i&&(s=s/65535),s}case 5131:return Wi(a.getUint16(t,!0));case 5124:return a.getInt32(t,!0);case 5125:return a.getUint32(t,!0);case 5126:return a.getFloat32(t,!0);default:throw new Error(`Invalid component type ${e}`)}}function pI(a,e,t,i,s){switch(e){case 5120:{i&&(s=Math.round(s*127)),a.setInt8(t,s);break}case 5121:{i&&(s=Math.round(s*255)),a.setUint8(t,s);break}case 5122:{i&&(s=Math.round(s*32767)),a.setInt16(t,s,!0);break}case 5123:{i&&(s=Math.round(s*65535)),a.setUint16(t,s,!0);break}case 5131:{a.setUint16(t,mI(s),!0);break}case 5124:{a.setInt32(t,s,!0);break}case 5125:{a.setUint32(t,s,!0);break}case 5126:{a.setFloat32(t,s,!0);break}default:throw new Error(`Invalid component type ${e}`)}}function br(a){switch(a){case 5120:case 5121:return 1;case 5122:case 5123:case 5131:return 2;case 5124:case 5125:case 5126:return 4;default:throw new Error(`Invalid type '${a}'`)}}function yI(a){switch(a){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5131:return Uint16Array;case 5124:return Int32Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(`Invalid component type '${a}'`)}}function Ah(a,e,t,i,s,r,o,c){const h=new Array(i),f=new Array(i);if(a instanceof Array){let _=e/4;const d=t/4;for(let g=0;g<r;g+=i){for(let p=0;p<i;p++)h[p]=f[p]=a[_+p];c(f,g);for(let p=0;p<i;p++)h[p]!==f[p]&&(a[_+p]=f[p]);_+=d}}else{const _=ArrayBuffer.isView(a)?new DataView(a.buffer,a.byteOffset,a.byteLength):new DataView(a),d=br(s);for(let g=0;g<r;g+=i){for(let p=0,x=e;p<i;p++,x+=d)h[p]=f[p]=gI(_,s,x,o);c(f,g);for(let p=0,x=e;p<i;p++,x+=d)h[p]!==f[p]&&pI(_,s,x,o,f[p]);e+=t}}}function bI(a,e,t,i,s,r,o,c){const h=e*br(t),f=o*e;if(t!==5126||s!==h){const _=new Float32Array(f);return Ah(a,i,s,e,t,f,r,(d,g)=>{for(let p=0;p<e;p++)_[g+p]=d[p]}),_}if(!(a instanceof Array||a instanceof Float32Array)||i!==0||a.length!==f)if(a instanceof Array){const _=i/4;return a.slice(_,_+f)}else if(ArrayBuffer.isView(a)){const _=a.byteOffset+i;return(_&3)!==0&&(me.Warn("Float array must be aligned to 4-bytes border"),c=!0),c?new Float32Array(a.buffer.slice(_,_+f*Float32Array.BYTES_PER_ELEMENT)):new Float32Array(a.buffer,_,f)}else return new Float32Array(a,i,f);return c?a.slice():a}function xI(a,e,t,i,s,r,o){const c=br(t),h=yI(t),f=r*e;if(Array.isArray(a)){if((i&3)!==0||(s&3)!==0)throw new Error("byteOffset and byteStride must be a multiple of 4 for number[] data.");const x=i/4,b=s/4;if(x+(r-1)*b+e>a.length)throw new Error("Last accessed index is out of bounds.");
154if(b<e)throw new Error("Data stride cannot be smaller than the component size.");if(b!==e){const R=new h(f);return Ah(a,i,s,e,t,f,!1,(S,M)=>{for(let I=0;I<e;I++)R[M+I]=S[I]}),R}return new h(a.slice(x,x+f))}let _,d=i;if(ArrayBuffer.isView(a)?(_=a.buffer,d+=a.byteOffset):_=a,d+(r-1)*s+e*c>_.byteLength)throw new Error("Last accessed byte is out of bounds.");const p=e*c;if(s<p)throw new Error("Byte stride cannot be smaller than the component's byte size.");if(s!==p){const x=new h(f),b=new Uint8Array(_,d),T=new Uint8Array(x.buffer),R=e*c;for(let S=0,M=0,I=0;S<r;S++,M+=s,I+=R)T.set(b.subarray(M,M+R),I);return x}return c!==1&&(d&c-1)!==0&&(me.Warn("Array must be aligned to border of element size. Data will be copied."),o=!0),o?new h(_.slice(d,d+f*c)):new h(_,d,f)}function vI(a,e,t,i,s,r,o,c){const h=e*br(t),f=o*e;if(c.length!==f)throw new Error("Output length is not valid");if(t!==5126||s!==h){Ah(a,i,s,e,t,f,r,(_,d)=>{for(let g=0;g<e;g++)c[d+g]=_[g]});return}if(a instanceof Array){const _=i/4;c.set(a,_)}else if(ArrayBuffer.isView(a)){const _=a.byteOffset+i;if((_&3)!==0){me.Warn("Float array must be aligned to 4-bytes border"),c.set(new Float32Array(a.buffer.slice(_,_+f*Float32Array.BYTES_PER_ELEMENT)));return}const d=new Float32Array(a.buffer,_,f);c.set(d)}else{const _=new Float32Array(a,i,f);c.set(_)}}function TI(a){const e=a.buffer;if(e instanceof ArrayBuffer)return a;const t=new ArrayBuffer(a.byteLength);return new Uint8Array(t).set(new Uint8Array(e,a.byteOffset,a.byteLength)),t}const u1=new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);class ah extends ro{constructor(e,t){super(e,Rh.LoadFileError),this.name="LoadFileError",Ja._setPrototypeOf(this,ah.prototype),t instanceof Ti?this.request=t:this.file=t}}class oh extends ro{constructor(e,t){super(e,Rh.RequestFileError),this.request=t,this.name="RequestFileError",Ja._setPrototypeOf(this,oh.prototype)}}class e_ extends ro{constructor(e,t){super(e,Rh.ReadFileError),this.file=t,this.name="ReadFileError",Ja._setPrototypeOf(this,e_.prototype)}}const RI=a=>(a=a.replace(/#/gm,"%23"),a),ri={DefaultRetryStrategy:hI.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:a=>a,ScriptBaseUrl:"",ScriptPreprocessUrl:a=>a,CleanUrl:RI},t_=(a,e)=>{if(!(a&&a.indexOf("data:")===0)&&ri.CorsBehavior)if(typeof ri.CorsBehavior=="string"||ri.CorsBehavior instanceof String)e.crossOrigin=ri.CorsBehavior;else{const t=ri.CorsBehavior(a);t&&(e.crossOrigin=t)}},lh=(a,e,t,i,s="",r,o=ft.LastCreatedEngine)=>{if(typeof HTMLImageElement>"u"&&!o?._features.forceBitmapOverHTMLImageElement)return t("LoadImage is only supported in web or BabylonNative environments."),null;let c,h=!1;if(a instanceof ArrayBuffer||ArrayBuffer.isView(a))if(typeof Blob<"u"&&typeof URL<"u"){let A;a instanceof ArrayBuffer?A=a:A=TI(a),c=URL.createObjectURL(new Blob([A],{type:s})),h=!0}else c=`data:${s};base64,`+dI(a);else a instanceof Blob?(c=URL.createObjectURL(a),h=!0):(c=ri.CleanUrl(a),c=ri.PreprocessUrl(c));const f=A=>{if(t){const D=c||a.toString();t(`Error while trying to load image: ${D.indexOf("http")===0||D.length<=128?D:D.slice(0,128)+"..."}`,A)}};if(o?._features.forceBitmapOverHTMLImageElement)return Tr(c,A=>{o.createImageBitmap(new Blob([A],{type:s}),{premultiplyAlpha:"none",colorSpaceConversion:"none",...r}).then(D=>{e(D),h&&URL.revokeObjectURL(c)}).catch(D=>{t&&t("Error while trying to load image: "+a,D)})},void 0,i||void 0,!0,(A,D)=>{f(D)}),null;const _=new Image;t_(c,_);const d=[],g=()=>{for(const A of d)A.target.addEventListener(A.name,A.handler)},p=()=>{for(const A of d)A.target.removeEventListener(A.name,A.handler);d.length=0},x=()=>{p(),e(_),h&&_.src&&URL.revokeObjectURL(_.src)},b=A=>{p(),f(A),h&&_.src&&URL.revokeObjectURL(_.src)},T=A=>{if(A.blockedURI!==_.src||A.disposition==="report")return;p();const D=new Error(`CSP violation of policy ${A.effectiveDirective} ${A.blockedURI}. Current policy is ${A.originalPolicy}`);ft.UseFallbackTexture=!1,f(D),h&&_.src&&URL.revokeObjectURL(_.src),_.src=""};d.push({target:_,name:"load",handler:x}),d.push({target:_,name:"error",handler:b}),d.push({target:document,name:"securitypolicyviolation",handler:T}),g();const R=c.substring(0,5)==="blob:",S=c.substring(0,5)==="data:",M=()=>{R||S||!Ti.IsCustomRequestAvailable?_.src=c:Tr(c,(A,D,C)=>{const k=!s&&C?C:s,H=new Blob([A],{type:k}
vendor: 5,347 bytes, line 154
154),L=URL.createObjectURL(H);h=!0,_.src=L},void 0,i||void 0,!0,(A,D)=>{f(D)})},I=()=>{i&&i.loadImage(c,_)};if(!R&&!S&&i&&i.enableTexturesOffline)i.open(I,M);else{if(c.indexOf("file:")!==-1){const A=decodeURIComponent(c.substring(5).toLowerCase());if(il.FilesToLoad[A]&&typeof URL<"u"){try{let D;try{D=URL.createObjectURL(il.FilesToLoad[A])}catch{D=URL.createObjectURL(il.FilesToLoad[A])}_.src=D,h=!0}catch{_.src=""}return _}}M()}return _},ul=(a,e,t,i,s)=>{const r=new FileReader,o={onCompleteObservable:new Ae,abort:()=>r.abort()};return r.onloadend=()=>o.onCompleteObservable.notifyObservers(o),s&&(r.onerror=()=>{s(new e_(`Unable to read ${a.name}`,a))}),r.onload=c=>{e(c.target.result)},t&&(r.onprogress=t),i?r.readAsArrayBuffer(a):r.readAsText(a),o},Tr=(a,e,t,i,s,r,o)=>{if(a.name)return ul(a,e,t,s,r?_=>{r(void 0,_)}:void 0);const c=a;if(c.indexOf("file:")!==-1){let _=decodeURIComponent(c.substring(5).toLowerCase());_.indexOf("./")===0&&(_=_.substring(2));const d=il.FilesToLoad[_];if(d)return ul(d,e,t,s,r?g=>r(void 0,new ah(g.message,g.file)):void 0)}const{match:h,type:f}=AI(c);if(h){const _={onCompleteObservable:new Ae,abort:()=>()=>{}};try{const d=s?s_(c):_1(c);e(d,void 0,f)}catch(d){r?r(void 0,d):me.Error(d.message||"Failed to parse the Data URL")}return Ki.SetImmediate(()=>{_.onCompleteObservable.notifyObservers(_)}),_}return i_(c,(_,d)=>{e(_,d?.responseURL,d?.getResponseHeader("content-type"))},t,i,s,r?_=>{r(_.request,new ah(_.message,_.request))}:void 0,o)},i_=(a,e,t,i,s,r,o)=>{i!==null&&(i??(i=ft.LastCreatedScene?.offlineProvider)),a=ri.CleanUrl(a),a=ri.PreprocessUrl(a);const c=ri.BaseUrl+a;let h=!1;const f={onCompleteObservable:new Ae,abort:()=>h=!0},_=()=>{let d=new Ti,g=null,p;const x=()=>{d&&(t&&d.removeEventListener("progress",t),p&&d.removeEventListener("readystatechange",p),d.removeEventListener("loadend",b))};let b=()=>{x(),f.onCompleteObservable.notifyObservers(f),f.onCompleteObservable.clear(),t=void 0,p=null,b=null,r=void 0,o=void 0,e=void 0};f.abort=()=>{h=!0,b&&b(),d&&d.readyState!==(XMLHttpRequest.DONE||4)&&d.abort(),g!==null&&(clearTimeout(g),g=null),d=null};const T=S=>{const M=S.message||"Unknown error";r&&d?r(new oh(M,d)):me.Error(M)},R=S=>{if(d){if(d.open("GET",c),o)try{o(d)}catch(M){T(M);return}s&&(d.responseType="arraybuffer"),t&&d.addEventListener("progress",t),b&&d.addEventListener("loadend",b),p=()=>{if(!(h||!d)&&d.readyState===(XMLHttpRequest.DONE||4)){if(p&&d.removeEventListener("readystatechange",p),d.status>=200&&d.status<300||d.status===0&&(!Bi()||f1())){const A=s?d.response:d.responseText;if(A!==null){try{e&&e(A,d)}catch(D){T(D)}return}}const M=ri.DefaultRetryStrategy;if(M){const A=M(c,d,S);if(A!==-1){x(),d=new Ti,g=setTimeout(()=>R(S+1),A);return}}const I=new oh("Error status: "+d.status+" "+d.statusText+" - Unable to load "+c,d);r&&r(I)}},d.addEventListener("readystatechange",p),d.send()}};R(0)};if(i&&i.enableSceneOffline&&!a.startsWith("blob:")){const d=p=>{p&&p.status>400?r&&r(p):_()},g=()=>{i&&i.loadFile(ri.BaseUrl+a,p=>{!h&&e&&e(p),f.onCompleteObservable.notifyObservers(f)},t?p=>{!h&&t&&t(p)}:void 0,d,s)};i.open(g,d)}else _();return f},f1=()=>typeof location<"u"&&location.protocol==="file:",d1=a=>u1.test(a),AI=a=>{const e=u1.exec(a);return e===null||e.length===0?{match:!1,type:""}:{match:!0,type:e[0].replace("data:","").replace(";base64,","")}};function s_(a){return _I(a.split(",")[1])}const _1=a=>c1(a.split(",")[1]);let Jo;const MI=(a,e,t,i,s,r,o,c,h,f)=>{Jo={DecodeBase64UrlToBinary:a,DecodeBase64UrlToString:e,DefaultRetryStrategy:t.DefaultRetryStrategy,BaseUrl:t.BaseUrl,CorsBehavior:t.CorsBehavior,PreprocessUrl:t.PreprocessUrl,IsBase64DataUrl:i,IsFileURL:s,LoadFile:r,LoadImage:o,ReadFile:c,RequestFile:h,SetCorsBehavior:f},Object.defineProperty(Jo,"DefaultRetryStrategy",{get:function(){return t.DefaultRetryStrategy},set:function(_){t.DefaultRetryStrategy=_}}),Object.defineProperty(Jo,"BaseUrl",{get:function(){return t.BaseUrl},set:function(_){t.BaseUrl=_}}),Object.defineProperty(Jo,"PreprocessUrl",{get:function(){return t.PreprocessUrl},set:function(_){t.PreprocessUrl=_}}),Object.defineProperty(Jo,"CorsBehavior",{get:function(){return t.CorsBehavior},set:function(_){t.CorsBehavior=_}})};let mb=!1;function SI(){mb||(mb=!0,MI(s_,_1,ri,d1,f1,Tr,lh,ul,i_,t_),Zr.loadFile=Tr,Zr.loadImage=lh,Hv.loadFile=Tr)}let gb=!1;function EI(){gb||(gb=!0,SI(),Ve.prototype._loadFileAsync=async function(a,e,t){return await new Promise((i,s)=>{this._loadFile(a,r=>{i(r)},void 0,e,t,(r,o)=>{s(o)})})})}EI();const ch=new Map;function Ln(a,e){CI(a)&&me.Warn(`Extension with the name '${a}' already exists`),ch.set(a,e)}function CI(a){return ch.delete(a)}function DI(a,e){(e==="image/ktx"||e==="image/ktx2")&&(a=".ktx"),ch.has(a)||(a.endsWith(".ies")&&Ln(".ies",async()=>await Ji(()=>import("./iesTextureLoader-CmGe6Fgz.js"),[]).then(i=>new i._IESTextureLoader)),a.endsWith(".dds")&&Ln(".dds",async()=>await Ji(()=>import("./ddsTextureLoader-C2f_Crk_.js"),__vite__mapDeps([3,1,2])).then(i=>new i._DDSTextureLoader)),a.endsWith(".basis")&&Ln(".basis",async()=>await Ji(()=>import("./basisTextureLoader-BbwwyqTk.js"),[]).then(i=>new i._BasisTextureLoader)),a.endsWith(".env")&&Ln(".env",async()=>await Ji(()=>import("./envTextureLoader-C3v1GqL8.js"),__vite__mapDeps([4,2])).then(i=>new i._ENVTextureLoader)),a.endsWith(".hdr")&&Ln(".hdr",async()=>await Ji(()=>
154import("./hdrTextureLoader-BGQvgh0h.js"),[]).then(i=>new i._HDRTextureLoader)),(a.endsWith(".ktx")||a.endsWith(".ktx2"))&&(Ln(".ktx",async()=>await Ji(()=>import("./ktxTextureLoader-DIvPsfkp.js"),[]).then(i=>new i._KTXTextureLoader)),Ln(".ktx2",async()=>await Ji(()=>import("./ktxTextureLoader-DIvPsfkp.js"),[]).then(i=>new i._KTXTextureLoader))),a.endsWith(".tga")&&Ln(".tga",async()=>await Ji(()=>import("./tgaTextureLoader-eiGqkbhB.js"),[]).then(i=>new i._TGATextureLoader)),a.endsWith(".exr")&&Ln(".exr",async()=>await Ji(()=>import("./exrTextureLoader-CK2uAXHe.js"),[]).then(i=>new i._ExrTextureLoader)));const t=ch.get(a);return t?Promise.resolve(t(e)):null}Ve.GetCompatibleTextureLoader=DI;let pb=!1;function II(){pb||(pb=!0,st.prototype.enableScissor=function(a,e,t,i){const s=this._gl;s.enable(s.SCISSOR_TEST),s.scissor(a,e,t,i)},st.prototype.disableScissor=function(){const a=this._gl;a.disable(a.SCISSOR_TEST)})}II();jD();class ds{constructor(e){this.length=0,this.data=new Array(e),this._id=ds._GlobalId++}push(e){this.data[this.length++]=e,this.length>this.data.length&&(this.data.length*=2)}forEach(e){for(let t=0;t<this.length;t++)e(this.data[t])}sort(e){this.data.sort(e)}reset(){this.length=0}dispose(){this.reset(),this.data&&(this.data.length=0)}concat(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t<e.length;t++)this.data[this.length++]=(e.data||e)[t]}}indexOf(e){const t=this.data.indexOf(e);return t>=this.length?-1:t}contains(e){return this.indexOf(e)!==-1}}ds._GlobalId=0;class qr extends ds{constructor(){super(...arguments),this._duplicateId=0}push(e){super.push(e),e.__smartArrayFlags||(e.__smartArrayFlags={}),e.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(e){return e.__smartArrayFlags&&e.__smartArrayFlags[this._id]===this._duplicateId?!1:(this.push(e),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t<e.length;t++){const i=(e.data||e)[t];this.pushNoDuplicate(i)}}}}class wI{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new Ae,this._onEffectiveEnabledStateChangedObservable=null,this._onClonedObservable=new Ae,this._inheritVisibility=!1,this._isVisible=!0}}let fl=(()=>{var a;let e,t=[],i=[],s,r=[],o=[],c,h=[],f=[],_,d=[],g=[],p,x=[],b=[];return a=class{static AddNodeConstructor(R,S){this._NodeConstructors[R]=S}static Construct(R,S,M,I){const A=this._NodeConstructors[R];return A?A(S,M,I):null}set accessibilityTag(R){this._accessibilityTag=R,this.onAccessibilityTagChangedObservable.notifyObservers(R)}get accessibilityTag(){return this._accessibilityTag}get doNotSerialize(){return this._nodeDataStorage._doNotSerialize?!0:this._parentNode?this._parentNode.doNotSerialize:!1}set doNotSerialize(R){this._nodeDataStorage._doNotSerialize=R}isDisposed(){return this._nodeDataStorage._isDisposed}set parent(R){if(this._parentNode===R)return;const S=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){const M=this._parentNode._children.indexOf(this);M!==-1&&this._parentNode._children.splice(M,1),!R&&!this._nodeDataStorage._isDisposed&&this._addToSceneRootNodes()}this._parentNode=R,this._isDirty=!0,this._parentNode&&((this._parentNode._children===void 0||this._parentNode._children===null)&&(this._parentNode._children=new Array),this._parentNode._children.push(this),S||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}get parent(){return this._parentNode}get inheritVisibility(){return this._nodeDataStorage._inheritVisibility}set inheritVisibility(R){this._nodeDataStorage._inheritVisibility=R}get isVisible(){return this.inheritVisibility&&this._parentNode&&!this._parentNode.isVisible?!1:this._nodeDataStorage._isVisible}set isVisible(R){this._nodeDataStorage._isVisible=R}_serializeAsParent(R){R.parentId=this.uniqueId}_addToSceneRootNodes(){this._nodeDataStorage._sceneRootNodesIndex===-1&&(this._nodeDataStorage._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))}_removeFromSceneRootNodes(){if(this._nodeDataStorage._sceneRootNodesIndex!==-1){const R=this._scene.rootNodes,S=R.length-1;R[this._nodeDataStorage._sceneRootNodesIndex]=R[S],R[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex=this._nodeDataStorage._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._nodeDataStorage._sceneRootNodesIndex=-1}}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(R){this._animationPropertiesOverride=R}getClassName(){return"Node"}set onDispose(R){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(R)}get onEnabledStateChangedObservable(){return this._nodeDataStorage._onEnabledStateChangedObservable}get onEffectiveEnabledStateChangedObservable(){var R;return(R=this._nodeDataStorage)._onEffectiveEnabledStateChangedObservable??(R._onEffectiveEnabledStateChangedObservable=new Ae)}get onClonedObservable(){return this._nodeDataStorage._onClonedObservable}constructor(R,S=null,M=!0){this._isDirty=!1,this._nodeDataStorage=new wI,this.name=Z(this,t,void 0),this.id=(Z(this,i),Z(this,r,void 0)),this.uniqueId=(Z(this,o),Z(this,h,void 0)),this.state=(Z(this,f),Z(this,d,"")),this.metadata=(Z(this,g),Z(this,x,null)),this._internalMetadata=Z(this,b),this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new Ae,this._parentContainer=null,this.animations=[],this._ranges={},this.onReady=null,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._waitingParentInstanceIndex=null,this._waitingParsedUniqueId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=se.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new Ae,this._onDisposeObserver=null,this._behaviors=new Array,this.name=R,this.id=R,this._scene=S||ft.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),M&&this._addToSceneRootNodes()}getScene(){return this._scene}getEngine(){return this._scene.getEngine()}addBehavior(R,S=!1){return this._behaviors.indexOf(R)!==-1?this:(R.init(),this._scene.isLoading&&!S?this._scene.onDataLoadedObservable.addOnce(()=>{this._behaviors.includes(R)&&R.attach(this)}):R.attach(this),this._behaviors.push(R),this)}removeBehavior(R){const S=this._behaviors.indexOf(R);return S===-1?this:(this._behaviors.splice(S,1),R.detach(),this)}get behaviors(){return this._behaviors}getBehaviorByName(R){for(const S of this._behaviors)if(S.name===R)return S;return null}getWorldMatrix(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix}_getWorldMatrixDeterminant(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant}get worldMatrixFromCache(){return this._worldMatrix}_initCache(){this._cache={}}
154updateCache(R){!R&&this.isSynchronized()||this._updateCache()}_getActionManagerForTrigger(R,S=!0){return this.parent?this.parent._getActionManagerForTrigger(R,!1):null}_updateCache(R){}_isSynchronized(){return!0}_markSyncedWithParent(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)}isSynchronizedWithParent(){return this._parentNode?this._parentNode._isDirty||this._parentUpdateId!==this._parentNode._childUpdateId?!1:this._parentNode.isSynchronized():!0}isSynchronized(){return this._parentNode&&!this.isSynchronizedWithParent()?!1:this._isSynchronized()}isReady(R=!1){return this._nodeDataStorage._isReady}markAsDirty(R){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}isEnabled(R=!0){return R===!1?this._nodeDataStorage._isEnabled:this._nodeDataStorage._isEnabled?this._nodeDataStorage._isParentEnabled:!1}_hasEffectiveEnabledStateObservers(){const R=this._nodeDataStorage._onEffectiveEnabledStateChangedObservable;return!!R&&R.hasObservers()}_syncParentEnabledState(){const R=this._hasEffectiveEnabledStateObservers(),S=R?this.isEnabled():null;if(this._nodeDataStorage._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children)for(const M of this._children)M._syncParentEnabledState();if(R){const M=this.isEnabled();M!==S&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(M)}}setEnabled(R){if(this._nodeDataStorage._isEnabled===R)return;const S=this._hasEffectiveEnabledStateObservers(),M=S?this.isEnabled():null;if(this._nodeDataStorage._isEnabled=R,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(R),S){const I=this.isEnabled();I!==M&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(I)}}isDescendantOf(R){return this.parent?this.parent===R?!0:this.parent.isDescendantOf(R):!1}_getDescendants(R,S=!1,M){if(this._children)for(let I=0;I<this._children.length;I++){const A=this._children[I];(!M||M(A))&&R.push(A),S||A._getDescendants(R,!1,M)}}getDescendants(R,S){const M=[];return this._getDescendants(M,R,S),M}getChildMeshes(R,S){const M=[];return this._getDescendants(M,R,I=>(!S||S(I))&&I.cullingStrategy!==void 0),M}getChildren(R,S=!0){return this.getDescendants(S,R)}_setReady(R){if(R!==this._nodeDataStorage._isReady){if(!R){this._nodeDataStorage._isReady=!1;return}this.onReady&&this.onReady(this),this._nodeDataStorage._isReady=!0}}getAnimationByName(R){for(let S=0;S<this.animations.length;S++){const M=this.animations[S];if(M.name===R)return M}return null}createAnimationRange(R,S,M){if(!this._ranges[R]){this._ranges[R]=a._AnimationRangeFactory(R,S,M);for(let I=0,A=this.animations.length;I<A;I++)this.animations[I]&&this.animations[I].createRange(R,S,M)}}deleteAnimationRange(R,S=!0){for(let M=0,I=this.animations.length;M<I;M++)this.animations[M]&&this.animations[M].deleteRange(R,S);this._ranges[R]=null}getAnimationRange(R){return this._ranges[R]||null}clone(R,S,M){const I=Rt.Clone(()=>
vendor: 5,321 bytes, line 154
154new a(R,this.getScene()),this);if(S&&(I.parent=S),!M){const A=this.getDescendants(!0);for(let D=0;D<A.length;D++){const C=A[D];C.clone(R+"."+C.name,I)}}return I}getAnimationRanges(){const R=[];let S;for(S in this._ranges)R.push(this._ranges[S]);return R}beginAnimation(R,S,M,I){const A=this.getAnimationRange(R);return A?this._scene.beginAnimation(this,A.from,A.to,S,M,I):null}serializeAnimationRanges(){const R=[];for(const S in this._ranges){const M=this._ranges[S];if(!M)continue;const I={};I.name=S,I.from=M.from,I.to=M.to,R.push(I)}return R}computeWorldMatrix(R){return this._worldMatrix||(this._worldMatrix=se.Identity()),this._worldMatrix}dispose(R,S=!1){if(this._nodeDataStorage._isDisposed=!0,!R){const M=this.getDescendants(!0);for(const I of M)I.dispose(R,S)}this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onEnabledStateChangedObservable.clear(),this._nodeDataStorage._onEffectiveEnabledStateChangedObservable?.clear(),this.onClonedObservable.clear();for(const M of this._behaviors)M.detach();this._behaviors.length=0,this.metadata=null}static ParseAnimationRanges(R,S,M){if(S.ranges)for(let I=0;I<S.ranges.length;I++){const A=S.ranges[I];R.createAnimationRange(A.name,A.from,A.to)}}getHierarchyBoundingVectors(R=!0,S=null){this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);let M,I;const A=this;if(A.getBoundingInfo&&A.subMeshes){const D=A.getBoundingInfo();M=D.boundingBox.minimumWorld.clone(),I=D.boundingBox.maximumWorld.clone()}else M=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),I=new E(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(R){const D=this.getDescendants(!1);for(const C of D){const k=C;if(k.computeWorldMatrix(!0),S&&!S(k)||!k.getBoundingInfo||k.getTotalVertices()===0)continue;const L=k.getBoundingInfo().boundingBox,J=L.minimumWorld,te=L.maximumWorld;E.CheckExtends(J,M,I),E.CheckExtends(te,M,I)}}return{min:M,max:I}}},(()=>{const T=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[pe()],s=[pe()],c=[pe()],_=[pe()],p=[pe()],he(null,null,e,{kind:"field",name:"name",static:!1,private:!1,access:{has:R=>"name"in R,get:R=>R.name,set:(R,S)=>{R.name=S}},metadata:T},t,i),he(null,null,s,{kind:"field",name:"id",static:!1,private:!1,access:{has:R=>"id"in R,get:R=>R.id,set:(R,S)=>{R.id=S}},metadata:T},r,o),he(null,null,c,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:R=>"uniqueId"in R,get:R=>R.uniqueId,set:(R,S)=>{R.uniqueId=S}},metadata:T},h,f),he(null,null,_,{kind:"field",name:"state",static:!1,private:!1,access:{has:R=>"state"in R,get:R=>R.state,set:(R,S)=>{R.state=S}},metadata:T},d,g),he(null,null,p,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:R=>"metadata"in R,get:R=>R.metadata,set:(R,S)=>{R.metadata=S}},metadata:T},x,b),T&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:T})})(),a._AnimationRangeFactory=(T,R,S)=>{throw je("AnimationRange")},a._NodeConstructors={},a})(),vs=(()=>{var a;let e=fl,t=[],i,s=[],r=[],o,c=[],h=[],f,_,d,g,p,x=[],b=[],T,R=[],S=[],M,I=[],A=[],D,C=[],k=[],H,L,J,te=[],ae=[],B,$=[],z=[],X,q=[],G=[],j,w=[],O=[],U,W=[],oe=[],le,be=[],Ee=[];return a=class extends e{get position(){return this._position}set position(Y){this._position=Y}set upVector(Y){this._upVector=Y}get upVector(){return this._upVector}get screenArea(){let Y,ue;if(this.mode===a.PERSPECTIVE_CAMERA)this.fovMode===a.FOVMODE_VERTICAL_FIXED?(ue=this.minZ*2*Math.tan(this.fov/2),Y=this.getEngine().getAspectRatio(this)*ue):(Y=this.minZ*2*Math.tan(this.fov/2),ue=Y/this.getEngine().getAspectRatio(this));else{const de=this.getEngine().getRenderWidth()/2,we=this.getEngine().getRenderHeight()/2;Y=(this.orthoRight??de)-(this.orthoLeft??-de),ue=(this.orthoTop??we)-(this.orthoBottom??-we)}return Y*ue}set orthoLeft(Y){this._orthoLeft=Y;for(const ue of this._rigCameras)ue.orthoLeft=Y}get orthoLeft(){return this._orthoLeft}set orthoRight(Y){this._orthoRight=Y;for(const ue of this._rigCameras)ue.orthoRight=Y}get orthoRight(){return this._orthoRight}set orthoBottom(Y){this._orthoBottom=Y;for(const ue of this._rigCameras)ue.orthoBottom=Y}get orthoBottom(){return this._orthoBottom}set orthoTop(Y){this._orthoTop=Y;for(const ue of this._rigCameras)ue.orthoTop=Y}get orthoTop(){return this._orthoTop}setFocalLength(Y,ue=36){this.fov=2*Math.atan(ue/(2*Y))}get inertia(){return this._baseInertia}set inertia(Y){this._baseInertia=Y}set mode(Y){this._mode=Y;for(const ue of this._rigCameras)ue.mode=Y}get mode(){return this._mode}get hasMoved(){return this._hasMoved}constructor(Y,ue,de,we=!0){Qd(),super(Y,de,!1),this.inputs=Z(this,t),this._position=Z(this,s,E.Zero()),this._upVector=(Z(this,r),Z(this,c,E.Up())),this.oblique=(Z(this,h),null),this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=Z(this,x,.8),this.projectionPlaneTilt=(Z(this,b),Z(this,R,0)),this.minZ=(Z(this,S),Z(this,I,1)),this.maxZ=(Z(this,A),Z(this,C,1e4)),this._baseInertia=(Z(this,k),.9),this._mode=a.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new ih(0,0,1,1),this.layerMask=Z(this,te,268435455),this.fovMode=(Z(this,ae),Z(this,$,a.FOVMODE_VERTICAL_FIXED)),this.cameraRigMode=(Z(this,z),Z(this,q,a.RIG_MODE_NONE)),this.interaxialDistance=(
vendor: 7,399 bytes, line 154
154Z(this,G),Z(this,w,void 0)),this.isStereoscopicSideBySide=(Z(this,O),Z(this,W,void 0)),this.ignoreCameraMaxZ=(Z(this,oe),Z(this,be,!1)),this.customRenderTargets=(Z(this,Ee),[]),this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new Ae,this.onProjectionMatrixChangedObservable=new Ae,this.onAfterCheckInputsObservable=new Ae,this.onRestoreStateObservable=new Ae,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=new Array,this._skipRendering=!1,this._projectionMatrix=new se,this._postProcesses=new Array,this._activeMeshes=new ds(256),this._globalPosition=E.Zero(),this._computedViewMatrix=se.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=se.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=Oe.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.layerMask=this.getScene().defaultCameraLayerMask,this.getScene().addCamera(this),we&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=ue,this.renderPassId=this.getScene().getEngine().createRenderPassId(`Camera ${Y}`)}storeState(){return this._stateStored=!0,this._storedFov=this.fov,this}hasStateStored(){return!!this._stateStored}_restoreStateValues(){return this._stateStored?(this.fov=this._storedFov,!0):!1}restoreState(){return this._restoreStateValues()?(this.onRestoreStateObservable.notifyObservers(this),!0):!1}getClassName(){return"Camera"}toString(Y){let ue="Name: "+this.name;if(ue+=", type: "+this.getClassName(),this.animations)for(let de=0;de<this.animations.length;de++)ue+=", animation[0]: "+this.animations[de].toString(Y);return ue}applyVerticalCorrection(){const Y=this.absoluteRotation.toEulerAngles();this.projectionPlaneTilt=this._scene.useRightHandedSystem?-Y.x:Y.x}get globalPosition(){return this._globalPosition}getActiveMeshes(){return this._activeMeshes}isActiveMesh(Y){return this._activeMeshes.indexOf(Y)!==-1}isReady(Y=!1){if(Y){for(const ue of this._postProcesses)if(ue&&!ue.isReady())return!1}return super.isReady(Y)}_initCache(){super._initCache(),this._cache.position=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.mode=void 0,this._cache.minZ=void 0,this._cache.maxZ=void 0,this._cache.fov=void 0,this._cache.fovMode=void 0,this._cache.aspectRatio=void 0,this._cache.orthoLeft=void 0,this._cache.orthoRight=void 0,this._cache.orthoBottom=void 0,this._cache.orthoTop=void 0,this._cache.obliqueAngle=void 0,this._cache.obliqueLength=void 0,this._cache.obliqueOffset=void 0,this._cache.renderWidth=void 0,this._cache.renderHeight=void 0}_updateCache(Y){Y||super._updateCache(),this._cache.position.copyFrom(this.position),this._cache.upVector.copyFrom(this.upVector)}_isSynchronized(){return this._isSynchronizedViewMatrix()&&this._isSynchronizedProjectionMatrix()}_isSynchronizedViewMatrix(){return super._isSynchronized()?this._cache.position.equals(this.position)&&this._cache.upVector.equals(this.upVector)&&this.isSynchronizedWithParent():!1}_isSynchronizedProjectionMatrix(){const Y=this.ignoreCameraMaxZ?0:this.maxZ;let ue=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===Y;if(!ue)return!1;const de=this.getEngine();return this.mode===a.PERSPECTIVE_CAMERA?ue=this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===de.getAspectRatio(this)&&this._cache.projectionPlaneTilt===this.projectionPlaneTilt:(ue=this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===de.getRenderWidth()&&this._cache.renderHeight===de.getRenderHeight(),this.oblique&&(ue=ue&&this._cache.obliqueAngle===this.oblique.angle&&this._cache.obliqueLength===this.oblique.length&&this._cache.obliqueOffset===this.oblique.offset)),ue}attachControl(Y,ue){}detachControl(Y){}update(){this._hasMoved=!1,this._checkInputs(),this.cameraRigMode!==a.RIG_MODE_NONE&&this._updateRigCameras(),this.getViewMatrix(),this.getProjectionMatrix()}_checkInputs(){this.onAfterCheckInputsObservable.notifyObservers(this)}get rigCameras(){return this._rigCameras}get rigPostProcess(){return this._rigPostProcess}_getFirstPostProcess(){for(let Y=0;Y<this._postProcesses.length;Y++)if(this._postProcesses[Y]!==null)return this._postProcesses[Y];return null}_cascadePostProcessesToRigCams(){const Y=this._getFirstPostProcess();Y&&Y.markTextureDirty();for(let ue=0,de=this._rigCameras.length;ue<de;ue++){const we=this._rigCameras[ue],qe=we._rigPostProcess;qe?(qe.getEffectName()==="pass"&&(we.isIntermediate=this._postProcesses.length===0),we._postProcesses=this._postProcesses.slice(0).concat(qe),qe.markTextureDirty()):we._postProcesses=this._postProcesses.slice(0)}}attachPostProcess(Y,ue=null){return!Y.isReusable()&&this._postProcesses.indexOf(Y)>-1?(me.Error("You're trying to reuse a post process not defined as reusable."),0):(ue==null||ue<0?this._postProcesses.push(Y):this._postProcesses[ue]===null?this._postProcesses[ue]=Y:this._postProcesses.splice(ue,0,Y),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(Y))}detachPostProcess(Y){const ue=this._postProcesses.indexOf(Y);ue!==-1&&(this._postProcesses[ue]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){return this._isSynchronizedViewMatrix()?this._worldMatrix:(this.getViewMatrix(),this._worldMatrix)}_getViewMatrix(){return se.Identity()}getViewMatrix(Y){return!Y&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this._hasMoved=!0,this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._worldMatrix.getTranslationToRef(this._globalPosition),this._computedViewMatrix)}freezeProjectionMatrix(Y){this._doNotComputeProjectionMatrix=!0,Y!==void 0&&(this._projectionMatrix=Y)}unfreezeProjectionMatrix(){this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(Y){if(this._doNotComputeProjectionMatrix||!Y&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;const ue=this.ignoreCameraMaxZ?0:this.maxZ;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=ue,this._refreshFrustumPlanes=!0;const de=this.getEngine(),we=this.getScene(),qe=de.useReverseDepthBuffer;if(this.mode===a.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=de.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1);let ke;we.useRightHandedSystem?ke=se.PerspectiveFovRHToRef:ke=se.PerspectiveFovLHToRef,ke(this.fov,de.getAspectRatio(this),qe?ue:this.minZ,qe?this.minZ:ue,this._projectionMatrix,this.fovMode===a.FOVMODE_VERTICAL_FIXED,de.isNDCHalfZRange,this.projectionPlaneTilt,qe)}
vendor: 13,885 bytes, line 154
154else{const ke=de.getRenderWidth()/2,ut=de.getRenderHeight()/2;we.useRightHandedSystem?this.oblique?se.ObliqueOffCenterRHToRef(this.orthoLeft??-ke,this.orthoRight??ke,this.orthoBottom??-ut,this.orthoTop??ut,qe?ue:this.minZ,qe?this.minZ:ue,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,de.isNDCHalfZRange):se.OrthoOffCenterRHToRef(this.orthoLeft??-ke,this.orthoRight??ke,this.orthoBottom??-ut,this.orthoTop??ut,qe?ue:this.minZ,qe?this.minZ:ue,this._projectionMatrix,de.isNDCHalfZRange):this.oblique?se.ObliqueOffCenterLHToRef(this.orthoLeft??-ke,this.orthoRight??ke,this.orthoBottom??-ut,this.orthoTop??ut,qe?ue:this.minZ,qe?this.minZ:ue,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,de.isNDCHalfZRange):se.OrthoOffCenterLHToRef(this.orthoLeft??-ke,this.orthoRight??ke,this.orthoBottom??-ut,this.orthoTop??ut,qe?ue:this.minZ,qe?this.minZ:ue,this._projectionMatrix,de.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.obliqueAngle=this.oblique?.angle,this._cache.obliqueLength=this.oblique?.length,this._cache.obliqueOffset=this.oblique?.offset,this._cache.renderWidth=de.getRenderWidth(),this._cache.renderHeight=de.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(Y){const ue=this,de=this;return(ue.radius||(de.target?E.Distance(this.position,de.target):this.position.length()))+Y}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?Ns.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=Ns.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(Y,ue=!1){if(this._updateFrustumPlanes(),ue&&this.rigCameras.length>0){let de=!1;for(const we of this.rigCameras)we._updateFrustumPlanes(),de=de||Y.isInFrustum(we._frustumPlanes);return de}else return Y.isInFrustum(this._frustumPlanes)}isCompletelyInFrustum(Y){return this._updateFrustumPlanes(),Y.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(Y=100,ue,de){throw je("Ray")}getForwardRayToRef(Y,ue=100,de,we){throw je("Ray")}dispose(Y,ue=!1){for(this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){const we=this._rigCameras.pop();we&&we.dispose()}if(this._parentContainer){const we=this._parentContainer.cameras.indexOf(this);we>-1&&this._parentContainer.cameras.splice(we,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==a.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let we=this._postProcesses.length;for(;--we>=0;){const qe=this._postProcesses[we];qe&&qe.dispose(this)}}let de=this.customRenderTargets.length;for(;--de>=0;)this.customRenderTargets[de].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(Y,ue)}get isLeftCamera(){return this._isLeftCamera}get isRightCamera(){return this._isRightCamera}get leftCamera(){return this._rigCameras.length<1?null:this._rigCameras[0]}get rightCamera(){return this._rigCameras.length<2?null:this._rigCameras[1]}getLeftTarget(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()}getRightTarget(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()}setCameraRigMode(Y,ue){if(this.cameraRigMode!==Y){for(;this._rigCameras.length>0;){const de=this._rigCameras.pop();de&&de.dispose()}if(this.cameraRigMode=Y,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=ue.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=this._cameraRigParams.interaxialDistance/.0637*(Math.PI/180),this.cameraRigMode!==a.RIG_MODE_NONE){const de=this.createRigCamera(this.name+"_L",0);de&&(de._isLeftCamera=!0);const we=this.createRigCamera(this.name+"_R",1);we&&(we._isRightCamera=!0),de&&we&&(this._rigCameras.push(de),this._rigCameras.push(we))}this._setRigMode(ue),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(Y){}_getVRProjectionMatrix(){return se.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.ignoreCameraMaxZ?0:this.maxZ,this._cameraRigParams.vrWorkMatrix,!0,this.getEngine().isNDCHalfZRange),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix}setCameraRigParameter(Y,ue){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[Y]=ue,Y==="interaxialDistance"&&(this._cameraRigParams.stereoHalfAngle=ue/.0637*(Math.PI/180))}createRigCamera(Y,ue){return null}_updateRigCameras(){for(let Y=0;Y<this._rigCameras.length;Y++)this._rigCameras[Y].minZ=this.minZ,this._rigCameras[Y].maxZ=this.ignoreCameraMaxZ?0:this.maxZ,this._rigCameras[Y].fov=this.fov,this._rigCameras[Y].upVector.copyFrom(this.upVector);this.cameraRigMode===a.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)}_setupInputs(){}serialize(){const Y=Rt.Serialize(this);return Y.uniqueId=this.uniqueId,Y.type=this.getClassName(),this.parent&&this.parent._serializeAsParent(Y),this.inputs&&this.inputs.serialize(Y),Rt.AppendSerializedAnimations(this,Y),Y.ranges=this.serializeAnimationRanges(),Y.isEnabled=this.isEnabled(),Y}clone(Y,ue=null){const de=Rt.Clone(a.GetConstructorFromName(this.getClassName(),Y,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this);return de.name=Y,de.parent=ue,this.onClonedObservable.notifyObservers(de),de}getDirection(Y){const ue=E.Zero();return this.getDirectionToRef(Y,ue),ue}get absoluteRotation(){return this.getWorldMatrix().decompose(void 0,this._absoluteRotation),this._absoluteRotation}getDirectionToRef(Y,ue){E.TransformNormalToRef(Y,this.getWorldMatrix(),ue)}static GetConstructorFromName(Y,ue,de,we=0,qe=!0){const ke=fl.Construct(Y,ue,de,{interaxial_distance:we,isStereoscopicSideBySide:qe});return ke||(()=>a._CreateDefaultParsedCamera(ue,de))}computeWorldMatrix(){return this.getWorldMatrix()}_calculateHandednessMultiplier(){let Y=this.getScene().useRightHandedSystem?-1:1;return this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(Y*=-1),Y}},(()=>{const Fe=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[vr("position")],o=[vr("upVector")],f=[pe()],_=[pe()],d=[pe()],g=[pe()],p=[pe()],T=[pe()],M=[pe()],D=[pe()],H=[pe()],L=[pe()],J=[pe()],B=[pe()],X=[pe()],j=[pe()],U=[pe()],le=[pe()],he(a,null,f,{kind:"getter",name:"orthoLeft",static:!1,private:!1,access:{has:Y=>"orthoLeft"in Y,get:Y=>Y.orthoLeft},metadata:Fe},null,t),he(a,null,_,{kind:"getter",name:"orthoRight",static:!1,private:!1,access:{has:Y=>"orthoRight"in Y,get:Y=>Y.orthoRight},metadata:Fe},null,t),he(a,null,d,{kind:"getter",name:"orthoBottom",static:!1,private:!1,access:{has:Y=>"orthoBottom"in Y,get:Y=>Y.orthoBottom},metadata:Fe},null,t),he(a,null,g,{kind:"getter",name:"orthoTop",static:!1,private:!1,access:{has:Y=>"orthoTop"in Y,get:Y=>Y.orthoTop},metadata:Fe},null,t),he(a,null,H,{kind:"getter",name:"inertia",static:!1,private:!1,access:{has:Y=>"inertia"in Y,get:Y=>Y.inertia},metadata:Fe},null,t),he(a,null,L,{kind:"getter",name:"mode",static:!1,private:!1,access:{has:Y=>"mode"in Y,get:Y=>Y.mode},metadata:Fe},null,t),he(null,null,i,{kind:"field",name:"_position",static:!1,private:!1,access:{has:Y=>"_position"in Y,get:Y=>Y._position,set:(Y,ue)=>{Y._position=ue}},metadata:Fe},s,r),he(null,null,o,{kind:"field",name:"_upVector",static:!1,private:!1,access:{has:Y=>"_upVector"in Y,get:Y=>Y._upVector,set:(Y,ue)=>{Y._upVector=ue}},metadata:Fe},c,h),he(null,null,p,{kind:"field",name:"fov",static:!1,private:!1,access:{has:Y=>"fov"in Y,get:Y=>Y.fov,set:(Y,ue)=>{Y.fov=ue}},metadata:Fe},x,b),he(null,null,T,{kind:"field",name:"projectionPlaneTilt",static:!1,private:!1,access:{has:Y=>"projectionPlaneTilt"in Y,get:Y=>Y.projectionPlaneTilt,set:(Y,ue)=>{Y.projectionPlaneTilt=ue}},metadata:Fe},R,S),he(null,null,M,{kind:"field",name:"minZ",static:!1,private:!1,access:{has:Y=>"minZ"in Y,get:Y=>Y.minZ,set:(Y,ue)=>{Y.minZ=ue}},metadata:Fe},I,A),he(null,null,D,{kind:"field",name:"maxZ",static:!1,private:!1,access:{has:Y=>"maxZ"in Y,get:Y=>Y.maxZ,set:(Y,ue)=>{Y.maxZ=ue}},metadata:Fe},C,k),he(null,null,J,{kind:"field",name:"layerMask",static:!1,private:!1,access:{has:Y=>"layerMask"in Y,get:Y=>Y.layerMask,set:(Y,ue)=>{Y.layerMask=ue}},metadata:Fe},te,ae),he(null,null,B,{kind:"field",name:"fovMode",static:!1,private:!1,access:{has:Y=>"fovMode"in Y,get:Y=>Y.fovMode,set:(Y,ue)=>{Y.fovMode=ue}},metadata:Fe},$,z),he(null,null,X,{kind:"field",name:"cameraRigMode",static:!1,private:!1,access:{has:Y=>"cameraRigMode"in Y,get:Y=>Y.cameraRigMode,set:(Y,ue)=>{Y.cameraRigMode=ue}},metadata:Fe},q,G),he(null,null,j,{kind:"field",name:"interaxialDistance",static:!1,private:!1,access:{has:Y=>"interaxialDistance"in Y,get:Y=>Y.interaxialDistance,set:(Y,ue)=>{Y.interaxialDistance=ue}},metadata:Fe},w,O),he(null,null,U,{kind:"field",name:"isStereoscopicSideBySide",static:!1,private:!1,access:{has:Y=>"isStereoscopicSideBySide"in Y,get:Y=>Y.isStereoscopicSideBySide,set:(Y,ue)=>{Y.isStereoscopicSideBySide=ue}},metadata:Fe},W,oe),he(null,null,le,{kind:"field",name:"ignoreCameraMaxZ",static:!1,private:!1,access:{has:Y=>"ignoreCameraMaxZ"in Y,get:Y=>Y.ignoreCameraMaxZ,set:(Y,ue)=>{Y.ignoreCameraMaxZ=ue}},metadata:Fe},be,Ee),Fe&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Fe})})(),a._CreateDefaultParsedCamera=(Fe,Y)=>{throw je("UniversalCamera")},a.PERSPECTIVE_CAMERA=0,a.ORTHOGRAPHIC_CAMERA=1,a.FOVMODE_VERTICAL_FIXED=0,a.FOVMODE_HORIZONTAL_FIXED=1,a.RIG_MODE_NONE=0,a.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,a.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,a.RIG_MODE_STEREOSCOPIC_INTERLACED=14,a.RIG_MODE_VR=20,a.RIG_MODE_CUSTOM=22,a.ForceAttachControlToAlwaysPreventDefault=!1,a})();const PI=60;class OI{constructor(e,t,i){this._cameraPosition=t,this._behavior=i,this.activeInput=!1,this.speed=1,this.zoomSpeed=1,this.panSpeed=1,this.rotationXSpeed=1,this.rotationYSpeed=1,this._zoomSpeedMultiplier=1,this._panSpeedMultiplier=1,this.zoomInertia=.9,this.panInertia=.9,this.rotationInertia=.9,this.zoomAccumulatedPixels=0,this.panAccumulatedPixels=new E,this.rotationAccumulatedPixels=new E,this.zoomDeltaCurrentFrame=0,this.panDeltaCurrentFrame=E.Zero(),this.rotationDeltaCurrentFrame=E.Zero(),this._zoomVelocity=0,this._panVelocity=new E,this.referenceFrameRate=PI,this._rotationVelocity=new E,this._prevFrameTimeMs=0,this._scene=e}computeCurrentFrameDeltas(){const e=this._scene.getEngine().getDeltaTime(),t=this._getEffectiveDeltaMs(e);if(this._zoomVelocity===0&&this.zoomAccumulatedPixels===0&&this._panVelocity.x===0&&this._panVelocity.y===0&&this._panVelocity.z===0&&this.panAccumulatedPixels.x===0&&this.panAccumulatedPixels.y===0&&this.panAccumulatedPixels.z===0&&this._rotationVelocity.x===0&&this._rotationVelocity.y===0&&this._rotationVelocity.z===0&&this.rotationAccumulatedPixels.x===0&&this.rotationAccumulatedPixels.y===0&&this.rotationAccumulatedPixels.z===0&&!this.activeInput){this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,e>0&&(this._prevFrameTimeMs=e);return}this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,(this.panAccumulatedPixels.lengthSquared()>0||this.rotationAccumulatedPixels.lengthSquared()>0||this.zoomAccumulatedPixels!==0)&&this._behavior?.isInterpolating&&this._behavior.stopAllAnimations(),this._panVelocity.copyFromFloats(this._calculateCurrentVelocity(this._panVelocity.x,this.panAccumulatedPixels.x,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.y,this.panAccumulatedPixels.y,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.z,this.panAccumulatedPixels.z,this.panInertia)),this._panVelocity.scaleToRef(this.speed*this.panSpeed*this._panSpeedMultiplier*t,this.panDeltaCurrentFrame),this._rotationVelocity.copyFromFloats(this._calculateCurrentVelocity(this._rotationVelocity.x,this.rotationAccumulatedPixels.x,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.y,this.rotationAccumulatedPixels.y,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.z,this.rotationAccumulatedPixels.z,this.rotationInertia)),this.rotationDeltaCurrentFrame.copyFromFloats(this._rotationVelocity.x*this.speed*this.rotationXSpeed*t,this._rotationVelocity.y*this.speed*this.rotationYSpeed*t,0),this._zoomVelocity=this._calculateCurrentVelocity(this._zoomVelocity,this.zoomAccumulatedPixels,this.zoomInertia),this.zoomDeltaCurrentFrame=this._zoomVelocity*(this.speed*this.zoomSpeed*this._zoomSpeedMultiplier)*t,e>0&&(this._prevFrameTimeMs=e),this.zoomAccumulatedPixels=0,this.panAccumulatedPixels.setAll(0),this.rotationAccumulatedPixels.setAll(0),this.activeInput=!1}resetRotationVelocity(){this._rotationVelocity.setAll(0),this.rotationAccumulatedPixels.setAll(0)}resetPanVelocity(){this._panVelocity.setAll(0),this.panAccumulatedPixels.setAll(0)}resetZoomVelocity(){this._zoomVelocity=0,this.zoomAccumulatedPixels=0}
154get isInterpolating(){return!!this._behavior?.isInterpolating}getFrameIndependentDecay(e){const t=this._scene.getEngine().getDeltaTime(),i=this._getEffectiveDeltaMs(t),s=1e3/this.referenceFrameRate;return Math.pow(e,i/s)}getFrameIndependentInputScale(e){const t=1-e;return t<=0?1:(1-this.getFrameIndependentDecay(e))/t}_getEffectiveDeltaMs(e){return e>0?e:this._prevFrameTimeMs>0?this._prevFrameTimeMs:1e3/this.referenceFrameRate}_calculateCurrentVelocity(e,t,i){let s=e;const r=this._scene.getEngine().getDeltaTime(),o=this._getEffectiveDeltaMs(r);if(o===0)return s;const c=this.getFrameIndependentDecay(i);if(s*=c,t!==0||this.activeInput){const h=1-i,f=h>0?(1-c)/h:1;s+=t/o*f}else Math.abs(s)<1e-6&&(s=0);return s}}class FI{constructor(e,t){this.inputMap=[],this.handlers=e,this._createDefaultEntries=t,this.resetInputMap()}resolveInteraction(e,t){for(const i of this.inputMap)if(i.source===e&&this._entryMatches(i,t))return i;return null}resetInputMap(){this.inputMap=this._createDefaultEntries?.()??[]}getEntry(e,t,i){const s=this.inputMap;for(let r=0;r<s.length;r++){const o=s[r];if(o.source===e&&o.interaction===t&&this._entryConditionsMatch(o,i))return o}}getEntries(e,t,i){const s=[],r=this.inputMap;for(let o=0;o<r.length;o++){const c=r[o];c.source===e&&c.interaction===t&&this._entryConditionsMatch(c,i)&&s.push(c)}return s}addEntry(e){const t=this._entrySpecificity(e);let i=this.inputMap.length;for(let s=0;s<this.inputMap.length;s++)if(this._entrySpecificity(this.inputMap[s])<t){i=s;break}this.inputMap.splice(i,0,e)}setInteraction(e,t,i){const s=this.resolveInteraction(e,t);return s&&this._entryCoversAllConditionsOf(s,t)?(s.interaction=i,!0):(this.addEntry({source:e,...t??{},interaction:i}),!0)}_entryCoversAllConditionsOf(e,t){if(!t)return!0;const i=e;for(const s of Object.keys(t)){const r=t[s];if(r!==void 0){if(s==="modifiers"){const o=i.modifiers??{};for(const c of Object.keys(r))if(r[c]!==void 0&&o[c]===void 0)return!1}else if(i[s]===void 0)return!1}}return!0}setInteractions(e,t,i){let s=0;const r=this.inputMap;for(let o=0;o<r.length;o++){const c=r[o];c.source===e&&this._entryMatches(c,t)&&(c.interaction=i,s++)}return s}_entryMatches(e,t){switch(e.source){case"pointer":return e.button!==void 0&&e.button!==t?.button?!1:this._matchModifiers(e.modifiers,t?.modifiers);case"wheel":return this._matchModifiers(e.modifiers,t?.modifiers);case"touch":return!(e.touchCount!==void 0&&e.touchCount!==t?.touchCount);case"keyboard":return e.key!==void 0&&(Array.isArray(e.key)?e.key.indexOf(t?.key??-1)===-1:e.key!==t?.key)?!1:this._matchModifiers(e.modifiers,t?.modifiers)}}_entryConditionsMatch(e,t){if(!t)return!0;switch(e.source){case"pointer":return"button"in t&&e.button!==t.button?!1:!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"wheel":return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"touch":return!("touchCount"in t)||e.touchCount===t.touchCount;case"keyboard":if("key"in t){if(e.key===void 0)return t.key===void 0;if(t.key===void 0||(Array.isArray(e.key)?e.key.indexOf(t.key)===-1:e.key!==t.key))return!1}return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers)}}_entrySpecificity(e){let t=0;return"button"in e&&e.button!==void 0&&t++,"key"in e&&e.key!==void 0&&t++,"touchCount"in e&&e.touchCount!==void 0&&t++,"modifiers"in e&&e.modifiers&&t++,t}_matchModifiers(e,t){return e?!(e.ctrl!==void 0&&e.ctrl!==(t?.ctrl??!1)||e.shift!==void 0&&e.shift!==(t?.shift??!1)||e.alt!==void 0&&e.alt!==(t?.alt??!1)):!0}_entryModifiersMatch(e,t){return t?t.ctrl!==void 0||t.shift!==void 0||t.alt!==void 0?!(t.ctrl!==void 0&&e?.ctrl!==t.ctrl||t.shift!==void 0&&e?.shift!==t.shift||t.alt!==void 0&&e?.alt!==t.alt):!e||e.ctrl===void 0&&e.shift===void 0&&e.alt===void 0:!e}}class BI extends OI{constructor(e,t,i){super(e,t,i),this.input=new FI({translate:(s,r,o)=>{this.panAccumulatedPixels.x+=s,this.panAccumulatedPixels.y+=r,this.panAccumulatedPixels.z+=o},rotate:(s,r)=>{this.rotationAccumulatedPixels.x+=s,this.rotationAccumulatedPixels.y+=r}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",interaction:"rotate"},{source:"keyboard",interaction:"translate"},{source:"keyboard",interaction:"rotate"},{source:"touch",interaction:"rotate"},{source:"touch",interaction:"translate"}]}}const Hc=se.Zero(),id=Oe.Identity();let LI=(()=>{var a;let e=vs,t,i=[],s=[],r,o=[],c=[],h,f=[],_=[],d,g=[],p=[];return a=class extends e{get inertia(){return this._targetInertia}set inertia(b){this._targetInertia=b,this.movement&&(this.movement.panInertia=b,this.movement.rotationInertia=b)}constructor(b,T,R,S=!0){super(b,T,R,S),this.cameraDirection=new E(0,0,0),this.cameraRotation=new Ue(0,0),this._targetInertia=.9,this.updateUpVectorFromRotation=Z(this,i,!1),this.rotation=(Z(this,s),Z(this,o,void 0)),this.rotationQuaternion=Z(this,c),this.speed=Z(this,f,2),this.noRotationConstraint=(Z(this,_),!1),this.invertRotation=!1,this.inverseRotationSpeed=.2,this._panningEpsilon=Bt,this._rotationEpsilon=Bt,this.lockedTarget=Z(this,g,null),this._currentTarget=(Z(this,p),E.Zero()),this._initialFocalDistance=1,this._viewMatrix=se.Zero(),this._cameraTransformMatrix=se.Zero(),this._cameraRotationMatrix=se.Zero(),this._transformedReferencePoint=E.Zero(),this._deferredPositionUpdate=new E,this._deferredRotationQuaternionUpdate=new Oe,this._deferredRotationUpdate=new E,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=E.Forward(this.getScene().useRightHandedSystem),this.rotation=new E(0,this.get
vendor: 12,005 bytes, line 154
154Scene().useRightHandedSystem?Math.PI:0,0),this.movement=new BI(this.getScene(),this.position),this.movement.panInertia=this.inertia,this.movement.rotationInertia=this.inertia}getFrontPosition(b){this.getWorldMatrix();const T=fe.Vector3[0],R=fe.Vector3[1];return R.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(R,T),T.scaleInPlace(b),this.globalPosition.add(T)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){const b=this.lockedTarget;b.computeWorldMatrix().getTranslationToRef(b.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return super._restoreStateValues()?(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&this._storedRotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0):!1}_initCache(){super._initCache(),this._cache.lockedTarget=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new Oe(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(b){b||super._updateCache();const T=this._getLockedTargetPosition();T?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(T):this._cache.lockedTarget=T.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;const b=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(b):!b)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){const b=this.getEngine();return this.speed*Math.sqrt(b.getDeltaTime()/(b.getFps()*100))}setTarget(b){this.upVector.normalize(),this._initialFocalDistance=b.subtract(this.position).length(),this.position.z===b.z&&(this.position.z+=Bt),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?se.LookAtRHToRef(this.position,b,E.UpReadOnly,Hc):se.LookAtLHToRef(this.position,b,E.UpReadOnly,Hc),Hc.invert();const T=this.rotationQuaternion||id;Oe.FromRotationMatrixToRef(Hc,T),T.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){return this.getTarget()}set target(b){this.setTarget(b)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(fe.Matrix[0]),E.TransformNormalToRef(this.cameraDirection,fe.Matrix[0],fe.Vector3[0]),this._deferredPositionUpdate.addInPlace(fe.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){const b=this.movement,T=this.cameraDirection.x!==0||this.cameraDirection.y!==0||this.cameraDirection.z!==0;b.panAccumulatedPixels.addInPlace(this.cameraDirection),b.rotationAccumulatedPixels.x+=this.cameraRotation.x,b.rotationAccumulatedPixels.y+=this.cameraRotation.y,b.computeCurrentFrameDeltas(),this.cameraDirection.copyFrom(b.panDeltaCurrentFrame),this.cameraRotation.set(b.rotationDeltaCurrentFrame.x,b.rotationDeltaCurrentFrame.y);const R=this.speed*this._panningEpsilon;!T&&Math.abs(this.cameraDirection.x)<R&&Math.abs(this.cameraDirection.y)<R&&Math.abs(this.cameraDirection.z)<R&&(this.cameraDirection.setAll(0),b.resetPanVelocity());const S=this.invertRotation?-this.inverseRotationSpeed:1,M=this._decideIfNeedsToMove(),I=!!(this.cameraRotation.x||this.cameraRotation.y);this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),M&&this._updatePosition(),I&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*S,this._deferredRotationUpdate.y+=this.cameraRotation.y*S,this.noRotationConstraint||(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(Oe.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),this.cameraDirection.setAll(0),this.cameraRotation.set(0,0),super._checkInputs()}_updateCameraRotationMatrix(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):se.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){return E.TransformNormalToRef(E.UpReadOnly,this._cameraRotationMatrix,this.upVector),this}_getViewMatrix(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!==this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),E.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?ea.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(Oe.FromEulerVectorToRef(this.rotation,id),ea.Y.rotateByQuaternionToRef(id,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(b,T,R){if(this.getScene().useRightHandedSystem?se.LookAtRHToRef(b,T,R,this._viewMatrix):se.LookAtLHToRef(b,T,R,this._viewMatrix),this.parent){const S=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(S,this._viewMatrix),this._viewMatrix.invert(),this._markSyncedWithParent()}}createRigCamera(b,T){if(this.cameraRigMode!==vs.RIG_MODE_NONE){const R=new a(b,this.position.clone(),this.getScene());return R.isRigCamera=!0,R.rigParent=this,this.cameraRigMode===vs.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new Oe),R._cameraRigParams={},R.rotationQuaternion=new Oe),R.mode=this.mode,R.orthoLeft=this.orthoLeft,R.orthoRight=this.orthoRight,R.orthoTop=this.orthoTop,R.orthoBottom=this.orthoBottom,R}return null}_updateRigCameras(){const b=this._rigCameras[0],T=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case vs.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case vs.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case vs.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case vs.RIG_MODE_STEREOSCOPIC_OVERUNDER:case vs.RIG_MODE_STEREOSCOPIC_INTERLACED:{const R=this.cameraRigMode===vs.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,S=this.cameraRigMode===vs.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*R,b),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*S,T);break}case vs.RIG_MODE_VR:b.rotationQuaternion&&T.rotationQuaternion&&this.rotationQuaternion?(b.rotationQuaternion.copyFrom(this.rotationQuaternion),T.rotationQuaternion.copyFrom(this.rotationQuaternion)):(b.rotation.copyFrom(this.rotation),T.rotation.copyFrom(this.rotation)),b.position.copyFrom(this.position),T.position.copyFrom(this.position);break}super._updateRigCameras()}_getRigCamPositionAndTarget(b,T){this.getTarget().subtractToRef(this.position,a._TargetFocalPoint),a._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);const S=a._TargetFocalPoint.addInPlace(this.position);se.TranslationToRef(-S.x,-S.y,-S.z,a._TargetTransformMatrix),a._TargetTransformMatrix.multiplyToRef(se.RotationAxis(T.upVector,b),a._RigCamTransformMatrix),se.TranslationToRef(S.x,S.y,S.z,a._TargetTransformMatrix),a._RigCamTransformMatrix.multiplyToRef(a._TargetTransformMatrix,a._RigCamTransformMatrix),E.TransformCoordinatesToRef(this.position,a._RigCamTransformMatrix,T.position),T.setTarget(S)}getClassName(){return"TargetCamera"}},(()=>{const x=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[pe()],r=[vr()],h=[pe()],d=[JD("lockedTargetId")],he(null,null,t,{kind:"field",name:"updateUpVectorFromRotation",static:!1,private:!1,access:{has:b=>"updateUpVectorFromRotation"in b,get:b=>b.updateUpVectorFromRotation,set:(b,T)=>{b.updateUpVectorFromRotation=T}},metadata:x},i,s),he(null,null,r,{kind:"field",name:"rotation",static:!1,private:!1,access:{has:b=>"rotation"in b,get:b=>b.rotation,set:(b,T)=>{b.rotation=T}},metadata:x},o,c),he(null,null,h,{kind:"field",name:"speed",static:!1,private:!1,access:{has:b=>"speed"in b,get:b=>b.speed,set:(b,T)=>{b.speed=T}},metadata:x},f,_),he(null,null,d,{kind:"field",name:"lockedTarget",static:!1,private:!1,access:{has:b=>"lockedTarget"in b,get:b=>b.lockedTarget,set:(b,T)=>{b.lockedTarget=T}},metadata:x},g,p),x&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:x})})(),a._RigCamTransformMatrix=new se,a._TargetTransformMatrix=new se,a._TargetFocalPoint=new E,a})();var eo={};class UI{constructor(e){this.attachedToElement=!1,this.attached={},this.camera=e,this.checkInputs=()=>{}}add(e){const t=e.getSimpleName();if(this.attached[t]){me.Warn("camera input of type "+t+" already exists on camera");return}this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl(this.noPreventDefault)}remove(e){for(const t in this.attached){const i=this.attached[t];if(i===e){i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck();return}}}removeByType(e){for(const t in this.attached){const i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}}_addCheckInputs(e){const t=this.checkInputs;return()=>{t(),e()}}attachInput(e){this.attachedToElement&&e.attachControl(this.noPreventDefault)}attachElement(e=!1){if(!this.attachedToElement){e=vs.ForceAttachControlToAlwaysPreventDefault?!1:e,this.attachedToElement=!0,this.noPreventDefault=e;for(const t in this.attached)this.attached[t].attachControl(e)}}detachElement(e=!1){for(const t in this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1}rebuildInputCheck(){this.checkInputs=()=>{};for(const e in this.attached){const t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(e){const t={};for(const i in this.attached){const s=this.attached[i],r=Rt.Serialize(s);t[s.getClassName()]=r}e.inputsmgr=t}
vendor: 10,184 bytes, line 154
154parse(e){const t=e.inputsmgr;if(t){this.clear();for(const i in t){const s=eo[i];if(s){const r=t[i],o=Rt.Parse(()=>new s,r,null);this.add(o)}}}else for(const i in this.attached){const s=eo[this.attached[i].getClassName()];if(s){const r=Rt.Parse(()=>new s,e,null);this.remove(this.attached[i]),this.add(r)}}}}class dl{}dl.KEYDOWN=1;dl.KEYUP=2;class Dd{constructor(e,t){this.type=e,this.event=t}}class yb extends Dd{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}const bb=(a,e,t)=>!a||a.getClassName&&a.getClassName()==="Mesh"?null:a.getClassName&&(a.getClassName()==="SubMesh"||a.getClassName()==="PhysicsBody")?a.clone(e):a.clone?a.clone():Array.isArray(a)?a.slice():t&&typeof a=="object"?{...a}:null;function kI(a){const e=[];do{const t=Object.getOwnPropertyNames(a);for(const i of t)e.indexOf(i)===-1&&e.push(i)}while(a=Object.getPrototypeOf(a));return e}class n_{static DeepCopy(e,t,i,s,r=!1){const o=kI(e);for(const c of o){if(c[0]==="_"&&(!s||s.indexOf(c)===-1)||c.endsWith("Observable")||i&&i.indexOf(c)!==-1)continue;const h=e[c],f=typeof h;if(f!=="function")try{if(f==="object")if(h instanceof Uint8Array)t[c]=Uint8Array.from(h);else if(h instanceof Array){if(t[c]=[],h.length>0)if(typeof h[0]=="object")for(let _=0;_<h.length;_++){const d=bb(h[_],t,r);t[c].indexOf(d)===-1&&t[c].push(d)}else t[c]=h.slice(0)}else t[c]=bb(h,t,r);else t[c]=h}catch(_){me.Warn(_.message)}}}}class Yc{static Instantiate(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];const t=Ed(e);if(t)return t;me.Warn(e+" not found, you may have missed an import.");const i=e.split(".");let s=typeof window<"u"?window:typeof globalThis<"u"?globalThis:this;for(let r=0,o=i.length;r<o;r++)s=s[i[r]];return typeof s!="function"?null:s}}Yc.RegisteredExternalClasses={};var We;class _t{static get BaseUrl(){return ri.BaseUrl}static set BaseUrl(e){ri.BaseUrl=e}static get CleanUrl(){return ri.CleanUrl}static set CleanUrl(e){ri.CleanUrl=e}static IsAbsoluteUrl(e){return e.indexOf("//")===0?!0:e.indexOf("://")===-1||e.indexOf(".")===-1||e.indexOf("/")===-1||e.indexOf(":")>e.indexOf("/")?!1:e.indexOf("://")<e.indexOf(".")||e.indexOf("data:")===0||e.indexOf("blob:")===0}static set ScriptBaseUrl(e){ri.ScriptBaseUrl=e}static get ScriptBaseUrl(){return ri.ScriptBaseUrl}static set CDNBaseUrl(e){We.ScriptBaseUrl=e,We.AssetBaseUrl=e}static set ScriptPreprocessUrl(e){ri.ScriptPreprocessUrl=e}static get ScriptPreprocessUrl(){return ri.ScriptPreprocessUrl}static get DefaultRetryStrategy(){return ri.DefaultRetryStrategy}static set DefaultRetryStrategy(e){ri.DefaultRetryStrategy=e}static get CorsBehavior(){return ri.CorsBehavior}static set CorsBehavior(e){ri.CorsBehavior=e}static get UseFallbackTexture(){return ft.UseFallbackTexture}static set UseFallbackTexture(e){ft.UseFallbackTexture=e}static get RegisteredExternalClasses(){return Yc.RegisteredExternalClasses}static set RegisteredExternalClasses(e){Yc.RegisteredExternalClasses=e}static get fallbackTexture(){return ft.FallbackTexture}static set fallbackTexture(e){ft.FallbackTexture=e}static FetchToRef(e,t,i,s,r,o){const c=Math.abs(e)*i%i|0,h=Math.abs(t)*s%s|0,f=(c+h*i)*4;o.r=r[f]/255,o.g=r[f+1]/255,o.b=r[f+2]/255,o.a=r[f+3]/255}static Mix(e,t,i){return 0}static Instantiate(e){return Yc.Instantiate(e)}static SetImmediate(e){Ki.SetImmediate(e)}static IsExponentOfTwo(e){return!0}static FloatRound(e){return Math.fround(e)}static GetFilename(e){const t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)}static GetFolderPath(e,t=!1){const i=e.lastIndexOf("/");return i<0?t?e:"":e.substring(0,i+1)}static ToDegrees(e){return e*180/Math.PI}static ToRadians(e){return e*Math.PI/180}static SmoothAngleChange(e,t,i=.9){const s=this.ToRadians(e),r=this.ToRadians(t);return this.ToDegrees(Math.atan2((1-i)*Math.sin(r)+i*Math.sin(s),(1-i)*Math.cos(r)+i*Math.cos(s)))}static MakeArray(e,t){return t!==!0&&(e===void 0||e==null)?null:Array.isArray(e)?e:[e]}static GetPointerPrefix(e){return Bi()&&!window.PointerEvent?"mouse":"pointer"}static SetCorsBehavior(e,t){t_(e,t)}static SetReferrerPolicyBehavior(e,t){t.referrerPolicy=e}static get PreprocessUrl(){return ri.PreprocessUrl}static set PreprocessUrl(e){ri.PreprocessUrl=e}static LoadImage(e,t,i,s,r,o){return lh(e,t,i,s,r,o)}static LoadFile(e,t,i,s,r,o){return Tr(e,t,i,s,r,o)}static async LoadFileAsync(e,t=!0){return await new Promise((i,s)=>{Tr(e,r=>{i(r)},void 0,void 0,t,(r,o)=>{s(o)})})}static GetAssetUrl(e){if(!e)return"";if(We.AssetBaseUrl&&e.startsWith(We._DefaultAssetsUrl)){const t=We.AssetBaseUrl.endsWith("/")?We.AssetBaseUrl.slice(0,-1):We.AssetBaseUrl;return e.replace(We._DefaultAssetsUrl,t)}return e}static GetBabylonScriptURL(e,t){if(!e)return"";if(e.startsWith(We._DefaultCdnUrl)){if(We.ScriptBaseUrl){const i=We.ScriptBaseUrl.endsWith("/")?We.ScriptBaseUrl.slice(0,-1):We.ScriptBaseUrl;e=e.replace(We._DefaultCdnUrl,i)}else if(We._CdnVersion){const i=`${We._DefaultCdnUrl}/v${We._CdnVersion}`;e.startsWith(i)||(e=e.replace(We._DefaultCdnUrl,i))}}return e=We.ScriptPreprocessUrl(e),t&&!We.IsAbsoluteUrl(e)&&(e=We.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,t,i,s){e=We.GetBabylonScriptURL(e),We.LoadScript(e,t,i)}static async LoadBabylonScriptAsync(e){return e=We.GetBabylonScriptURL(e),await We.LoadScriptAsync(e)}static _LoadScriptNative(e,t,i,s,r=!1){if(_native){if(r){const o="Loading a script as an ES module is not supported in Babylon Native";i?.(o,new Error(o));return}We.LoadFile(e,o=>{try{Function(o).apply(null),t&&t()}catch(c){i&&i("LoadScript Error",c)}},void 0,void 0,!1,(o,c)=>{i&&i("LoadScript Error",c)})}}static _LoadScriptWeb(e,t,i,s,r=!1){if(typeof importScripts=="function"){try{importScripts(e),t&&t()}catch(h){i?.(`Unable to load script '${e}' in worker`,h)}return}else if(!Bi()){i?.(`Cannot load script '${e}' outside of a window or a worker`);return}const o=document.getElementsByTagName("head")[0],c=document.createElement("script");r?(c.setAttribute("type","module"),c.innerText=e):(c.setAttribute("type","text/javascript"),c.setAttribute("src",e)),s&&(c.id=s),c.onload=()=>{t&&t()},c.onerror=h=>{i&&i(`Unable to load script '${e}'`,h)},o.appendChild(c)}static async LoadScriptAsync(e,t){return await new Promise((i,s)=>{this.LoadScript(e,()=>{i()},(r,o)=>{s(o||new Error(r))},t)})}static ReadFileAsDataURL(e,t,i){const s=new FileReader,r={onCompleteObservable:new Ae,abort:()=>s.abort()};return s.onloadend=()=>{r.onCompleteObservable.notifyObservers(r)},s.onload=o=>{t(o.target.result)},s.onprogress=i,s.readAsDataURL(e),r}static ReadFile(e,t,i,s,r){return ul(e,t,i,s,r)}static FileAsURL(e){const t=new Blob([e]);return window.URL.createObjectURL(t)}static Format(e,t=2){return e.toFixed(t)}static DeepCopy(e,t,i,s){n_.DeepCopy(e,t,i,s)}static IsEmpty(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}static RegisterTopRootEvents(e,t){for(let i=0;i<t.length;i++){const s=t[i];e.addEventListener(s.name,s.handler,!1);try{window.parent&&window.parent.addEventListener(s.name,s.handler,!1)}catch{}}}static UnregisterTopRootEvents(e,t){for(let i=0;i<t.length;i++){const s=t[i];e.removeEventListener(s.name,s.handler);try{e.parent&&e.parent.removeEventListener(s.name,s.handler)}catch{}}}static async DumpFramebuffer(e,t,i,s,r="image/png",o,c){throw je("DumpTools")}static DumpData(e,t,i,s,r="image/png",o,c=!1,h=!1,f){throw je("DumpTools")}static async DumpDataAsync(e,t,i,s="image/png",r,o=!1,c=!1,h){throw je("DumpTools")}static _IsOffScreenCanvas(e){return e.convertToBlob!==void 0}static ToBlob(e,t,i="image/png",s){!We._IsOffScreenCanvas(e)&&!e.toBlob&&(e.toBlob=function(r,o,c){setTimeout(()=>{const h=atob(this.toDataURL(o,c).split(",")[1]),f=h.length,_=new Uint8Array(f);for(let d=0;d<f;d++)_[d]=h.charCodeAt(d);r(new Blob([_]))})}),We._IsOffScreenCanvas(e)?e.convertToBlob({type:i,quality:s}).then(r=>t(r)):e.toBlob(function(r){t(r)},i,s)}static DownloadBlob(e,t){if("download"in document.createElement("a")){if(!t){const i=new Date;t="screenshot_"+((i.getFullYear()+"-"+(i.getMonth()+1)).slice(2)+"-"+i.getDate()+"_"+i.getHours()+"-"+("0"+i.getMinutes()).slice(-2))+".png"}We.Download(e,t)}else if(e&&typeof URL<"u"){const i=URL.createObjectURL(e),s=window.open("");if(!s)return;const r=s.document.createElement("img");r.onload=function(){URL.revokeObjectURL(i)},r.src=i,s.document.body.appendChild(r)}}static EncodeScreenshotCanvasData(e,t,i="image/png",s,r){if(typeof s=="string"||!t)this.ToBlob(e,function(o){o&&We.DownloadBlob(o,s),t&&t("")},i,r);else if(t){if(We._IsOffScreenCanvas(e)){e.convertToBlob({type:i,quality:r}).then(c=>{const h=new FileReader;h.readAsDataURL(c),h.onloadend=()=>{const f=h.result;t(f)}});return}const o=e.toDataURL(i,r);t(o)}}static Download(e,t){if(typeof URL>"u")return;const i=window.URL.createObjectURL(e),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=i,s.download=t,s.addEventListener("click",()=>{s.parentElement&&s.parentElement.removeChild(s)}),s.click(),window.URL.revokeObjectURL(i)}static BackCompatCameraNoPreventDefault(e){return typeof e[0]=="boolean"?e[0]:typeof e[1]=="boolean"?e[1]:!1}static CreateScreenshot(e,t,i,s,r="image/png",o=!1,c){throw je("ScreenshotTools")}static async CreateScreenshotAsync(e,t,i,s="image/png",r){throw je("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,i,s,r="image/png",o=1,c=!1,h,f=!1,_=!1,d=!0,g,p){throw je("ScreenshotTools")}static async CreateScreenshotUsingRenderTargetAsync(e,t,i,s="image/png",r=1,o=!1,c,h=!1,f=!1,_=!0,d,g){throw je("ScreenshotTools")}static RandomId(){return l1()}static IsBase64(e){return d1(e)}static DecodeBase64(e){return s_(e)}static get errorsCount(){return me.errorsCount}static Log(e){me.Log(e)}static Warn(e){me.Warn(e)}static Error(e){me.Error(e)}static get LogCache(){return me.LogCache}static ClearLogCache(){me.ClearLogCache()}static set LogLevels(e){me.LogLevels=e}static set PerformanceLogLevel(e){if((e&We.PerformanceUserMarkLogLevel)===We.PerformanceUserMarkLogLevel){_native?.enablePerformanceLogging?(_n
154ative.enablePerformanceLogging(1),We.StartPerformanceCounter=We._StartMarkNative,We.EndPerformanceCounter=We._EndMarkNative):(We.StartPerformanceCounter=We._StartUserMark,We.EndPerformanceCounter=We._EndUserMark);return}if((e&We.PerformanceConsoleLogLevel)===We.PerformanceConsoleLogLevel){_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(2),We.StartPerformanceCounter=We._StartMarkNative,We.EndPerformanceCounter=We._EndMarkNative):(We.StartPerformanceCounter=We._StartPerformanceConsole,We.EndPerformanceCounter=We._EndPerformanceConsole);return}We.StartPerformanceCounter=We._StartPerformanceCounterDisabled,We.EndPerformanceCounter=We._EndPerformanceCounterDisabled,_native?.disablePerformanceLogging?.()}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){if(!We._Performance){if(!Bi())return;We._Performance=window.performance}!t||!We._Performance.mark||We._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){!t||!We._Performance.mark||(We._Performance.mark(e+"-End"),We._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){t&&(We._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){t&&(We._EndUserMark(e,t),console.timeEnd(e))}static _StartMarkNative(e,t=!0){if(t&&_native?.startPerformanceCounter)if(We._NativePerformanceCounterHandles.has(e))We.Warn(`Performance counter with name ${e} is already started.`);else{const i=_native.startPerformanceCounter(e);We._NativePerformanceCounterHandles.set(e,i)}}static _EndMarkNative(e,t=!0){if(t&&_native?.endPerformanceCounter){const i=We._NativePerformanceCounterHandles.get(e);i?(_native.endPerformanceCounter(i),We._NativePerformanceCounterHandles.delete(e)):We.Warn(`Performance counter with name ${e} was not started.`)}}static get Now(){return Vn.Now}static GetClassName(e,t=!1){let i=null;return!t&&e.getClassName?i=e.getClassName():(e instanceof Object&&(i=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),i||(i=typeof e)),i}static First(e,t){for(const i of e)if(t(i))return i;return null}static getFullClassName(e,t=!1){let i=null,s=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){const r=t?e:Object.getPrototypeOf(e);i=r.constructor.__bjsclassName__,s=r.constructor.__bjsmoduleName__}i||(i=typeof e)}return i?(s!=null?s+".":"")+i:null}static async DelayAsync(e){await new Promise(t=>{setTimeout(()=>{t()},e)})}static IsSafari(){return Xa()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}}We=_t;_t.AssetBaseUrl="";_t.UseCustomRequestHeaders=!1;_t.CustomRequestHeaders=Ti.CustomRequestHeaders;_t.GetDOMTextContent=Uv;_t._DefaultCdnUrl="https://cdn.babylonjs.com";_t._CdnVersion="9.21.2";_t._DefaultAssetsUrl="https://assets.babylonjs.com/core";_t.LoadScript=typeof _native>"u"?We._LoadScriptWeb:We._LoadScriptNative;_t.GetAbsoluteUrl=typeof document=="object"?a=>{const e=document.createElement("a");return e.href=a,e.href}:typeof URL=="function"&&typeof location=="object"?a=>new URL(a,location.origin).href:()=>{throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")};_t.NoneLogLevel=me.NoneLogLevel;_t.MessageLogLevel=me.MessageLogLevel;_t.WarningLogLevel=me.WarningLogLevel;_t.ErrorLogLevel=me.ErrorLogLevel;_t.AllLogLevel=me.AllLogLevel;_t.IsWindowObjectExist=Bi;_t.PerformanceNoneLogLevel=0;_t.PerformanceUserMarkLogLevel=1;_t.PerformanceConsoleLogLevel=2;_t._NativePerformanceCounterHandles=new Map;_t.StartPerformanceCounter=We._StartPerformanceCounterDisabled;_t.EndPerformanceCounter=We._EndPerformanceCounterDisabled;class hh{constructor(e,t,i,s=0){this.iterations=e,this.index=s-1,this._done=!1,this._fn=t,this._successCallback=i}executeNext(){this._done||(this.index+1<this.iterations?(++this.index,this._fn(this)):this.breakLoop())}breakLoop(){this._done=!0,this._successCallback()}static Run(e,t,i,s=0){const r=new hh(e,t,i,s);return r.executeNext(),r}static SyncAsyncForLoop(e,t,i,s,r,o=0){return hh.Run(Math.ceil(e/t),c=>{r&&r()?c.breakLoop():setTimeout(()=>{for(let h=0;h<t;++h){const f=c.index*t+h;if(f>=e)break;if(i(f),r&&r()){c.breakLoop();break}}c.executeNext()},o)},s)}}let m1=(()=>{var a;let e,t=[],i=[],s,r=[],o=[],c,h=[],f=[],_,d=[],g=[],p,x=[],b=[],T,R=[],S=[],M,I=[],A=[],D,C=[],k=[],H,L=[],J=[],te,ae=[],B=[],$,z=[],X=[];return a=class{constructor(){this.keysUp=Z(this,t,[38]),this.keysUpward=(Z(this,i),Z(this,r,[33])),this.keysDown=(Z(this,o),Z(this,h,[40])),this.keysDownward=(Z(this,f),Z(this,d,[34])),this.keysLeft=(Z(this,g),Z(this,x,[37])),this.keysRight=(Z(this,b),Z(this,R,[39])),this.rotationSpeed=(Z(this,S),Z(this,I,.5)),this.keysRotateLeft=(
154Z(this,A),Z(this,C,[])),this.keysRotateRight=(Z(this,k),Z(this,L,[])),this.keysRotateUp=(Z(this,J),Z(this,ae,[])),this.keysRotateDown=(Z(this,B),Z(this,z,[])),this._keys=(Z(this,X),new Array)}attachControl(G){G=_t.BackCompatCameraNoPreventDefault(arguments),!this._onCanvasBlurObserver&&(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(j=>{const w=j.event;if(!w.metaKey){if(j.type===dl.KEYDOWN)(this.keysUp.indexOf(w.keyCode)!==-1||this.keysDown.indexOf(w.keyCode)!==-1||this.keysLeft.indexOf(w.keyCode)!==-1||this.keysRight.indexOf(w.keyCode)!==-1||this.keysUpward.indexOf(w.keyCode)!==-1||this.keysDownward.indexOf(w.keyCode)!==-1||this.keysRotateLeft.indexOf(w.keyCode)!==-1||this.keysRotateRight.indexOf(w.keyCode)!==-1||this.keysRotateUp.indexOf(w.keyCode)!==-1||this.keysRotateDown.indexOf(w.keyCode)!==-1)&&(this._keys.indexOf(w.keyCode)===-1&&this._keys.push(w.keyCode),G||w.preventDefault());else if(this.keysUp.indexOf(w.keyCode)!==-1||this.keysDown.indexOf(w.keyCode)!==-1||this.keysLeft.indexOf(w.keyCode)!==-1||this.keysRight.indexOf(w.keyCode)!==-1||this.keysUpward.indexOf(w.keyCode)!==-1||this.keysDownward.indexOf(w.keyCode)!==-1||this.keysRotateLeft.indexOf(w.keyCode)!==-1||this.keysRotateRight.indexOf(w.keyCode)!==-1||this.keysRotateUp.indexOf(w.keyCode)!==-1||this.keysRotateDown.indexOf(w.keyCode)!==-1){const O=this._keys.indexOf(w.keyCode);O>=0&&this._keys.splice(O,1),G||w.preventDefault()}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const G=this.camera,j=G.movement.input,w=j.getEntry("keyboard","translate"),O=j.getEntry("keyboard","rotate"),U=O?.sensitivity??1,W=G._localDirection.copyFromFloats(0,0,0);for(let oe=0;oe<this._keys.length;oe++){const le=this._keys[oe];this.keysLeft.indexOf(le)!==-1?W.x-=1:this.keysUp.indexOf(le)!==-1?W.z+=1:this.keysRight.indexOf(le)!==-1?W.x+=1:this.keysDown.indexOf(le)!==-1?W.z-=1:this.keysUpward.indexOf(le)!==-1?W.y+=1:this.keysDownward.indexOf(le)!==-1?W.y-=1:this.keysRotateLeft.indexOf(le)!==-1?O&&(G.cameraRotation.y-=this._getLocalRotation()*U):this.keysRotateRight.indexOf(le)!==-1?O&&(G.cameraRotation.y+=this._getLocalRotation()*U):this.keysRotateUp.indexOf(le)!==-1?O&&(G.cameraRotation.x-=this._getLocalRotation()*U):this.keysRotateDown.indexOf(le)!==-1&&O&&(G.cameraRotation.x+=this._getLocalRotation()*U)}if(w&&(W.x!==0||W.y!==0||W.z!==0)){const oe=G._computeLocalCameraSpeed()*(w.sensitivity??1);W.normalize().scaleInPlace(oe),G.getScene().useRightHandedSystem&&(W.z*=-1),G.getViewMatrix().invertToRef(G._cameraTransformMatrix),E.TransformNormalToRef(W,G._cameraTransformMatrix,G._transformedDirection),G.cameraDirection.addInPlace(G._transformedDirection)}}}getClassName(){return"FreeCameraKeyboardMoveInput"}_onLostFocus(){this._keys.length=0}getSimpleName(){return"keyboard"}_getLocalRotation(){const G=this.camera._calculateHandednessMultiplier();return this.rotationSpeed*this._engine.getDeltaTime()/1e3*G}},(()=>{const q=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[pe()],s=[pe()],c=[pe()],_=[pe()],p=[pe()],T=[pe()],M=[pe()],D=[pe()],H=[pe()],te=[pe()],$=[pe()],he(null,null,e,{kind:"field",name:"keysUp",static:!1,private:!1,access:{has:G=>"keysUp"in G,get:G=>G.keysUp,set:(G,j)=>{G.keysUp=j}},metadata:q},t,i),he(null,null,s,{kind:"field",name:"keysUpward",static:!1,private:!1,access:{has:G=>"keysUpward"in G,get:G=>G.keysUpward,set:(G,j)=>{G.keysUpward=j}},metadata:q},r,o),he(null,null,c,{kind:"field",name:"keysDown",static:!1,private:!1,access:{has:G=>"keysDown"in G,get:G=>G.keysDown,set:(G,j)=>{G.keysDown=j}},metadata:q},h,f),he(null,null,_,{kind:"field",name:"keysDownward",static:!1,private:!1,access:{has:G=>"keysDownward"in G,get:G=>G.keysDownward,set:(G,j)=>{G.keysDownward=j}},metadata:q},d,g),he(null,null,p,{kind:"field",name:"keysLeft",static:!1,private:!1,access:{has:G=>"keysLeft"in G,get:G=>G.keysLeft,set:(G,j)=>{G.keysLeft=j}},metadata:q},x,b),he(null,null,T,{kind:"field",name:"keysRight",static:!1,private:!1,access:{has:G=>"keysRight"in G,get:G=>G.keysRight,set:(G,j)=>{G.keysRight=j}},metadata:q},R,S),he(null,null,M,{kind:"field",name:"rotationSpeed",static:!1,private:!1,access:{has:G=>"rotationSpeed"in G,get:G=>G.rotationSpeed,set:(G,j)=>{G.rotationSpeed=j}},metadata:q},I,A),he(null,null,D,{kind:"field",name:"keysRotateLeft",static:!1,private:!1,access:{has:G=>"keysRotateLeft"in G,get:G=>G.keysRotateLeft,set:(G,j)=>{G.keysRotateLeft=j}},metadata:q},C,k),he(null,null,H,{kind:"field",name:"keysRotateRight",static:!1,private:!1,access:{has:G=>"keysRotateRight"in G,get:G=>G.keysRotateRight,set:(G,j)=>{G.keysRotateRight=j}},metadata:q},L,J),he(null,null,te,{kind:"field",name:"keysRotateUp",static:!1,private:!1,access:{has:G=>"keysRotateUp"in G,get:G=>G.keysRotateUp,set:(G,j)=>{G.keysRotateUp=j}},metadata:q},ae,B),he(null,null,$,{kind:"field",name:"keysRotateDown",static:!1,private:!1,access:{has:G=>"keysRotateDown"in G,get:G=>G.keysRotateDown,set:(G,j)=>{G.keysRotateDown=j}},metadata:q},z,X),q&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q})})(),a})();eo.FreeCameraKeyboardMoveInput=m1;class at{}at.POINTERDOWN=1;at.POINTERUP=2;at.POINTERMOVE=4;at.POINTERWHEEL=8;at.POINTERPICK=16;at.POINTERTAP=32;at.POINTERDOUBLETAP=64;class g1{constructor(e,t){this.type=e,this.event=t}}class NI extends g1{constructor(e,t,i,s){super(e,t),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new Ue(i,s)}}class Un extends g1{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,i,s=null){super(e,t),this._pickInfo=i,this._inputManager=s}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}}let p1=(()=>{var a;let e,t=[],i=[],s,r=[],o=[];return a=class{_applyPointerRotation(h,f){this._pointerConditions.button=this._currentActiveButton;const _=this.camera.movement.input.resolveInteraction("pointer",this._pointerConditions);if(!_||_.interaction!=="rotate")return;const d=_.sensitivityX??_.sensitivity??1/this.angularSensibility,g=_.sensitivityY??_.sensitivity??1/this.angularSensibility;this.camera.cameraRotation.y+=h*d,this.camera.cameraRotation.x+=f*g}constructor(h=!0){this.touchEnabled=h,this.buttons=Z(this,t,[0,1,2]),this.angularSensibility=(Z(this,i),Z(this,r,2e3)),this._pointerInput=Z(this,o),this._previousPosition=null,this.onPointerMovedObservable=new Ae,this._allowCameraRotation=!0,this._currentActiveButton=-1,this._activePointerId=-1,this._pointerConditions={}}attachControl(h){h=_t.BackCompatCameraNoPreventDefault(arguments);
154const f=this.camera.getEngine(),_=f.getInputElement();this._pointerInput||(this._pointerInput=d=>{const g=d.event,p=g.pointerType==="touch";if(!this.touchEnabled&&p||d.type!==at.POINTERMOVE&&this.buttons.indexOf(g.button)===-1)return;const x=g.target;if(d.type===at.POINTERDOWN){if(p&&this._activePointerId!==-1||!p&&this._currentActiveButton!==-1)return;this._activePointerId=g.pointerId;try{x?.setPointerCapture(g.pointerId)}catch{}this._currentActiveButton===-1&&(this._currentActiveButton=g.button),this._previousPosition={x:g.clientX,y:g.clientY},h||(g.preventDefault(),_&&_.focus()),f.isPointerLock&&this._onMouseMove&&this._onMouseMove(d.event)}else if(d.type===at.POINTERUP){if(p&&this._activePointerId!==g.pointerId||!p&&this._currentActiveButton!==g.button)return;try{x?.releasePointerCapture(g.pointerId)}catch{}this._currentActiveButton=-1,this._previousPosition=null,h||g.preventDefault(),this._activePointerId=-1}else if(d.type===at.POINTERMOVE&&(this._activePointerId===g.pointerId||!p)){if(f.isPointerLock&&this._onMouseMove)this._onMouseMove(d.event);else if(this._previousPosition){const b=this.camera._calculateHandednessMultiplier(),T=(g.clientX-this._previousPosition.x)*b,R=(g.clientY-this._previousPosition.y)*b;this._allowCameraRotation&&this._applyPointerRotation(T,R),this.onPointerMovedObservable.notifyObservers({offsetX:T,offsetY:R}),this._previousPosition={x:g.clientX,y:g.clientY},h||g.preventDefault()}}}),this._onMouseMove=d=>{if(!f.isPointerLock)return;const g=this.camera._calculateHandednessMultiplier();this._applyPointerRotation(d.movementX*g,d.movementY*g),this._previousPosition=null,h||d.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,at.POINTERDOWN|at.POINTERUP|at.POINTERMOVE),_&&(this._contextMenuBind=d=>this.onContextMenu(d),_.addEventListener("contextmenu",this._contextMenuBind,!1))}onContextMenu(h){h.preventDefault()}detachControl(){if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._contextMenuBind){const f=this.camera.getEngine().getInputElement();f&&f.removeEventListener("contextmenu",this._contextMenuBind)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this._previousPosition=null}this._activePointerId=-1,this._currentActiveButton=-1}getClassName(){return"FreeCameraMouseInput"}getSimpleName(){return"mouse"}},(()=>{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[pe()],s=[pe()],he(null,null,e,{kind:"field",name:"buttons",static:!1,private:!1,access:{has:h=>"buttons"in h,get:h=>h.buttons,set:(h,f)=>{h.buttons=f}},metadata:c},t,i),he(null,null,s,{kind:"field",name:"angularSensibility",static:!1,private:!1,access:{has:h=>"angularSensibility"in h,get:h=>h.angularSensibility,set:(h,f)=>{h.angularSensibility=f}},metadata:c},r,o),c&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})})(),a})();eo.FreeCameraMouseInput=p1;var xb;(function(a){a[a.PointerMove=0]="PointerMove",a[a.PointerDown=1]="PointerDown",a[a.PointerUp=2]="PointerUp"})(xb||(xb={}));class vl{}vl.DOM_DELTA_PIXEL=0;vl.DOM_DELTA_LINE=1;vl.DOM_DELTA_PAGE=2;let zI=(()=>{var a;let e,t=[],i=[],s,r=[],o=[],c,h=[],f=[];return a=class{constructor(){this.wheelPrecisionX=Z(this,t,3),this.wheelPrecisionY=(Z(this,i),Z(this,r,3)),this.wheelPrecisionZ=(Z(this,o),Z(this,h,3)),this.onChangedObservable=(Z(this,f),new Ae),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(d){d=_t.BackCompatCameraNoPreventDefault(arguments),this._wheel=g=>{if(g.type!==at.POINTERWHEEL)return;const p=g.event,x=p.deltaMode===vl.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*x*p.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*x*p.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*x*p.deltaZ/this._normalize,p.preventDefault&&(d||p.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,at.POINTERWHEEL)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()}checkInputs(){this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0}getClassName(){return"BaseCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}},(()=>{const _=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[pe()],s=[pe()],c=[pe()],he(null,null,e,{kind:"field",name:"wheelPrecisionX",static:!1,private:!1,access:{has:d=>"wheelPrecisionX"in d,get:d=>d.wheelPrecisionX,set:(d,g)=>{d.wheelPrecisionX=g}},metadata:_},t,i),he(null,null,s,{kind:"field",name:"wheelPrecisionY",static:!1,private:!1,access:{has:d=>"wheelPrecisionY"in d,get:d=>d.wheelPrecisionY,set:(d,g)=>{d.wheelPrecisionY=g}},metadata:_},r,o),he(null,null,c,{kind:"field",name:"wheelPrecisionZ",static:!1,private:!1,access:{has:d=>"wheelPrecisionZ"in d,get:d=>d.wheelPrecisionZ,set:(d,g)=>{d.wheelPrecisionZ=g}},metadata:_},h,f),_&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_})})(),a})();var Pt;
154(function(a){a[a.MoveRelative=0]="MoveRelative",a[a.RotateRelative=1]="RotateRelative",a[a.MoveScene=2]="MoveScene"})(Pt||(Pt={}));let y1=(()=>{var a;let e=zI,t=[],i,s,r,o,c,h,f,_,d;return a=class extends e{constructor(){super(...arguments),this.camera=Z(this,t),this._moveRelative=E.Zero(),this._rotateRelative=E.Zero(),this._moveScene=E.Zero(),this._wheelXAction=Pt.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=Pt.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){return"FreeCameraMouseWheelInput"}set wheelXMoveRelative(p){p===null&&this._wheelXAction!==Pt.MoveRelative||(this._wheelXAction=Pt.MoveRelative,this._wheelXActionCoordinate=p)}get wheelXMoveRelative(){return this._wheelXAction!==Pt.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(p){p===null&&this._wheelYAction!==Pt.MoveRelative||(this._wheelYAction=Pt.MoveRelative,this._wheelYActionCoordinate=p)}get wheelYMoveRelative(){return this._wheelYAction!==Pt.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(p){p===null&&this._wheelZAction!==Pt.MoveRelative||(this._wheelZAction=Pt.MoveRelative,this._wheelZActionCoordinate=p)}get wheelZMoveRelative(){return this._wheelZAction!==Pt.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(p){p===null&&this._wheelXAction!==Pt.RotateRelative||(this._wheelXAction=Pt.RotateRelative,this._wheelXActionCoordinate=p)}get wheelXRotateRelative(){return this._wheelXAction!==Pt.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(p){p===null&&this._wheelYAction!==Pt.RotateRelative||(this._wheelYAction=Pt.RotateRelative,this._wheelYActionCoordinate=p)}get wheelYRotateRelative(){return this._wheelYAction!==Pt.RotateRelative?null:this._wheelYActionCoordinate}set wheelZRotateRelative(p){p===null&&this._wheelZAction!==Pt.RotateRelative||(this._wheelZAction=Pt.RotateRelative,this._wheelZActionCoordinate=p)}get wheelZRotateRelative(){return this._wheelZAction!==Pt.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(p){p===null&&this._wheelXAction!==Pt.MoveScene||(this._wheelXAction=Pt.MoveScene,this._wheelXActionCoordinate=p)}get wheelXMoveScene(){return this._wheelXAction!==Pt.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(p){p===null&&this._wheelYAction!==Pt.MoveScene||(this._wheelYAction=Pt.MoveScene,this._wheelYActionCoordinate=p)}get wheelYMoveScene(){return this._wheelYAction!==Pt.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(p){p===null&&this._wheelZAction!==Pt.MoveScene||(this._wheelZAction=Pt.MoveScene,this._wheelZActionCoordinate=p)}get wheelZMoveScene(){return this._wheelZAction!==Pt.MoveScene?null:this._wheelZActionCoordinate}checkInputs(){if(this._wheelDeltaX===0&&this._wheelDeltaY===0&&this._wheelDeltaZ==0)return;this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);const p=se.Zero();this.camera.getViewMatrix().invertToRef(p);const x=E.Zero();E.TransformNormalToRef(this._moveRelative,p,x),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(x),this.camera.cameraDirection.addInPlace(this._moveScene),super.checkInputs()}_updateCamera(){this._updateCameraProperty(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),this._updateCameraProperty(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),this._updateCameraProperty(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)}_updateCameraProperty(p,x,b){if(p===0||x===null||b===null)return;let T=null;switch(x){case Pt.MoveRelative:T=this._moveRelative;break;case Pt.RotateRelative:T=this._rotateRelative;break;case Pt.MoveScene:T=this._moveScene;break}switch(b){case 0:T.set(p,0,0);break;case 1:T.set(0,p,0);break;case 2:T.set(0,0,p);break}}},(()=>{const g=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[pe()],s=[pe()],r=[pe()],o=[pe()],c=[pe()],h=[pe()],f=[pe()],_=[pe()],d=[pe()],he(a,null,i,{kind:"setter",name:"wheelXMoveRelative",static:!1,private:!1,access:{has:p=>"wheelXMoveRelative"in p,set:(p,x)=>{p.wheelXMoveRelative=x}},metadata:g},null,t),he(a,null,s,{kind:"setter",name:"wheelYMoveRelative",static:!1,private:!1,access:{has:p=>"wheelYMoveRelative"in p,set:(p,x)=>{p.wheelYMoveRelative=x}},metadata:g},null,t),he(a,null,r,{kind:"setter",name:"wheelZMoveRelative",static:!1,private:!1,access:{has:p=>"wheelZMoveRelative"in p,set:(p,x)=>{p.wheelZMoveRelative=x}},metadata:g},null,t),he(a,null,o,{kind:"setter",name:"wheelXRotateRelative",static:!1,private:!1,access:{has:p=>"wheelXRotateRelative"in p,set:(p,x)=>{p.wheelXRotateRelative=x}},metadata:g},null,t),he(a,null,c,{kind:"setter",name:"wheelYRotateRelative",static:!1,private:!1,access:{has:p=>"wheelYRotateRelative"in p,set:(p,x)=>{p.wheelYRotateRelative=x}},metadata:g},null,t),he(a,null,h,{kind:"setter",name:"wheelZRotateRelative",static:!1,private:!1,access:{has:p=>"wheelZRotateRelative"in p,set:(p,x)=>{p.wheelZRotateRelative=x}},metadata:g},null,t),he(a,null,f,{kind:"setter",name:"wheelXMoveScene",static:!1,private:!1,access:{has:p=>"wheelXMoveScene"in p,set:(p,x)=>{p.wheelXMoveScene=x}},metadata:g},null,t),he(a,null,_,{kind:"setter",name:"wheelYMoveScene",static:!1,private:!1,access:{has:p=>"wheelYMoveScene"in p,set:(p,x)=>{p.wheelYMoveScene=x}},metadata:g},null,t),he(a,null,d,{kind:"setter",name:"wheelZMoveScene",static:!1,private:!1,access:{has:p=>"wheelZMoveScene"in p,set:(p,x)=>{p.wheelZMoveScene=x}},metadata:g},null,t),g&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})})(),a})();eo.FreeCameraMouseWheelInput=y1;let b1=(()=>{var a;let e,t=[],i=[],s,r=[],o=[];return a=class{constructor(h=!1){this.allowMouse=h,this.touchAngularSensibility=Z(this,t,2e5),this.touchMoveSensibility=(Z(this,i),Z(this,r,250)),this.singleFingerRotate=(Z(this,o),!1),this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array,this._isSafari=_t.IsSafari()}attachControl(h){h=_t.BackCompatCameraNoPreventDefault(arguments);let f=null;if(this._pointerInput===void 0&&(this._onLostFocus=()=>{this._offsetX=null,this._offsetY=null},this._pointerInput=_=>{const d=_.event,g=d.pointerType==="mouse"||this._isSafari&&typeof d.pointerType>"u";if(!(!this.allowMouse&&g)){if(_.type===at.POINTERDOWN){if(h||d.preventDefault(),this._pointerPressed.push(d.pointerId),this._pointerPressed.length!==1)return;f={x:d.clientX,y:d.clientY}}else if(_.type===at.POINTERUP){h||d.preventDefault();const p=this._pointerPressed.indexOf(d.pointerId);if(p===-1||(this._pointerPressed.splice(p,1),p!=0))return;f=null,this._offsetX=null,this._offsetY=null}else if(_.type===at.POINTERMOVE){if(h||d.preventDefault(),!f||this._pointerPressed.indexOf(d.pointerId)!=0)return;this._offsetX=d.clientX-f.x,this._offsetY=-(d.clientY-f.y)}}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,at.POINTERDOWN|at.POINTERUP|at.POINTERMOVE),this._onLostFocus){const d=this.camera.getEngine().getInputElement();d&&d.addEventListener("blur",this._onLostFocus)}}detachControl(){if(this._pointerInput){if(this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null),this._onLostFocus){const f=this.camera.getEngine().getInputElement();f&&f.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed.length=0,this._offsetX=null,this._offsetY=null}}
154checkInputs(){if(this._offsetX===null||this._offsetY===null||this._offsetX===0&&this._offsetY===0)return;const h=this.camera,f=h.movement.input,_=f.getEntry("touch","rotate"),d=f.getEntry("touch","translate"),g=h._calculateHandednessMultiplier(),p=this.singleFingerRotate&&this._pointerPressed.length===1||!this.singleFingerRotate&&this._pointerPressed.length>1;if(_){const x=_.sensitivity??1/this.touchAngularSensibility;h.cameraRotation.y=this._offsetX*g*x,p&&(h.cameraRotation.x=-(this._offsetY*g)*x)}if(!p&&d){const x=h._computeLocalCameraSpeed(),b=d.sensitivity??(this.touchMoveSensibility!==0?1/this.touchMoveSensibility:0),T=fe.Vector3[0];T.copyFromFloats(0,0,x*this._offsetY*b),se.RotationYawPitchRollToRef(h.rotation.y,h.rotation.x,0,h._cameraRotationMatrix),E.TransformCoordinatesToRef(T,h._cameraRotationMatrix,T),h.cameraDirection.addInPlace(T)}}getClassName(){return"FreeCameraTouchInput"}getSimpleName(){return"touch"}},(()=>{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[pe()],s=[pe()],he(null,null,e,{kind:"field",name:"touchAngularSensibility",static:!1,private:!1,access:{has:h=>"touchAngularSensibility"in h,get:h=>h.touchAngularSensibility,set:(h,f)=>{h.touchAngularSensibility=f}},metadata:c},t,i),he(null,null,s,{kind:"field",name:"touchMoveSensibility",static:!1,private:!1,access:{has:h=>"touchMoveSensibility"in h,get:h=>h.touchMoveSensibility,set:(h,f)=>{h.touchMoveSensibility=f}},metadata:c},r,o),c&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})})(),a})();eo.FreeCameraTouchInput=b1;var vb,Tb,Rb;class Mh extends UI{constructor(e){super(e),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){return this.add(new m1),this}addMouse(e=!0){return this._mouseInput||(this._mouseInput=new p1(e),this.add(this._mouseInput)),this}removeMouse(){return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){return this._mouseWheelInput||(this._mouseWheelInput=new y1,this.add(this._mouseWheelInput)),this}removeMouseWheel(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){return this.add(new b1),this}clear(){super.clear(),this._mouseInput=null}}(vb=Mh.prototype).addDeviceOrientation??(vb.addDeviceOrientation=He("FreeCameraInputsManager","addDeviceOrientation"));(Tb=Mh.prototype).addVirtualJoystick??(Tb.addVirtualJoystick=He("FreeCameraInputsManager","addVirtualJoystick"));(Rb=Mh.prototype).addGamepad??(Rb.addGamepad=He("FreeCameraInputsManager","addGamepad"));let x1=(()=>{var a;let e=LI,t,i=[],s=[],r,o=[],c=[],h,f=[],_=[],d,g=[],p=[];return a=class extends e{get angularSensibility(){const b=this.inputs.attached.mouse;return b?b.angularSensibility:0}set angularSensibility(b){const T=this.inputs.attached.mouse;T&&(T.angularSensibility=b)}get keysUp(){const b=this.inputs.attached.keyboard;return b?b.keysUp:[]}set keysUp(b){const T=this.inputs.attached.keyboard;T&&(T.keysUp=b)}get keysUpward(){const b=this.inputs.attached.keyboard;return b?b.keysUpward:[]}set keysUpward(b){const T=this.inputs.attached.keyboard;T&&(T.keysUpward=b)}get keysDown(){const b=this.inputs.attached.keyboard;return b?b.keysDown:[]}set keysDown(b){const T=this.inputs.attached.keyboard;T&&(T.keysDown=b)}get keysDownward(){const b=this.inputs.attached.keyboard;return b?b.keysDownward:[]}set keysDownward(b){const T=this.inputs.attached.keyboard;T&&(T.keysDownward=b)}get keysLeft(){const b=this.inputs.attached.keyboard;return b?b.keysLeft:[]}set keysLeft(b){const T=this.inputs.attached.keyboard;T&&(T.keysLeft=b)}get keysRight(){const b=this.inputs.attached.keyboard;return b?b.keysRight:[]}set keysRight(b){const T=this.inputs.attached.keyboard;T&&(T.keysRight=b)}get keysRotateLeft(){const b=this.inputs.attached.keyboard;return b?b.keysRotateLeft:[]}set keysRotateLeft(b){const T=this.inputs.attached.keyboard;T&&(T.keysRotateLeft=b)}get keysRotateRight(){const b=this.inputs.attached.keyboard;return b?b.keysRotateRight:[]}set keysRotateRight(b){const T=this.inputs.attached.keyboard;T&&(T.keysRotateRight=b)}get keysRotateUp(){const b=this.inputs.attached.keyboard;return b?b.keysRotateUp:[]}set keysRotateUp(b){const T=this.inputs.attached.keyboard;T&&(T.keysRotateUp=b)}get keysRotateDown(){const b=this.inputs.attached.keyboard;return b?b.keysRotateDown:[]}set keysRotateDown(b){const T=this.inputs.attached.keyboard;T&&(T.keysRotateDown=b)}constructor(b,T,R,S=!0){super(b,T,R,S),this.ellipsoid=Z(this,i,new E(.5,1,.5)),this.ellipsoidOffset=(Z(this,s),Z(this,o,new E(0,0,0))),this.checkCollisions=(Z(this,c),Z(this,f,!1)),this.applyGravity=(Z(this,_),Z(this,g,!1)),this.inputs=Z(this,p),this._needMoveForGravity=!1,this._oldPosition=E.Zero(),this._diffPosition=E.Zero(),this._newPosition=E.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(M,I,A=null)=>{this._newPosition.copyFrom(I),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>Ve.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&A&&this.onCollide(A))},this.inputs=new Mh(this),this.inputs.addKeyboard().addMouse()}attachControl(b,T){T=_t.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(T)}detachControl(){this.inputs.detachElement(),this.cameraDirection=new E(0,0,0),this.cameraRotation=new Ue(0,0)}get collisionMask(){return this._collisionMask}set collisionMask(b){this._collisionMask=isNaN(b)?-1:b}_collideWithWorld(b){let T;this.parent?T=E.TransformCoordinates(this.position,this.parent.getWorldMatrix()):T=this.position,T.subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);const R=this.getScene().collisionCoordinator;this._collider||(this._collider=R.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let S=b;this.applyGravity&&(S=b.add(this.getScene().gravity)),R.getNewPosition(this._oldPosition,S,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){this._localDirection||(this._localDirection=E.Zero(),this._transformedDirection=E.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(b){this._needMoveForGravity=b}get needMoveForGravity(){return this._needMoveForGravity}_decideIfNeedsToMove(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}
154_updatePosition(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"FreeCamera"}},(()=>{const x=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[vr()],r=[vr()],h=[pe()],d=[pe()],he(null,null,t,{kind:"field",name:"ellipsoid",static:!1,private:!1,access:{has:b=>"ellipsoid"in b,get:b=>b.ellipsoid,set:(b,T)=>{b.ellipsoid=T}},metadata:x},i,s),he(null,null,r,{kind:"field",name:"ellipsoidOffset",static:!1,private:!1,access:{has:b=>"ellipsoidOffset"in b,get:b=>b.ellipsoidOffset,set:(b,T)=>{b.ellipsoidOffset=T}},metadata:x},o,c),he(null,null,h,{kind:"field",name:"checkCollisions",static:!1,private:!1,access:{has:b=>"checkCollisions"in b,get:b=>b.checkCollisions,set:(b,T)=>{b.checkCollisions=T}},metadata:x},f,_),he(null,null,d,{kind:"field",name:"applyGravity",static:!1,private:!1,access:{has:b=>"applyGravity"in b,get:b=>b.applyGravity,set:(b,T)=>{b.applyGravity=T}},metadata:x},g,p),x&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:x})})(),a})(),Ab=!1;function VI(){Ab||(Ab=!0,pr("BABYLON.FreeCamera",x1))}VI();qD();function Id(a,e,t){try{const i=a.next();i.done?e(i):i.value?i.value.then(()=>{i.value=void 0,e(i)},t):e(i)}catch(i){t(i)}}function GI(a=25){let e;return(t,i,s)=>{const r=performance.now();e===void 0||r-e>a?(e=r,setTimeout(()=>{Id(t,i,s)},0)):Id(t,i,s)}}function v1(a,e,t,i,s){const r=()=>{let o;const c=h=>{h.done?t(h.value):o===void 0?o=!0:r()};do o=void 0,e(a,c,i),o===void 0&&(o=!1);while(o)};r()}function r_(a,e){let t;return v1(a,Id,i=>t=i,i=>{throw i}),t}async function HI(a,e,t){return await new Promise((i,s)=>{v1(a,e,i,s)})}function WI(a,e){return(...t)=>r_(a(...t))}class uh{get isDisposed(){return this._isDisposed}constructor(e,t,i,s=0,r=!1,o=!1,c=!1,h,f){this._isAlreadyOwned=!1,this._isDisposed=!1,Jv(),e&&e.getScene?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=i,this._instanced=o,this._divisor=h||1,this._label=f,t instanceof xl?(this._data=null,this._buffer=t):(this._data=t,this._buffer=null),this.byteStride=c?s:s*Float32Array.BYTES_PER_ELEMENT,r||this.create()}createVertexBuffer(e,t,i,s,r,o=!1,c){const h=o?t:t*Float32Array.BYTES_PER_ELEMENT,f=s?o?s:s*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new F(this._engine,this,e,this._updatable,!0,f,r===void 0?this._instanced:r,h,i,void 0,void 0,!0,this._divisor||c)}isUpdatable(){return this._updatable}getData(){return this._data}getBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(e=null){!e&&this._buffer||(e=e||this._data,e&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e),this._data=e):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(e,this._label),this._data=e):this._buffer=this._engine.createVertexBuffer(e,void 0,this._label)))}_rebuild(){if(this._data)this._buffer=null,this.create(this._data);else{if(!this._buffer)return;if(this._buffer.capacity>0){this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label);return}me.Warn(`Missing data for buffer "${this._label}" ${this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":""}. Buffer reconstruction failed.`),this._buffer=null}}update(e){this.create(e)}updateDirectly(e,t,i,s=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,s?t:t*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),t===0&&i===void 0?this._data=e:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class F{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(e){const t=e!=0;this._instanceDivisor=e,t!==this._instanced&&(this._instanced=t,this._computeHashCode())}get _maxVerticesCount(){const e=this.getData();return e?Array.isArray(e)?e.length/(this.byteStride/4)-this.byteOffset/4:(e.byteLength-this.byteOffset)/this.byteStride:0}constructor(e,t,i,s,r,o,c,h,f,_,d=!1,g=!1,p=1,x=!1){this._isDisposed=!1;let b;if(this.engine=e,typeof s=="object"&&s!==null?(b=s.updatable??!1,r=s.postponeInternalCreation,o=s.stride,c=s.instanced,h=s.offset,f=s.size,_=s.type,d=s.normalized??!1,g=s.useBytes??!1,p=s.divisor??1,x=s.takeBufferOwnership??!1,this._label=s.label):b=!!s,t instanceof uh?(this._buffer=t,this._ownsBuffer=x):(this._buffer=new uh(e,t,b,o,r,c,g,p,this._label),this._ownsBuffer=!0),this.uniqueId=F._Counter++,this._kind=i,_===void 0){const R=this.getData();this.type=R?XI(R):F.FLOAT}else this.type=_;const T=br(this.type);g?(this._size=f||(o?o/T:wd(i)),this.byteStride=o||this._buffer.byteStride||this._size*T,this.byteOffset=h||0):(this._size=f||o||wd(i),this.byteStride=o?o*T:this._buffer.byteStride||this._size*T,this.byteOffset=(h||0)*T),this.normalized=d,this._instanced=c!==void 0?c:!1,this._instanceDivisor=c?p:0,this._alignBuffer(),this._computeHashCode()}static _GetTypeHashIndex(e){switch(e){case F.BYTE:return 0;case F.UNSIGNED_BYTE:return 1;case F.SHORT:return 2;case F.UNSIGNED_SHORT:return 3;case F.INT:return 4;case F.UNSIGNED_INT:return 5;case F.FLOAT:return 6;case F.HALF_FLOAT:return 7;default:throw new Error(`Invalid vertex buffer type '${e}'`)}}_computeHashCode(){this.hashCode=(F._GetTypeHashIndex(this.type)<<0)+((this.normalized?1:0)<<3)+(this._size-1<<4)+((this._instanced?1:0)<<6)+(this.byteStride<<12)}_rebuild(){this._buffer?._rebuild()}getKind(){return this._kind}
vendor: 40,872 bytes, line 154
154isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(e,t){const i=this.getData();return i?bI(i,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,e,t):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/br(this.type)}getOffset(){return this.byteOffset/br(this.type)}getSize(e=!1){return e?this._size*br(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(e){this._buffer.create(e),this._alignBuffer()}update(e){this._buffer.update(e),this._alignBuffer()}updateDirectly(e,t,i=!1){this._buffer.updateDirectly(e,t,void 0,i),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(e,t){Ah(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,(i,s)=>{for(let r=0;r<this._size;r++)t(i[r],s+r)})}_alignBuffer(){}}F._Counter=0;F.BYTE=5120;F.UNSIGNED_BYTE=5121;F.SHORT=5122;F.UNSIGNED_SHORT=5123;F.INT=5124;F.UNSIGNED_INT=5125;F.FLOAT=5126;F.HALF_FLOAT=5131;F.PositionKind="position";F.NormalKind="normal";F.TangentKind="tangent";F.UVKind="uv";F.UV2Kind="uv2";F.UV3Kind="uv3";F.UV4Kind="uv4";F.UV5Kind="uv5";F.UV6Kind="uv6";F.ColorKind="color";F.ColorInstanceKind="instanceColor";F.MatricesIndicesKind="matricesIndices";F.MatricesWeightsKind="matricesWeights";F.MatricesIndicesExtraKind="matricesIndicesExtra";F.MatricesWeightsExtraKind="matricesWeightsExtra";function wd(a){switch(a){case F.UVKind:case F.UV2Kind:case F.UV3Kind:case F.UV4Kind:case F.UV5Kind:case F.UV6Kind:return 2;case F.NormalKind:case F.PositionKind:return 3;case F.ColorKind:case F.ColorInstanceKind:case F.MatricesIndicesKind:case F.MatricesIndicesExtraKind:case F.MatricesWeightsKind:case F.MatricesWeightsExtraKind:case F.TangentKind:return 4;default:throw new Error("Invalid kind '"+a+"'")}}function XI(a){return a instanceof Int8Array?F.BYTE:a instanceof Uint8Array?F.UNSIGNED_BYTE:a instanceof Int16Array?F.SHORT:a instanceof Uint16Array?F.UNSIGNED_SHORT:a instanceof Int32Array?F.INT:a instanceof Uint32Array?F.UNSIGNED_INT:F.FLOAT}class Mb{constructor(e,t,i){this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}class Nn{constructor(e,t,i){this.vectors=xr(8,E.Zero),this.center=E.Zero(),this.centerWorld=E.Zero(),this.extendSize=E.Zero(),this.extendSizeWorld=E.Zero(),this.directions=xr(3,E.Zero),this.vectorsWorld=xr(8,E.Zero),this.minimumWorld=E.Zero(),this.maximumWorld=E.Zero(),this.minimum=E.Zero(),this.maximum=E.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,i)}reConstruct(e,t,i){const s=e.x,r=e.y,o=e.z,c=t.x,h=t.y,f=t.z,_=this.vectors;this.minimum.copyFromFloats(s,r,o),this.maximum.copyFromFloats(c,h,f),_[0].copyFromFloats(s,r,o),_[1].copyFromFloats(c,h,f),_[2].copyFromFloats(c,r,o),_[3].copyFromFloats(s,h,o),_[4].copyFromFloats(s,r,f),_[5].copyFromFloats(c,h,o),_[6].copyFromFloats(s,h,f),_[7].copyFromFloats(c,r,f),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||se.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){const t=Nn._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),s=i.length();i.normalizeFromLength(s);const r=s*e,o=i.scaleInPlace(r*.5),c=this.center.subtractToRef(o,t[1]),h=this.center.addToRef(o,t[2]);return this.reConstruct(c,h,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){const t=this.minimumWorld,i=this.maximumWorld,s=this.directions,r=this.vectorsWorld,o=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),i.copyFrom(this.maximum);for(let c=0;c<8;++c)r[c].copyFrom(o[c]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(let c=0;c<8;++c){const h=r[c];E.TransformCoordinatesToRef(o[c],e,h),t.minimizeInPlace(h),i.maximizeInPlace(h)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}E.FromArrayToRef(e.m,0,s[0]),E.FromArrayToRef(e.m,4,s[1]),E.FromArrayToRef(e.m,8,s[2]),this._worldMatrix=e}isInFrustum(e){return Nn.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return Nn.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){const t=this.minimumWorld,i=this.maximumWorld,s=t.x,r=t.y,o=t.z,c=i.x,h=i.y,f=i.z,_=e.x,d=e.y,g=e.z,p=-Bt;return!(c-_<p||p>_-s||h-d<p||p>d-r||f-g<p||p>g-o)}intersectsSphere(e){return Nn.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){const i=this.minimumWorld,s=this.maximumWorld,r=i.x,o=i.y,c=i.z,h=s.x,f=s.y,_=s.z,d=e.x,g=e.y,p=e.z,x=t.x,b=t.y,T=t.z;return!(h<d||r>x||f<g||o>b||_<p||c>T)}dispose(){this._drawWrapperFront?.dispose(),this._drawWrapperBack?.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,s){const r=Nn._TmpVector3[0];return E.ClampToRef(i,e,t,r),E.DistanceSquared(i,r)<=s*s}static IsCompletelyInFrustum(e,t){for(let i=0;i<6;++i){const s=t[i];for(let r=0;r<8;++r)if(s.dotCoordinate(e[r])<0)return!1}return!0}static IsInFrustum(e,t){for(let i=0;i<6;++i){let s=!0;const r=t[i];for(let o=0;o<8;++o)if(r.dotCoordinate(e[o])>=0){s=!1;break}if(s)return!1}return!0}}Nn._TmpVector3=xr(3,E.Zero);class $r{constructor(e,t,i){this.center=E.Zero(),this.centerWorld=E.Zero(),this.minimum=E.Zero(),this.maximum=E.Zero(),this.reConstruct(e,t,i)}reConstruct(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);const s=E.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=s*.5,this._update(i||se.IdentityReadOnly)}scale(e){const t=this.radius*e,i=$r._TmpVector3,s=i[0].setAll(t),r=this.center.subtractToRef(s,i[1]),o=this.center.addToRef(s,i[2]);return this.reConstruct(r,o,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{E.TransformCoordinatesToRef(this.center,e,this.centerWorld);const t=$r._TmpVector3[0];E.TransformNormalFromFloatsToRef(1,1,1,e,t),this.radiusWorld=Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))*this.radius}}isInFrustum(e){const t=this.centerWorld,i=this.radiusWorld;for(let s=0;s<6;s++)if(e[s].dotCoordinate(t)<=-i)return!1;return!0}isCenterInFrustum(e){const t=this.centerWorld;for(let i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0}intersectsPoint(e){const t=E.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)}static Intersects(e,t){const i=E.DistanceSquared(e.centerWorld,t.centerWorld),s=e.radiusWorld+t.radiusWorld;return!(s*s<i)}static CreateFromCenterAndRadius(e,t,i){this._TmpVector3[0].copyFrom(e),this._TmpVector3[1].copyFromFloats(0,0,t),this._TmpVector3[2].copyFrom(e),this._TmpVector3[0].addInPlace(this._TmpVector3[1]),this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);const s=new $r(this._TmpVector3[0],this._TmpVector3[2]);return i?s._worldMatrix=i:s._worldMatrix=se.Identity(),s}}$r._TmpVector3=xr(3,E.Zero);const sd={min:0,max:0},nd={min:0,max:0},Sb=(a,e,t)=>{const i=E.Dot(e.centerWorld,a),s=Math.abs(E.Dot(e.directions[0],a))*e.extendSize.x,r=Math.abs(E.Dot(e.directions[1],a))*e.extendSize.y,o=Math.abs(E.Dot(e.directions[2],a))*e.extendSize.z,c=s+r+o;t.min=i-c,t.max=i+c},$i=(a,e,t)=>(Sb(a,e,sd),Sb(a,t,nd),!(sd.min>nd.max||nd.min>sd.max));class Ms{constructor(e,t,i){this._isLocked=!1,this.boundingBox=new Nn(e,t,i),this.boundingSphere=new $r(e,t,i)}reConstruct(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)}get minimum(){return this.boundingBox.minimum}get maximum(){return this.boundingBox.maximum}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e}update(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))}centerOn(e,t){const i=Ms._TmpVector3[0].copyFrom(e).subtractInPlace(t),s=Ms._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this}encapsulate(e){const t=E.Minimize(this.minimum,e),i=E.Maximize(this.maximum,e);return this.reConstruct(t,i,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){const t=fe.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const i=fe.Vector3[0];return E.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,i),this.encapsulate(i),E.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,i),this.encapsulate(i),this}scale(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this}isInFrustum(e,t=0){return(t===2||t===3)&&this.boundingSphere.isCenterInFrustum(e)?!0:this.boundingSphere.isInFrustum(e)?t===1||t===3?!0:this.boundingBox.isInFrustum(e):!1}get diagonalLength(){const e=this.boundingBox;return e.maximumWorld.subtractToRef(e.minimumWorld,Ms._TmpVector3[0]).length()}isCompletelyInFrustum(e){return this.boundingBox.isCompletelyInFrustum(e)}_checkCollision(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)}intersectsPoint(e){return!(!this.boundingSphere.centerWorld||!this.boundingSphere.intersectsPoint(e)||!this.boundingBox.intersectsPoint(e))}intersects(e,t){if(!$r.Intersects(this.boundingSphere,e.boundingSphere)||!Nn.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const i=this.boundingBox,s=e.boundingBox;return!(!$i(i.directions[0],i,s)||!$i(i.directions[1],i,s)||!$i(i.directions[2],i,s)||!$i(s.directions[0],i,s)||!$i(s.directions[1],i,s)||!$i(s.directions[2],i,s)||!$i(E.Cross(i.directions[0],s.directions[0]),i,s)||!$i(E.Cross(i.directions[0],s.directions[1]),i,s)||!$i(E.Cross(i.directions[0],s.directions[2]),i,s)||!$i(E.Cross(i.directions[1],s.directions[0]),i,s)||!$i(E.Cross(i.directions[1],s.directions[1]),i,s)||!$i(E.Cross(i.directions[1],s.directions[2]),i,s)||!$i(E.Cross(i.directions[2],s.directions[0]),i,s)||!$i(E.Cross(i.directions[2],s.directions[1]),i,s)||!$i(E.Cross(i.directions[2],s.directions[2]),i,s))}}Ms._TmpVector3=xr(2,E.Zero);let T1=(()=>{var a;let e=[],t,i;return a=class{static extractMinAndMaxIndexed(r,o,c,h,f,_){for(let d=c;d<c+h;d++){const g=o[d]*3,p=r[g],x=r[g+1],b=r[g+2];f.minimizeInPlaceFromFloats(p,x,b),_.maximizeInPlaceFromFloats(p,x,b)}}static extractMinAndMax(r,o,c,h,f,_){for(let d=o,g=o*h;d<o+c;d++,g+=h){const p=r[g],x=r[g+1],b=r[g+2];f.minimizeInPlaceFromFloats(p,x,b),_.maximizeInPlaceFromFloats(p,x,b)}}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[yr.filter((...r)=>!Array.isArray(r[0])&&!Array.isArray(r[1]))],i=[yr.filter((...r)=>!Array.isArray(r[0]))],he(a,null,t,{kind:"method",name:"extractMinAndMaxIndexed",static:!0,private:!1,access:{has:r=>"extractMinAndMaxIndexed"in r,get:r=>r.extractMinAndMaxIndexed},metadata:s},null,e),he(a,null,i,{kind:"method",name:"extractMinAndMax",static:!0,private:!1,access:{has:r=>"extractMinAndMax"in r,get:r=>r.extractMinAndMax},metadata:s},null,e),s&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),Z(a,e)})(),a})();function qI(a,e,t,i,s=null){const r=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o=new E(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return T1.extractMinAndMaxIndexed(a,e,t,i,r,o),s&&(r.x-=r.x*s.x+s.y,r.y-=r.y*s.x+s.y,r.z-=r.z*s.x+s.y,o.x+=o.x*s.x+s.y,o.y+=o.y*s.x+s.y,o.z+=o.z*s.x+s.y),{minimum:r,maximum:o}}function R1(a,e,t,i=null,s){const r=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o=new E(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return s||(s=3),T1.extractMinAndMax(a,e,t,s,r,o),i&&(r.x-=r.x*i.x+i.y,r.y-=r.y*i.x+i.y,r.z-=r.z*i.x+i.y,o.x+=o.x*i.x+i.y,o.y+=o.y*i.x+i.y,o.z+=o.z*i.x+i.y),{minimum:r,maximum:o}}class A1{static GetEffect(e){return e.getPipelineContext===void 0?e.effect:e}constructor(e,t=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,i=!0){this.effect=e,t!==void 0&&(this.defines=t),i&&this.drawContext?.reset()}dispose(e=!1){if(this.effect){const t=this.effect;e?t.dispose():Ki.SetImmediate(()=>{t.getEngine().onEndFrameObservable.addOnce(()=>{t.dispose()})}),this.effect=null}this.drawContext?.dispose()}}var Eb;class Ss{get materialDefines(){const e=this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:this._getDrawWrapper()?.defines;return typeof e=="string"?null:e}set materialDefines(e){const t=this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0);t.defines=e}_getDrawWrapper(e,t=!1){e=e??this._engine.currentRenderPassId;let i=this._drawWrappers[e];return!i&&t&&(this._drawWrappers[e]=i=new A1(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0,i=!1){t&&this._drawWrappers[e]?.dispose(i),this._drawWrappers[e]=void 0}get effect(){return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:this._getDrawWrapper()?.effect??null}get _drawWrapper(){return this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0)}get _drawWrapperOverride(){return this._mainDrawWrapperOverride}_setMainDrawWrapperOverride(e){this._mainDrawWrapperOverride=e}setEffect(e,t=null,i,s=!0){const r=this._drawWrapper;r.setEffect(e,t,s),i!==void 0&&(r.materialContext=i),e||(r.defines=null,r.materialContext=void 0)}resetDrawCache(e,t=!1){if(this._drawWrappers)if(e!==void 0){this._removeDrawWrapper(e,!0,t);return}else for(const i of this._drawWrappers)i?.dispose(t);this._drawWrappers=[]}static AddToMesh(e,t,i,s,r,o,c,h=!0){return new Ss(e,t,i,s,r,o,c,h)}constructor(e,t,i,s,r,o,c,h=!0,f=!0){this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=s,this.indexCount=r,this._mainDrawWrapperOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._wasDispatched=!1,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=o,this._renderingMesh=c||o,f&&o.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=o.subMeshes.length-1,h&&(this.refreshBoundingInfo(),o.computeWorldMatrix(!0))}get IsGlobal(){return this.verticesStart===0&&this.verticesCount===this._mesh.getTotalVertices()&&this.indexStart===0&&this.indexCount===this._mesh.getTotalIndices()}getBoundingInfo(){return this.IsGlobal||this._mesh.hasThinInstances?this._mesh.getBoundingInfo():this._boundingInfo}setBoundingInfo(e){return this._boundingInfo=e,this}getMesh(){return this._mesh}getRenderingMesh(){return this._renderingMesh}getReplacementMesh(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null}getEffectiveMesh(){const e=this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null;return e||this._renderingMesh}getMaterial(e=!0){const t=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId)??this._renderingMesh.material;if(t){if(this._isMultiMaterial(t)){const i=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==i&&(this._currentMaterial=i,this.resetDrawCache()),i}}else return e&&this._mesh.getScene()._hasDefaultMaterial?this._mesh.getScene().defaultMaterial:null;return t}_isMultiMaterial(e){return e.getSubMaterial!==void 0}refreshBoundingInfo(e=null){if(this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(F.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;const t=this._renderingMesh.getIndices();let i;if(this.indexStart===0&&this.indexCount===t.length){const s=this._renderingMesh.getBoundingInfo();i={minimum:s.minimum.clone(),maximum:s.maximum.clone()}}else i=qI(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new Ms(i.minimum,i.maximum),this}_checkCollision(e){return this.getBoundingInfo()._checkCollision(e)}updateBoundingInfo(e){let t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this}isInFrustum(e){const t=this.getBoundingInfo();return t?t.isInFrustum(e,this._mesh.cullingStrategy):!1}isCompletelyInFrustum(e){const t=this.getBoundingInfo();return t?t.isCompletelyInFrustum(e):!1}render(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this}_getLinesIndexBuffer(e,t){if(!this._linesIndexBuffer){const i=Math.floor(this.indexCount/3)*6,r=this.verticesStart+this.verticesCount>65535?new Uint32Array(i):new Uint16Array(i);let o=0;if(e.length===0)for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=3)r[o++]=c,r[o++]=c+1,r[o++]=c+1,r[o++]=c+2,r[o++]=c+2,r[o++]=c;else for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=3)r[o++]=e[c],r[o++]=e[c+1],r[o++]=e[c+1],r[o++]=e[c+2],r[o++]=e[c+2],r[o++]=e[c];this._linesIndexBuffer=t.createIndexBuffer(r),this._linesIndexCount=r.length}return this._linesIndexBuffer}canIntersects(e){const t=this.getBoundingInfo();return t?e.intersectsBox(t.boundingBox):!1}intersects(e,t,i,s,r){const o=this.getMaterial();if(!o)return null;let c=3,h=!1;switch(o.fillMode){case 3:case 5:case 6:case 8:return null;case 7:c=1,h=!0;break}return o.fillMode===4?i.length?this._intersectLines(e,t,i,this._mesh.intersectionThreshold,s):this._intersectUnIndexedLines(e,t,i,this._mesh.intersectionThreshold,s):!i.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,i,s,r):this._intersectTriangles(e,t,i,c,h,s,r)}_intersectLines(e,t,i,s,r){let o=null;for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=2){const h=t[i[c]],f=t[i[c+1]],_=e.intersectionSegment(h,f,s);if(!(_<0)&&(r||!o||_<o.distance)&&(o=new Mb(null,null,_),o.faceId=c/2,r))break}return o}_intersectUnIndexedLines(e,t,i,s,r){let o=null;for(let c=this.verticesStart;c<this.verticesStart+this.verticesCount;c+=2){const h=t[c],f=t[c+1],_=e.intersectionSegment(h,f,s);if(!(_<0)&&(r||!o||_<o.distance)&&(o=new Mb(null,null,_),o.faceId=c/2,r))break}return o}_intersectTriangles(e,t,i,s,r,o,c){let h=null,f=-1;for(let _=this.indexStart;_<this.indexStart+this.indexCount-(3-s);_+=s){f++;const d=i[_],g=i[_+1],p=i[_+2];if(r&&p===4294967295){_+=2;continue}const x=t[d],b=t[g],T=t[p];if(!x||!b||!T||c&&!c(x,b,T,e,d,g,p))continue;const R=e.intersectsTriangle(x,b,T);if(R){if(R.distance<0)continue;if((o||!h||R.distance<h.distance)&&(h=R,h.faceId=f,o))break}}return h}_intersectUnIndexedTriangles(e,t,i,s,r){let o=null;for(let c=this.verticesStart;c<this.verticesStart+this.verticesCount;c+=3){const h=t[c],f=t[c+1],_=t[c+2];if(r&&!r(h,f,_,e,-1,-1,-1))continue;const d=e.intersectsTriangle(h,f,_);if(d){if(d.distance<0)continue;if((s||!o||d.distance<o.distance)&&(o=d,o.faceId=c/3,s))break}}return o}_rebuild(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)}clone(e,t){const i=new Ss(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,e,t,!1);if(!this.IsGlobal){const s=this.getBoundingInfo();if(!s)return i;i._boundingInfo=new Ms(s.minimum,s.maximum)}return i}dispose(e=!1){this._linesIndexBuffer&&(this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null);const t=this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(t,1),this.resetDrawCache(void 0,e)}getClassName(){return"SubMesh"}static CreateFromIndices(e,t,i,s,r,o=!0){let c=Number.MAX_VALUE,h=-Number.MAX_VALUE;const _=(r||s).getIndices();for(let d=t;d<t+i;d++){const g=_[d];g<c&&(c=g),g>h&&(h=g)}return new Ss(e,c,h-c+1,t,i,s,r,o)}}(Eb=Ss.prototype).projectToRef??(Eb.projectToRef=He("SubMesh","projectToRef"));class rd{}let Be=(()=>{var a;let e=[],t,i,s,r;return a=class{constructor(){this.uniqueId=0,this.metadata={},this._applyTo=WI(this._applyToCoroutine.bind(this)),this.uniqueId=a._UniqueIdGenerator,a._UniqueIdGenerator++}set(c,h){switch(c.length||me.Warn(`Setting vertex data kind '${h}' with an empty array`),h){case F.PositionKind:this.positions=c;break;case F.NormalKind:this.normals=c;break;case F.TangentKind:this.tangents=c;break;case F.UVKind:this.uvs=c;break;case F.UV2Kind:this.uvs2=c;break;case F.UV3Kind:this.uvs3=c;break;case F.UV4Kind:this.uvs4=c;break;case F.UV5Kind:this.uvs5=c;break;case F.UV6Kind:this.uvs6=c;break;case F.ColorKind:this.colors=c;break;case F.MatricesIndicesKind:this.matricesIndices=c;break;case F.MatricesWeightsKind:this.matricesWeights=c;break;case F.MatricesIndicesExtraKind:this.matricesIndicesExtra=c;break;case F.MatricesWeightsExtraKind:this.matricesWeightsExtra=c;break}}applyToMesh(c,h){return this._applyTo(c,h,!1),this}applyToGeometry(c,h){return this._applyTo(c,h,!1),this}updateMesh(c){return this._update(c),this}updateGeometry(c){return this._update(c),this}*_applyToCoroutine(c,h=!1,f){if(this.positions&&(c.setVerticesData(F.PositionKind,this.positions,h),f&&(yield)),this.normals&&(c.setVerticesData(F.NormalKind,this.normals,h),f&&(yield)),this.tangents&&(c.setVerticesData(F.TangentKind,this.tangents,h),f&&(yield)),this.uvs&&(c.setVerticesData(F.UVKind,this.uvs,h),f&&(yield)),this.uvs2&&(c.setVerticesData(F.UV2Kind,this.uvs2,h),f&&(yield)),this.uvs3&&(c.setVerticesData(F.UV3Kind,this.uvs3,h),f&&(yield)),this.uvs4&&(c.setVerticesData(F.UV4Kind,this.uvs4,h),f&&(yield)),this.uvs5&&(c.setVerticesData(F.UV5Kind,this.uvs5,h),f&&(yield)),this.uvs6&&(c.setVerticesData(F.UV6Kind,this.uvs6,h),f&&(yield)),this.colors){const _=this.positions&&this.colors.length===this.positions.length?3:4;c.setVerticesData(F.ColorKind,this.colors,h,_),this.hasVertexAlpha&&c.hasVertexAlpha!==void 0&&(c.hasVertexAlpha=!0),f&&(yield)}if(this.matricesIndices&&(c.setVerticesData(F.MatricesIndicesKind,this.matricesIndices,h),f&&(yield)),this.matricesWeights&&(c.setVerticesData(F.MatricesWeightsKind,this.matricesWeights,h),f&&(yield)),this.matricesIndicesExtra&&(c.setVerticesData(F.MatricesIndicesExtraKind,this.matricesIndicesExtra,h),f&&(yield)),this.matricesWeightsExtra&&(c.setVerticesData(F.MatricesWeightsExtraKind,this.matricesWeightsExtra,h),f&&(yield)),this.indices?(c.setIndices(this.indices,null,h),f&&(yield)):c.setIndices([],null),c.subMeshes&&this.materialInfos&&this.materialInfos.length>1){const _=c;_.subMeshes=[];for(const d of this.materialInfos)new Ss(d.materialIndex,d.verticesStart,d.verticesCount,d.indexStart,d.indexCount,_)}return this}_update(c,h,f){return this.positions&&c.updateVerticesData(F.PositionKind,this.positions,h,f),this.normals&&c.updateVerticesData(F.NormalKind,this.normals,h,f),this.tangents&&c.updateVerticesData(F.TangentKind,this.tangents,h,f),this.uvs&&c.updateVerticesData(F.UVKind,this.uvs,h,f),this.uvs2&&c.updateVerticesData(F.UV2Kind,this.uvs2,h,f),this.uvs3&&c.updateVerticesData(F.UV3Kind,this.uvs3,h,f),this.uvs4&&c.updateVerticesData(F.UV4Kind,this.uvs4,h,f),this.uvs5&&c.updateVerticesData(F.UV5Kind,this.uvs5,h,f),this.uvs6&&c.updateVerticesData(F.UV6Kind,this.uvs6,h,f),this.colors&&c.updateVerticesData(F.ColorKind,this.colors,h,f),this.matricesIndices&&c.updateVerticesData(F.MatricesIndicesKind,this.matricesIndices,h,f),this.matricesWeights&&c.updateVerticesData(F.MatricesWeightsKind,this.matricesWeights,h,f),this.matricesIndicesExtra&&c.updateVerticesData(F.MatricesIndicesExtraKind,this.matricesIndicesExtra,h,f),this.matricesWeightsExtra&&c.updateVerticesData(F.MatricesWeightsExtraKind,this.matricesWeightsExtra,h,f),this.indices&&c.setIndices(this.indices,null),this}static _TransformVector3Coordinates(c,h,f=0,_=c.length){const d=fe.Vector3[0],g=fe.Vector3[1];for(let p=f;p<f+_;p+=3)E.FromArrayToRef(c,p,d),E.TransformCoordinatesToRef(d,h,g),c[p]=g.x,c[p+1]=g.y,c[p+2]=g.z}static _TransformVector3Normals(c,h,f=0,_=c.length){const d=fe.Vector3[0],g=fe.Vector3[1];for(let p=f;p<f+_;p+=3)E.FromArrayToRef(c,p,d),E.TransformNormalToRef(d,h,g),c[p]=g.x,c[p+1]=g.y,c[p+2]=g.z}static _TransformVector4Normals(c,h,f=0,_=c.length){const d=fe.Vector4[0],g=fe.Vector4[1];for(let p=f;p<f+_;p+=4)it.FromArrayToRef(c,p,d),it.TransformNormalToRef(d,h,g),c[p]=g.x,c[p+1]=g.y,c[p+2]=g.z,c[p+3]=g.w}static _FlipFaces(c,h=0,f=c.length){for(let _=h;_<h+f;_+=3){const d=c[_+1];c[_+1]=c[_+2],c[_+2]=d}}transform(c){const h=c.determinant()<0;return this.positions&&a._TransformVector3Coordinates(this.positions,c),this.normals&&a._TransformVector3Normals(this.normals,c),this.tangents&&a._TransformVector4Normals(this.tangents,c),h&&this.indices&&a._FlipFaces(this.indices),this}splitBasedOnMaterialID(){if(!this.materialInfos||this.materialInfos.length<2)return[this];const c=[];for(const h of this.materialInfos){const f=new a;if(this.positions&&(f.positions=this.positions.slice(h.verticesStart*3,(h.verticesCount+h.verticesStart)*3)),this.normals&&(f.normals=this.normals.slice(h.verticesStart*3,(h.verticesCount+h.verticesStart)*3)),this.tangents&&(f.tangents=this.tangents.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.colors&&(f.colors=this.colors.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.uvs&&(f.uvs=this.uvs.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs2&&(f.uvs2=this.uvs2.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs3&&(f.uvs3=this.uvs3.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs4&&(f.uvs4=this.uvs4.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs5&&(f.uvs5=this.uvs5.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs6&&(f.uvs6=this.uvs6.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.matricesIndices&&(f.matricesIndices=this.matricesIndices.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesIndicesExtra&&(f.matricesIndicesExtra=this.matricesIndicesExtra.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesWeights&&(f.matricesWeights=this.matricesWeights.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesWeightsExtra&&(f.matricesWeightsExtra=this.matricesWeightsExtra.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.indices){f.indices=[];for(let d=h.indexStart;d<h.indexStart+h.indexCount;d++)f.indices.push(this.indices[d]-h.verticesStart)}const _=new rd;_.indexStart=0,_.indexCount=f.indices?f.indices.length:0,_.materialIndex=h.materialIndex,_.verticesStart=0,_.verticesCount=(f.positions?f.positions.length:0)/3,f.materialInfos=[_],c.push(f)}return c}merge(c,h=!1,f=!1,_=!1,d=!1){const g=Array.isArray(c)?c.map(p=>({vertexData:p})):[{vertexData:c}];return r_(this._mergeCoroutine(void 0,g,h,!1,f,_,d))}*_mergeCoroutine(c,h,f=!1,_,d,g=!1,p=!1){this._validate();let x=h.map(M=>M.vertexData),b=this;if(p)for(const M of x)M&&(M._validate(),!this.normals&&M.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&M.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&M.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&M.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&M.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&M.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&M.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&M.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&M.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&M.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&M.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&M.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&M.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(const M of x)if(M){if(p)this.normals&&!M.normals&&(M.normals=new Float32Array(M.positions.length)),this.tangents&&!M.tangents&&(M.tangents=new Float32Array(M.positions.length/3*4)),this.uvs&&!M.uvs&&(M.uvs=new Float32Array(M.positions.length/3*2)),this.uvs2&&!M.uvs2&&(M.uvs2=new Float32Array(M.positions.length/3*2)),this.uvs3&&!M.uvs3&&(M.uvs3=new Float32Array(M.positions.length/3*2)),this.uvs4&&!M.uvs4&&(M.uvs4=new Float32Array(M.positions.length/3*2)),this.uvs5&&!M.uvs5&&(M.uvs5=new Float32Array(M.positions.length/3*2)),this.uvs6&&!M.uvs6&&(M.uvs6=new Float32Array(M.positions.length/3*2)),this.colors&&!M.colors&&(M.colors=new Float32Array(M.positions.length/3*4),M.colors.fill(1)),this.matricesIndices&&!M.matricesIndices&&(M.matricesIndices=new Float32Array(M.positions.length/3*4)),this.matricesWeights&&!M.matricesWeights&&(M.matricesWeights=new Float32Array(M.positions.length/3*4)),this.matricesIndicesExtra&&!M.matricesIndicesExtra&&(M.matricesIndicesExtra=new Float32Array(M.positions.length/3*4)),this.matricesWeightsExtra&&!M.matricesWeightsExtra&&(M.matricesWeightsExtra=new Float32Array(M.positions.length/3*4));else if(M._validate(),!this.normals!=!M.normals||!this.tangents!=!M.tangents||!this.uvs!=!M.uvs||!this.uvs2!=!M.uvs2||!this.uvs3!=!M.uvs3||!this.uvs4!=!M.uvs4||!this.uvs5!=!M.uvs5||!this.uvs6!=!M.uvs6||!this.colors!=!M.colors||!this.matricesIndices!=!M.matricesIndices||!this.matricesWeights!=!M.matricesWeights||!this.matricesIndicesExtra!=!M.matricesIndicesExtra||!this.matricesWeightsExtra!=!M.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes")}if(g){let M,I=0,A=0;const D=[];let C=null;const k=[];for(const L of this.splitBasedOnMaterialID())k.push({vertexData:L,transform:c});for(const L of h)if(L.vertexData)for(const J of L.vertexData.splitBasedOnMaterialID())k.push({vertexData:J,transform:L.transform});k.sort((L,J)=>{const te=L.vertexData.materialInfos?L.vertexData.materialInfos[0].materialIndex:0,ae=J.vertexData.materialInfos?J.vertexData.materialInfos[0].materialIndex:0;return te>ae?1:te===ae?0:-1});for(const L of k){const J=L.vertexData;if(J.materialInfos?M=J.materialInfos[0].materialIndex:M=0,C&&C.materialIndex===M)C.indexCount+=J.indices.length,C.verticesCount+=J.positions.length/3;else{const te=new rd;te.materialIndex=M,te.indexStart=I,te.indexCount=J.indices.length,te.verticesStart=A,te.verticesCount=J.positions.length/3,D.push(te),C=te}I+=J.indices.length,A+=J.positions.length/3}const H=k.splice(0,1)[0];b=H.vertexData,c=H.transform,x=k.map(L=>L.vertexData),h=k,this.materialInfos=D}const T=x.reduce((M,I)=>M+(I.indices?.length??0),b.indices?.length??0);let S=d||x.some(M=>M.indices===b.indices)?b.indices?.slice():b.indices;if(T>0){let M=S?.length??0;if(S||(S=new Array(T)),S.length!==T){if(Array.isArray(S))S.length=T;else{const A=f||S instanceof Uint32Array?new Uint32Array(T):new Uint16Array(T);A.set(S),S=A}c&&c.determinant()<0&&a._FlipFaces(S,0,M)}let I=b.positions?b.positions.length/3:0;for(const{vertexData:A,transform:D}of h)if(A.indices){for(let C=0;C<A.indices.length;C++)S[M+C]=A.indices[C]+I;D&&D.determinant()<0&&a._FlipFaces(S,M,A.indices.length),I+=A.positions.length/3,M+=A.indices.length,_&&(yield)}}return this.indices=S,this.positions=a._MergeElement(F.PositionKind,b.positions,c,h.map(M=>[M.vertexData.positions,M.transform])),_&&(yield),b.normals&&(this.normals=a._MergeElement(F.NormalKind,b.normals,c,h.map(M=>[M.vertexData.normals,M.transform])),_&&(yield)),b.tangents&&(this.tangents=a._MergeElement(F.TangentKind,b.tangents,c,h.map(M=>[M.vertexData.tangents,M.transform])),_&&(yield)),b.uvs&&(this.uvs=a._MergeElement(F.UVKind,b.uvs,c,h.map(M=>[M.vertexData.uvs,M.transform])),_&&(yield)),b.uvs2&&(this.uvs2=a._MergeElement(F.UV2Kind,b.uvs2,c,h.map(M=>[M.vertexData.uvs2,M.transform])),_&&(yield)),b.uvs3&&(this.uvs3=a._MergeElement(F.UV3Kind,b.uvs3,c,h.map(M=>[M.vertexData.uvs3,M.transform])),_&&(yield)),b.uvs4&&(this.uvs4=a._MergeElement(F.UV4Kind,b.uvs4,c,h.map(M=>[M.vertexData.uvs4,M.transform])),_&&(yield)),b.uvs5&&(this.uvs5=a._MergeElement(F.UV5Kind,b.uvs5,c,h.map(M=>[M.vertexData.uvs5,M.transform])),_&&(yield)),b.uvs6&&(this.uvs6=a._MergeElement(F.UV6Kind,b.uvs6,c,h.map(M=>[M.vertexData.uvs6,M.transform])),_&&(yield)),b.colors&&(this.colors=a._MergeElement(F.ColorKind,b.colors,c,h.map(M=>[M.vertexData.colors,M.transform])),(b.hasVertexAlpha!==void 0||h.some(M=>M.vertexData.hasVertexAlpha!==void 0))&&(this.hasVertexAlpha=b.hasVertexAlpha||h.some(M=>M.vertexData.hasVertexAlpha)),_&&(yield)),b.matricesIndices&&(this.matricesIndices=a._MergeElement(F.MatricesIndicesKind,b.matricesIndices,c,h.map(M=>[M.vertexData.matricesIndices,M.transform])),_&&(yield)),b.matricesWeights&&(this.matricesWeights=a._MergeElement(F.MatricesWeightsKind,b.matricesWeights,c,h.map(M=>[M.vertexData.matricesWeights,M.transform])),_&&(yield)),b.matricesIndicesExtra&&(this.matricesIndicesExtra=a._MergeElement(F.MatricesIndicesExtraKind,b.matricesIndicesExtra,c,h.map(M=>[M.vertexData.matricesIndicesExtra,M.transform])),_&&(yield)),b.matricesWeightsExtra&&(this.matricesWeightsExtra=a._MergeElement(F.MatricesWeightsExtraKind,b.matricesWeightsExtra,c,h.map(M=>[M.vertexData.matricesWeightsExtra,M.transform]))),this}static _MergeElement(c,h,f,_){const d=_.filter(x=>x[0]!==null&&x[0]!==void 0);if(!h&&d.length==0)return h;if(!h)return this._MergeElement(c,d[0][0],d[0][1],d.slice(1));const g=d.reduce((x,b)=>x+b[0].length,h.length),p=c===F.PositionKind?a._TransformVector3Coordinates:c===F.NormalKind?a._TransformVector3Normals:c===F.TangentKind?a._TransformVector4Normals:()=>{};if(h instanceof Float32Array){const x=new Float32Array(g);x.set(h),f&&p(x,f,0,h.length);let b=h.length;for(const[T,R]of d)x.set(T,b),R&&p(x,R,b,T.length),b+=T.length;return x}else{const x=new Array(g);for(let T=0;T<h.length;T++)x[T]=h[T];f&&p(x,f,0,h.length);let b=h.length;for(const[T,R]of d){for(let S=0;S<T.length;S++)x[b+S]=T[S];R&&p(x,R,b,T.length),b+=T.length}return x}}_validate(){if(!this.positions)throw new ro("Positions are required",Rh.MeshInvalidPositionsError);const c=(_,d)=>{const g=wd(_);if(d.length%g!==0)throw new Error("The "+_+"s array count must be a multiple of "+g);return d.length/g},h=c(F.PositionKind,this.positions),f=(_,d)=>{const g=c(_,d);if(g!==h)throw new Error("The "+_+"s element count ("+g+") does not match the positions count ("+h+")")};this.normals&&f(F.NormalKind,this.normals),this.tangents&&f(F.TangentKind,this.tangents),this.uvs&&f(F.UVKind,this.uvs),this.uvs2&&f(F.UV2Kind,this.uvs2),this.uvs3&&f(F.UV3Kind,this.uvs3),this.uvs4&&f(F.UV4Kind,this.uvs4),this.uvs5&&f(F.UV5Kind,this.uvs5),this.uvs6&&f(F.UV6Kind,this.uvs6),this.colors&&f(F.ColorKind,this.colors),this.matricesIndices&&f(F.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&f(F.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&f(F.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&f(F.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){const c=this.serialize();return a.Parse(c)}serialize(){const c={};if(this.positions&&(c.positions=Array.from(this.positions)),this.normals&&(c.normals=Array.from(this.normals)),this.tangents&&(c.tangents=Array.from(this.tangents)),this.uvs&&(c.uvs=Array.from(this.uvs)),this.uvs2&&(c.uvs2=Array.from(this.uvs2)),this.uvs3&&(c.uvs3=Array.from(this.uvs3)),this.uvs4&&(c.uvs4=Array.from(this.uvs4)),this.uvs5&&(c.uvs5=Array.from(this.uvs5)),this.uvs6&&(c.uvs6=Array.from(this.uvs6)),this.colors&&(c.colors=Array.from(this.colors),c.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(c.matricesIndices=Array.from(this.matricesIndices),c.matricesIndicesExpanded=!0),this.matricesWeights&&(c.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(c.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),c.matricesIndicesExtraExpanded=!0),this.matricesWeightsExtra&&(c.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),c.indices=this.indices?Array.from(this.indices):[],this.materialInfos){c.materialInfos=[];for(const h of this.materialInfos){const f={indexStart:h.indexStart,indexCount:h.indexCount,materialIndex:h.materialIndex,verticesStart:h.verticesStart,verticesCount:h.verticesCount};c.materialInfos.push(f)}}return c}static ExtractFromMesh(c,h,f){return a._ExtractFrom(c,h,f)}static ExtractFromGeometry(c,h,f){return a._ExtractFrom(c,h,f)}static _ExtractFrom(c,h,f){const _=new a;if(c.isVerticesDataPresent(F.PositionKind)&&(_.positions=c.getVerticesData(F.PositionKind,h,f)),c.isVerticesDataPresent(F.NormalKind)&&(_.normals=c.getVerticesData(F.NormalKind,h,f)),c.isVerticesDataPresent(F.TangentKind)&&(_.tangents=c.getVerticesData(F.TangentKind,h,f)),c.isVerticesDataPresent(F.UVKind)&&(_.uvs=c.getVerticesData(F.UVKind,h,f)),c.isVerticesDataPresent(F.UV2Kind)&&(_.uvs2=c.getVerticesData(F.UV2Kind,h,f)),c.isVerticesDataPresent(F.UV3Kind)&&(_.uvs3=c.getVerticesData(F.UV3Kind,h,f)),c.isVerticesDataPresent(F.UV4Kind)&&(_.uvs4=c.getVerticesData(F.UV4Kind,h,f)),c.isVerticesDataPresent(F.UV5Kind)&&(_.uvs5=c.getVerticesData(F.UV5Kind,h,f)),c.isVerticesDataPresent(F.UV6Kind)&&(_.uvs6=c.getVerticesData(F.UV6Kind,h,f)),c.isVerticesDataPresent(F.ColorKind)){const d=c.geometry||c,g=d.getVertexBuffer(F.ColorKind),p=d.getVerticesData(F.ColorKind,h,f);if(g.getSize()===3){const x=new Float32Array(p.length*4/3);for(let b=0,T=0;b<p.length;b+=3,T+=4)x[T]=p[b],x[T+1]=p[b+1],x[T+2]=p[b+2],x[T+3]=1;_.colors=x}else if(g.getSize()===4)_.colors=p;else throw new Error(`Unexpected number of color components: ${g.getSize()}`)}return c.isVerticesDataPresent(F.MatricesIndicesKind)&&(_.matricesIndices=c.getVerticesData(F.MatricesIndicesKind,h,f)),c.isVerticesDataPresent(F.MatricesWeightsKind)&&(_.matricesWeights=c.getVerticesData(F.MatricesWeightsKind,h,f)),c.isVerticesDataPresent(F.MatricesIndicesExtraKind)&&(_.matricesIndicesExtra=c.getVerticesData(F.MatricesIndicesExtraKind,h,f)),c.isVerticesDataPresent(F.MatricesWeightsExtraKind)&&(_.matricesWeightsExtra=c.getVerticesData(F.MatricesWeightsExtraKind,h,f)),_.indices=c.getIndices(h,f),_}static CreateRibbon(c){throw je("ribbonBuilder")}static CreateBox(c){throw je("boxBuilder")}static CreateTiledBox(c){throw je("tiledBoxBuilder")}static CreateTiledPlane(c){throw je("tiledPlaneBuilder")}static CreateSphere(c){throw je("sphereBuilder")}static CreateCylinder(c){throw je("cylinderBuilder")}static CreateTorus(c){throw je("torusBuilder")}static CreateLineSystem(c){throw je("linesBuilder")}static CreateDashedLines(c){throw je("linesBuilder")}static CreateGround(c){throw je("groundBuilder")}static CreateTiledGround(c){throw je("groundBuilder")}static CreateGroundFromHeightMap(c){throw je("groundBuilder")}static CreatePlane(c){throw je("planeBuilder")}static CreateDisc(c){throw je("discBuilder")}static CreatePolygon(c,h,f,_,d,g,p){throw je("polygonBuilder")}static CreateIcoSphere(c){throw je("icoSphereBuilder")}static CreatePolyhedron(c){throw je("polyhedronBuilder")}static CreateCapsule(c={orientation:E.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){throw je("capsuleBuilder")}static CreateTorusKnot(c){throw je("torusKnotBuilder")}static ComputeNormals(c,h,f,_){let d,g,p,x,b,T,R,S,M,I,A,D,C,k,H,L,J,te,ae,B,$=!1,z=!1,X=!1,q=!1,G=1,j=0,w=null;_&&($=!!_.facetNormals,z=!!_.facetPositions,X=!!_.facetPartitioning,G=_.useRightHandedSystem===!0?-1:1,j=_.ratio||0,q=!!_.depthSort,w=_.distanceTo,q&&w===void 0&&(w=E.Zero()));let O=0,U=0,W=0,oe=0;for(X&&_&&_.bbSize&&(O=_.subDiv.X*j/_.bbSize.x,U=_.subDiv.Y*j/_.bbSize.y,W=_.subDiv.Z*j/_.bbSize.z,oe=_.subDiv.max*_.subDiv.max,_.facetPartitioning.length=0),d=0;d<c.length;d++)f[d]=0;const le=h.length/3|0;for(d=0;d<le;d++){if(D=h[d*3]*3,C=D+1,k=D+2,H=h[d*3+1]*3,L=H+1,J=H+2,te=h[d*3+2]*3,ae=te+1,B=te+2,g=c[D]-c[H],p=c[C]-c[L],x=c[k]-c[J],b=c[te]-c[H],T=c[ae]-c[L],R=c[B]-c[J],S=G*(p*R-x*T),M=G*(x*b-g*R),I=G*(g*T-p*b),A=Math.sqrt(S*S+M*M+I*I),A=A===0?1:A,S/=A,M/=A,I/=A,$&&_&&(_.facetNormals[d].x=S,_.facetNormals[d].y=M,_.facetNormals[d].z=I),z&&_&&(_.facetPositions[d].x=(c[D]+c[H]+c[te])/3,_.facetPositions[d].y=(c[C]+c[L]+c[ae])/3,_.facetPositions[d].z=(c[k]+c[J]+c[B])/3),X&&_){const be=Math.floor((_.facetPositions[d].x-_.bInfo.minimum.x*j)*O),Ee=Math.floor((_.facetPositions[d].y-_.bInfo.minimum.y*j)*U),Fe=Math.floor((_.facetPositions[d].z-_.bInfo.minimum.z*j)*W),Y=Math.floor((c[D]-_.bInfo.minimum.x*j)*O),ue=Math.floor((c[C]-_.bInfo.minimum.y*j)*U),de=Math.floor((c[k]-_.bInfo.minimum.z*j)*W),we=Math.floor((c[H]-_.bInfo.minimum.x*j)*O),qe=
vendor: 4,866 bytes, line 154
154Math.floor((c[L]-_.bInfo.minimum.y*j)*U),ke=Math.floor((c[J]-_.bInfo.minimum.z*j)*W),ut=Math.floor((c[te]-_.bInfo.minimum.x*j)*O),Gt=Math.floor((c[ae]-_.bInfo.minimum.y*j)*U),Ot=Math.floor((c[B]-_.bInfo.minimum.z*j)*W),pt=Y+_.subDiv.max*ue+oe*de,Nt=we+_.subDiv.max*qe+oe*ke,Ft=ut+_.subDiv.max*Gt+oe*Ot,$e=be+_.subDiv.max*Ee+oe*Fe;_.facetPartitioning[$e]=_.facetPartitioning[$e]?_.facetPartitioning[$e]:[],_.facetPartitioning[pt]=_.facetPartitioning[pt]?_.facetPartitioning[pt]:[],_.facetPartitioning[Nt]=_.facetPartitioning[Nt]?_.facetPartitioning[Nt]:[],_.facetPartitioning[Ft]=_.facetPartitioning[Ft]?_.facetPartitioning[Ft]:[],_.facetPartitioning[pt].push(d),Nt!=pt&&_.facetPartitioning[Nt].push(d),Ft==Nt||Ft==pt||_.facetPartitioning[Ft].push(d),$e==pt||$e==Nt||$e==Ft||_.facetPartitioning[$e].push(d)}if(q&&_&&_.facetPositions){const be=_.depthSortedFacets[d];be.ind=d*3,be.sqDistance=E.DistanceSquared(_.facetPositions[d],w)}f[D]+=S,f[C]+=M,f[k]+=I,f[H]+=S,f[L]+=M,f[J]+=I,f[te]+=S,f[ae]+=M,f[B]+=I}for(d=0;d<f.length/3;d++)S=f[d*3],M=f[d*3+1],I=f[d*3+2],A=Math.sqrt(S*S+M*M+I*I),A=A===0?1:A,S/=A,M/=A,I/=A,f[d*3]=S,f[d*3+1]=M,f[d*3+2]=I}static _ComputeSides(c,h,f,_,d,g,p){const x=f.length,b=_.length;let T,R;switch(c=c||a.DEFAULTSIDE,c){case a.FRONTSIDE:break;case a.BACKSIDE:for(T=0;T<x;T+=3){const S=f[T];f[T]=f[T+2],f[T+2]=S}for(R=0;R<b;R++)_[R]=-_[R];break;case a.DOUBLESIDE:{const S=h.length,M=S/3;for(let D=0;D<S;D++)h[S+D]=h[D];for(T=0;T<x;T+=3)f[T+x]=f[T+2]+M,f[T+1+x]=f[T+1]+M,f[T+2+x]=f[T]+M;for(R=0;R<b;R++)_[b+R]=-_[R];const I=d.length;let A;for(A=0;A<I;A++)d[A+I]=d[A];for(g=g||new it(0,0,1,1),p=p||new it(0,0,1,1),A=0,T=0;T<I/2;T++)d[A]=g.x+(g.z-g.x)*d[A],d[A+1]=g.y+(g.w-g.y)*d[A+1],d[A+I]=p.x+(p.z-p.x)*d[A+I],d[A+I+1]=p.y+(p.w-p.y)*d[A+I+1],A+=2;break}}}static Parse(c){const h=new a,f=c.positions;f&&h.set(f,F.PositionKind);const _=c.normals;_&&h.set(_,F.NormalKind);const d=c.tangents;d&&h.set(d,F.TangentKind);const g=c.uvs;g&&h.set(g,F.UVKind);const p=c.uvs2;p&&h.set(p,F.UV2Kind);const x=c.uvs3;x&&h.set(x,F.UV3Kind);const b=c.uvs4;b&&h.set(b,F.UV4Kind);const T=c.uvs5;T&&h.set(T,F.UV5Kind);const R=c.uvs6;R&&h.set(R,F.UV6Kind);const S=c.colors;S&&(h.set(dt.CheckColors4(S,f.length/3),F.ColorKind),c.hasVertexAlpha!==void 0&&(h.hasVertexAlpha=c.hasVertexAlpha));const M=c.matricesIndices;M&&h.set(M,F.MatricesIndicesKind);const I=c.matricesWeights;I&&h.set(I,F.MatricesWeightsKind);const A=c.indices;A&&(h.indices=A);const D=c.materialInfos;if(D){h.materialInfos=[];for(const C of D){const k=new rd;k.indexCount=C.indexCount,k.indexStart=C.indexStart,k.verticesCount=C.verticesCount,k.verticesStart=C.verticesStart,k.materialIndex=C.materialIndex,h.materialInfos.push(k)}}return h}static ImportVertexData(c,h){const f=a.Parse(c);h.setAllVerticesData(f,c.updatable)}},(()=>{const o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[yr.filter((...c)=>!Array.isArray(c[0]))],i=[yr.filter((...c)=>!Array.isArray(c[0]))],s=[yr.filter((...c)=>!Array.isArray(c[0]))],r=[yr.filter((...c)=>!Array.isArray(c[0]))],he(a,null,t,{kind:"method",name:"_TransformVector3Coordinates",static:!0,private:!1,access:{has:c=>"_TransformVector3Coordinates"in c,get:c=>c._TransformVector3Coordinates},metadata:o},null,e),he(a,null,i,{kind:"method",name:"_TransformVector3Normals",static:!0,private:!1,access:{has:c=>"_TransformVector3Normals"in c,get:c=>c._TransformVector3Normals},metadata:o},null,e),he(a,null,s,{kind:"method",name:"_TransformVector4Normals",static:!0,private:!1,access:{has:c=>"_TransformVector4Normals"in c,get:c=>c._TransformVector4Normals},metadata:o},null,e),he(a,null,r,{kind:"method",name:"_FlipFaces",static:!0,private:!1,access:{has:c=>"_FlipFaces"in c,get:c=>c._FlipFaces},metadata:o},null,e),o&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),a.FRONTSIDE=(Z(a,e),0),a.BACKSIDE=1,a.DOUBLESIDE=2,a.DEFAULTSIDE=0,a._UniqueIdGenerator=0,a})();class es{static get ForceFullSceneLoadingForIncremental(){return es._ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){es._ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return es._ShowLoadingScreen}static set ShowLoadingScreen(e){es._ShowLoadingScreen=e}static get loggingLevel(){return es._LoggingLevel}static set loggingLevel(e){es._LoggingLevel=e}static get CleanBoneMatrixWeights(){return es._CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){es._CleanBoneMatrixWeights=e}}es._ForceFullSceneLoadingForIncremental=!1;es._ShowLoadingScreen=!0;es._CleanBoneMatrixWeights=!1;es._LoggingLevel=0;class Zi{get boundingBias(){return this._boundingBias}set boundingBias(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){const t=new Zi(Zi.RandomId(),e.getSce
vendor: 13,379 bytes, line 154
154ne());return t.applyToMesh(e),t}get meshes(){return this._meshes}constructor(e,t,i,s=!1,r=null,o=null){this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._extend={minimum:new E(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),maximum:new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||ft.LastCreatedScene,this._scene&&(this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=s,o!==null&&(this._totalVertices=o),i?this.setAllVerticesData(i,s):o===null&&(this._totalVertices=0),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),r&&(this.applyToMesh(r),r.computeWorldMatrix(!0)))}get extend(){return this._extend}getScene(){return this._scene}getEngine(){return this._engine}isReady(){return this.delayLoadState===1||this.delayLoadState===0}get doNotSerialize(){for(let e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0}_rebuild(){this._vertexArrayObjects&&(this._vertexArrayObjects={}),this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer"));const e=new Set;for(const t in this._vertexBuffers)e.add(this._vertexBuffers[t].getWrapperBuffer());e.forEach(t=>{t._rebuild()})}setAllVerticesData(e,t){e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,s){i&&Array.isArray(t)&&(t=new Float32Array(t));const r=new F(this._engine,t,e,{updatable:i,postponeInternalCreation:this._meshes.length===0,stride:s,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(r)}removeVerticesData(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){const s=e.getKind();this._vertexBuffers[s]&&i&&this._vertexBuffers[s].dispose(),e._buffer&&e._ownsBuffer&&e._buffer._increaseReferences(),this._vertexBuffers[s]=e;const r=this._meshes,o=r.length;if(s===F.PositionKind){this._totalVertices=t??e._maxVerticesCount,this._updateExtend(this.useBoundingInfoFromGeometry&&this._boundingInfo?null:e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();const c=this._extend&&this._extend.minimum||new E(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=this._extend&&this._extend.maximum||new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let f=0;f<o;f++){const _=r[f];_.buildBoundingInfo(c,h),_._createGlobalSubMesh(_.isUnIndexed),_.computeWorldMatrix(!0),_.synchronizeInstances()}}this._notifyUpdate(s)}updateVerticesDataDirectly(e,t,i,s=!1){const r=this.getVertexBuffer(e);r&&(r.updateDirectly(t,i,s),this._notifyUpdate(e))}updateVerticesData(e,t,i=!1){const s=this.getVertexBuffer(e);s&&(s.update(t),e===F.PositionKind&&this._updateBoundingInfo(i,t),this._notifyUpdate(e))}_updateBoundingInfo(e,t){if(e&&this._updateExtend(t),this._resetPointsArrayCache(),e){const i=this._meshes;for(const s of i){s.hasBoundingInfo?s.getBoundingInfo().reConstruct(this._extend.minimum,this._extend.maximum):s.buildBoundingInfo(this._extend.minimum,this._extend.maximum);const r=s.subMeshes;for(const o of r)o.refreshBoundingInfo()}}}_bind(e,t,i,s){if(!e)return;t===void 0&&(t=this._indexBuffer);const r=this.getVertexBuffers();if(!r)return;if(t!=this._indexBuffer||!this._vertexArrayObjects&&!s){this._engine.bindBuffers(r,t,e,i);return}const o=s||this._vertexArrayObjects,c=this._engine;o[e.key]||(o[e.key]=c.recordVertexArrayObject(r,t,e,i)),c.bindVertexArrayObject(o[e.key],t)}getTotalVertices(){return this.isReady()?this._totalVertices:0}getVerticesData(e,t,i){const s=this.getVertexBuffer(e);return s?s.getFloatData(this._totalVertices,i||t&&this._meshes.length!==1):null}copyVerticesData(e,t){const i=this.getVertexBuffer(e);if(!i)return;t[e]||(t[e]=new Float32Array(this._totalVertices*i.getSize()));const s=i.getData();s&&vI(s,i.getSize(),i.type,i.byteOffset,i.byteStride,i.normalized,this._totalVertices,t[e])}isVertexBufferUpdatable(e){const t=this._vertexBuffers[e];return t?t.isUpdatable():!1}getVertexBuffer(e){return this.isReady()?this._vertexBuffers[e]:null}getVertexBuffers(){return this.isReady()?this._vertexBuffers:null}isVerticesDataPresent(e){return this._vertexBuffers?this._vertexBuffers[e]!==void 0:this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1}getVerticesDataKinds(){const e=[];let t;if(!this._vertexBuffers&&this._delayInfo)for(t in this._delayInfo)e.push(t);else for(t in this._vertexBuffers)e.push(t);return e}updateIndices(e,t,i=!1){if(this._indexBuffer)if(!this._indexBufferIsUpdatable)this.setIndices(e,null,!0);else{const s=e.length!==this._indices.length;if(i||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),s)for(const r of this._meshes)r._createGlobalSubMesh(!0)}}setIndexBuffer(e,t,i,s=null){this._indices=[],this._indexBufferIsUpdatable=!1,this._indexBuffer=e,this._totalVertices=t,this._totalIndices=i,s===null?e.is32Bits=t>65535:e.is32Bits=s;for(const r of this._meshes)r._createGlobalSubMesh(!0),r.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1,s=!1){this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),t!=null&&(this._totalVertices=t);for(const r of this._meshes)r._createGlobalSubMesh(!s),r.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){return this.isReady()?this._totalIndices!==void 0?this._totalIndices:this._indices.length:0}getIndices(e,t){if(!this.isReady())return null;const i=this._indices;return!t&&(!e||this._meshes.length===1)?i:i.slice()}getIndexBuffer(){return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){!e||!this._vertexArrayObjects||this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){const i=this._meshes,s=i.indexOf(e);s!==-1&&(i.splice(s,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,i.length===0&&t&&this.dispose())}applyToMesh(e){if(e._geometry===this)return;const t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();const i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&(e=this.getVerticesData(F.PositionKind),!e))return;this._extend=R1(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){for(const t in this._vertexBuffers){const i=this._vertexBuffers[t];i._buffer.getBuffer()||i.create(),t===F.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo())}!this._indexBuffer&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects();for(const t of this._meshes)t._markSubMeshesAsAttributesDirty()}load(e,t){if(this.delayLoadState!==2){if(this.isReady()){t&&t();return}this.delayLoadState=2,this._queueLoad(e,t)}}_queueLoad(e,t){this.delayLoadingFile&&(e.addPendingData(this),(async()=>{try{const i=await e._loadDelayedFileAsync(this.delayLoadingFile,!1,!0);if(!this._delayLoadingFunction){e.removePendingData(this);return}this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);const s=this._meshes,r=s.length;for(let o=0;o<r;o++)this._applyToMesh(s[o]);t&&t()}catch(i){e.removePendingData(this),e.isDisposed||me.Error(`Unable to delay load geometry "${this.id}" from "${this.delayLoadingFile}": ${i}`)}})())}toLeftHanded(){const e=this.getIndices(!1);if(e!=null&&e.length>0){for(let s=0;s<e.length;s+=3){const r=e[s+0];e[s+0]=e[s+2],e[s+2]=r}this.setIndices(e)}const t=this.getVerticesData(F.PositionKind,!1);if(t!=null&&t.length>0){for(let s=0;s<t.length;s+=3)t[s+2]=-t[s+2];this.setVerticesData(F.PositionKind,t,!1)}const i=this.getVerticesData(F.NormalKind,!1);if(i!=null&&i.length>0){for(let s=0;s<i.length;s+=3)i[s+2]=-i[s+2];this.setVerticesData(F.NormalKind,i,!1)}}_resetPointsArrayCache(){this._positions=null}_generatePointsArray(){if(this._positions)return!0;const e=this.getVerticesData(F.PositionKind);if(!e||e.length===0)return!1;for(let t=this._positionsCache.length*3,i=this._positionsCache.length;t<e.length;t+=3,++i)this._positionsCache[i]=E.FromArray(e,t);for(let t=0,i=0;t<e.length;t+=3,++i)this._positionsCache[i].set(e[0+t],e[1+t],e[2+t]);return this._positionsCache.length=e.length/3,this._positions=this._positionsCache,!0}isDisposed(){return this._isDisposed}_disposeVertexArrayObjects(){if(this._vertexArrayObjects){for(const i in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[i]);this._vertexArrayObjects={};const e=this._meshes,t=e.length;for(let i=0;i<t;i++)e[i]._invalidateInstanceVertexArrayObject()}}dispose(){const e=this._meshes,t=e.length;let i;for(i=0;i<t;i++)this.releaseForMesh(e[i]);this._meshes.length=0,this._disposeVertexArrayObjects();for(const s in this._vertexBuffers)this._vertexBuffers[s].dispose();if(this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=0,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._parentContainer){const s=this._parentContainer.geometries.indexOf(this);s>-1&&this._parentContainer.geometries.splice(s,1),this._parentContainer=null}this._isDisposed=!0}copy(e){const t=new Zi(e,this._scene),i=this.getIndices(void 0,!0);i&&t.setIndices(i);let s=!1,r;for(r in this._vertexBuffers){const o=this.getVertexBuffer(r),c=o.getData();if(!c)continue;const h=o.isUpdatable(),f=o.getSize(),{type:_,byteOffset:d,byteStride:g,normalized:p}=o;s=s||h;let x=this._totalVertices;if(o.getIsInstanced()){let R;c instanceof Array?R=c.length*4:R=c.byteLength,x=R/g}const b=xI(c,f,_,d,g,x,!0),T=new F(this._engine,b,r,{updatable:h,useBytes:!1,stride:f,size:f,offset:0,type:_,normalized:p,takeBufferOwnership:!0,instanced:o.getIsInstanced()});t.setVerticesBuffer(T,x)}t._updatable=s,t.delayLoadState=this.delayLoadState,t.delayLoadingFile=this.delayLoadingFile,t._delayLoadingFunction=this._delayLoadingFunction;for(r in this._delayInfo)t._delayInfo=t._delayInfo||[],t._delayInfo.push(r);return t._boundingInfo=new Ms(this._extend.minimum,this._extend.maximum),t}serialize(){const e={};return e.id=this.id,e.uniqueId=this.uniqueId,e.updatable=this._updatable,xt&&xt.HasTags(this)&&(e.tags=xt.GetTags(this)),e}_toNumberArray(e){return Array.isArray(e)?e:Array.prototype.slice.call(e)}clearCachedData(){this._totalIndices=this._indices.length,this._indices=[],this._resetPointsArrayCache();for(const e in this._vertexBuffers)Object.prototype.hasOwnProperty.call(this._vertexBuffers,e)&&(this._vertexBuffers[e]._buffer._data=null)}serializeVerticeData(){const e=this.serialize();return this.isVerticesDataPresent(F.PositionKind)&&(e.positions=this._toNumberArray(this.getVerticesData(F.PositionKind)),this.isVertexBufferUpdatable(F.PositionKind)&&(e.positionsUpdatable=!0)),this.isVerticesDataPresent(F.NormalKind)&&(e.normals=this._toNumberArray(this.getVerticesData(F.NormalKind)),this.isVertexBufferUpdatable(F.NormalKind)&&(e.normalsUpdatable=!0)),this.isVerticesDataPresent(F.TangentKind)&&(e.tangents=this._toNumberArray(this.getVerticesData(F.TangentKind)),this.isVertexBufferUpdatable(F.TangentKind)&&(e.tangentsUpdatable=!0)),this.isVerticesDataPresent(F.UVKind)&&(e.uvs=this._toNumberArray(this.getVerticesData(F.UVKind)),this.isVertexBufferUpdatable(F.UVKind)&&(e.uvsUpdatable=!0)),this.isVerticesDataPresent(F.UV2Kind)&&(e.uvs2=this._toNumberArray(this.getVerticesData(F.UV2Kind)),this.isVertexBufferUpdatable(F.UV2Kind)&&(e.uvs2Updatable=!0)),this.isVerticesDataPresent(F.UV3Kind)&&(e.uvs3=this._toNumberArray(this.getVerticesData(F.UV3Kind)),this.isVertexBufferUpdatable(F.UV3Kind)&&(e.uvs3Updatable=!0)),this.isVerticesDataPresent(F.UV4Kind)&&(e.uvs4=this._toNumberArray(this.getVerticesData(F.UV4Kind)),this.isVertexBufferUpdatable(F.UV4Kind)&&(e.uvs4Updatable=!0)),this.isVerticesDataPresent(F.UV5Kind)&&(e.uvs5=this._toNumberArray(this.getVerticesData(F.UV5Kind)),this.isVertexBufferUpdatable(F.UV5Kind)&&(e.uvs5Updatable=!0)),this.isVerticesDataPresent(F.UV6Kind)&&(e.uvs6=this._toNumberArray(this.getVerticesData(F.UV6Kind)),this.isVertexBufferUpdatable(F.UV6Kind)&&(e.uvs6Up
154datable=!0)),this.isVerticesDataPresent(F.ColorKind)&&(e.colors=this._toNumberArray(this.getVerticesData(F.ColorKind)),this.isVertexBufferUpdatable(F.ColorKind)&&(e.colorsUpdatable=!0)),this.isVerticesDataPresent(F.MatricesIndicesKind)&&(e.matricesIndices=this._toNumberArray(this.getVerticesData(F.MatricesIndicesKind)),e.matricesIndicesExpanded=!0,this.isVertexBufferUpdatable(F.MatricesIndicesKind)&&(e.matricesIndicesUpdatable=!0)),this.isVerticesDataPresent(F.MatricesWeightsKind)&&(e.matricesWeights=this._toNumberArray(this.getVerticesData(F.MatricesWeightsKind)),this.isVertexBufferUpdatable(F.MatricesWeightsKind)&&(e.matricesWeightsUpdatable=!0)),e.indices=this._toNumberArray(this.getIndices()),e}static ExtractFromMesh(e,t){const i=e._geometry;return i?i.copy(t):null}static RandomId(){return _t.RandomId()}static _GetGeometryByLoadedUniqueId(e,t){for(let i=0;i<t.geometries.length;i++)if(t.geometries[i]._loadedUniqueId===e)return t.geometries[i];return null}static _ImportGeometry(e,t){const i=t.getScene(),s=e.geometryUniqueId,r=e.geometryId;if(s||r){const o=s?this._GetGeometryByLoadedUniqueId(s,i):i.getGeometryById(r);o&&o.applyToMesh(t)}else if(e instanceof ArrayBuffer){const o=t._binaryInfo;if(o.positionsAttrDesc&&o.positionsAttrDesc.count>0){const c=new Float32Array(e,o.positionsAttrDesc.offset,o.positionsAttrDesc.count);t.setVerticesData(F.PositionKind,c,!1)}if(o.normalsAttrDesc&&o.normalsAttrDesc.count>0){const c=new Float32Array(e,o.normalsAttrDesc.offset,o.normalsAttrDesc.count);t.setVerticesData(F.NormalKind,c,!1)}if(o.tangetsAttrDesc&&o.tangetsAttrDesc.count>0){const c=new Float32Array(e,o.tangetsAttrDesc.offset,o.tangetsAttrDesc.count);t.setVerticesData(F.TangentKind,c,!1)}if(o.uvsAttrDesc&&o.uvsAttrDesc.count>0){const c=new Float32Array(e,o.uvsAttrDesc.offset,o.uvsAttrDesc.count);t.setVerticesData(F.UVKind,c,!1)}if(o.uvs2AttrDesc&&o.uvs2AttrDesc.count>0){const c=new Float32Array(e,o.uvs2AttrDesc.offset,o.uvs2AttrDesc.count);t.setVerticesData(F.UV2Kind,c,!1)}if(o.uvs3AttrDesc&&o.uvs3AttrDesc.count>0){const c=new Float32Array(e,o.uvs3AttrDesc.offset,o.uvs3AttrDesc.count);t.setVerticesData(F.UV3Kind,c,!1)}if(o.uvs4AttrDesc&&o.uvs4AttrDesc.count>0){const c=new Float32Array(e,o.uvs4AttrDesc.offset,o.uvs4AttrDesc.count);t.setVerticesData(F.UV4Kind,c,!1)}if(o.uvs5AttrDesc&&o.uvs5AttrDesc.count>0){const c=new Float32Array(e,o.uvs5AttrDesc.offset,o.uvs5AttrDesc.count);t.setVerticesData(F.UV5Kind,c,!1)}if(o.uvs6AttrDesc&&o.uvs6AttrDesc.count>0){const c=new Float32Array(e,o.uvs6AttrDesc.offset,o.uvs6AttrDesc.count);t.setVerticesData(F.UV6Kind,c,!1)}if(o.colorsAttrDesc&&o.colorsAttrDesc.count>0){const c=new Float32Array(e,o.colorsAttrDesc.offset,o.colorsAttrDesc.count);t.setVerticesData(F.ColorKind,c,!1,o.colorsAttrDesc.stride)}if(o.matricesIndicesAttrDesc&&o.matricesIndicesAttrDesc.count>0){const c=new Int32Array(e,o.matricesIndicesAttrDesc.offset,o.matricesIndicesAttrDesc.count),h=[];for(let f=0;f<c.length;f++){const _=c[f];h.push(_&255),h.push((_&65280)>>8),h.push((_&16711680)>>16),h.push(_>>24&255)}t.setVerticesData(F.MatricesIndicesKind,h,!1)}if(o.matricesIndicesExtraAttrDesc&&o.matricesIndicesExtraAttrDesc.count>0){const c=new Int32Array(e,o.matricesIndicesExtraAttrDesc.offset,o.matricesIndicesExtraAttrDesc.count),h=[];for(let f=0;f<c.length;f++){const _=c[f];h.push(_&255),h.push((_&65280)>>8),h.push((_&16711680)>>16),h.push(_>>24&255)}t.setVerticesData(F.MatricesIndicesExtraKind,h,!1)}if(o.matricesWeightsAttrDesc&&o.matricesWeightsAttrDesc.count>0){const c=new Float32Array(e,o.matricesWeightsAttrDesc.offset,o.matricesWeightsAttrDesc.count);t.setVerticesData(F.MatricesWeightsKind,c,!1)}if(o.indicesAttrDesc&&o.indicesAttrDesc.count>0){const c=new Int32Array(e,o.indicesAttrDesc.offset,o.indicesAttrDesc.count);t.setIndices(c,null)}if(o.subMeshesAttrDesc&&o.subMeshesAttrDesc.count>0){const c=new Int32Array(e,o.subMeshesAttrDesc.offset,o.subMeshesAttrDesc.count*5);t.subMeshes=[];for(let h=0;h<o.subMeshesAttrDesc.count;h++){const f=c[h*5+0],_=c[h*5+1],d=c[h*5+2],g=c[h*5+3],p=c[h*5+4];Ss.AddToMesh(f,_,d,g,p,t)}}}else if(e.positions&&e.normals&&e.indices){if(t.setVerticesData(F.PositionKind,e.positions,e.positions._updatable||e.positionsUpdatable),t.setVerticesData(F.NormalKind,e.normals,e.normals._updatable||e.normalsUpdatable),e.tangents&&t.setVerticesData(F.TangentKind,e.tangents,e.tangents._updatable||e.tangentsUpdatable),e.uvs&&t.setVerticesData(F.UVKind,e.uvs,e.uvs._updatable||e.uvsUpdatable),e.uvs2&&t.setVerticesData(F.UV2Kind,e.uvs2,e.uvs2._updatable||e.uvs2Updatable),e.uvs3&&t.setVerticesData(F.UV3Kind,e.uvs3,e.uvs3._updatable||e.uvs3Updatable),e.uvs4&&t.setVerticesData(F.UV4Kind,e.uvs4,e.uvs4._updatable||e.uvs4Updatable),e.uvs5&&t.setVerticesData(F.UV5Kind,e.uvs5,e.uvs5._updatable||e.uvs5Updatable),e.uvs6&&t.setVerticesData(F.UV6Kind,e.uvs6,e.uvs6._updatable||e.uvs6Updatable),e.colors&&t.setVerticesData(F.ColorKind,dt.CheckColors4(e.colors,e.positions.length/3),e.colors._updatable),e.matricesIndices)if(!e.matricesIndices._isExpanded&&!e.matricesIndicesExpanded){const o=[];for(let c=0;c<e.matricesIndices.length;c++){const h=e.matricesIndices[c];o.push(h&255),o.push((h&65280)>>8),o.push((h&16711680)>>16),o.push(h>>24&255)}t.setVerticesData(F.MatricesIndicesKind,o,e.matricesIndices._updatable||e.matricesIndicesUpdatable)}else delete e.matricesIndices._isExpanded,delete e.matricesIndicesExpanded,t.setVerticesData(F.MatricesIndicesKind,e.matricesIndices,e.matricesIndices._updatable||e.matricesIndicesUpdatable);if(e.matricesIndicesExtra)if(e.matricesIndicesExtraExpanded||e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExtraExpanded,t.setVerticesData(F.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable);else{const o=[];for(let c=0;c<e.matricesIndicesExtra.length;c++){const h=e.matricesIndicesExtra[c];o.push(h&255),o.push((h&65280)>>8),o.push((h&16711680)>>16),o.push(h>>24&255)}t.setVerticesData(F.MatricesIndicesExtraKind,o,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable)}e.matricesWeights&&(Zi._CleanMatricesWeights(e,t),t.setVerticesData(F.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(F.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let o=0;o<e.subMeshes.length;o++){const c=e.subMeshes[o];Ss.AddToMesh(c.materialIndex,c.verticesStart,c.verticesCount,c.indexStart,c.indexCount,t)}}t._shouldGenerateFlatShading&&(t.convertToFlatShadedMesh(),t._shouldGenerateFlatShading=!1),t.computeWorldMatrix(!0),i.onMeshImportedObservable.notifyObservers(t)}static _CleanMatricesWeights(e,t){if(!es.CleanBoneMatrixWeights)return;let s;if(e.skeletonId>
vendor: 7,238 bytes, line 154
154-1){const d=t.getScene().getLastSkeletonById(e.skeletonId);if(!d)return;s=d.bones.length}else return;const r=t.getVerticesData(F.MatricesIndicesKind),o=t.getVerticesData(F.MatricesIndicesExtraKind),c=e.matricesWeights,h=e.matricesWeightsExtra,f=e.numBoneInfluencer,_=c.length;for(let d=0;d<_;d+=4){let g=0,p=-1;for(let x=0;x<4;x++){const b=c[d+x];g+=b,b<.001&&p<0&&(p=x)}if(h)for(let x=0;x<4;x++){const b=h[d+x];g+=b,b<.001&&p<0&&(p=x+4)}if((p<0||p>f-1)&&(p=f-1),g>.001){const x=1/g;for(let b=0;b<4;b++)c[d+b]*=x;if(h)for(let b=0;b<4;b++)h[d+b]*=x}else p>=4?(h[d+p-4]=1-g,o[d+p-4]=s):(c[d+p]=1-g,r[d+p]=s)}t.setVerticesData(F.MatricesIndicesKind,r),e.matricesWeightsExtra&&t.setVerticesData(F.MatricesIndicesExtraKind,o)}static Parse(e,t,i){const s=new Zi(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,xt&&xt.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new Ms(E.FromArray(e.boundingBoxMinimum),E.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(F.UVKind),e.hasUVs2&&s._delayInfo.push(F.UV2Kind),e.hasUVs3&&s._delayInfo.push(F.UV3Kind),e.hasUVs4&&s._delayInfo.push(F.UV4Kind),e.hasUVs5&&s._delayInfo.push(F.UV5Kind),e.hasUVs6&&s._delayInfo.push(F.UV6Kind),e.hasColors&&s._delayInfo.push(F.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(F.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(F.MatricesWeightsKind),s._delayLoadingFunction=Be.ImportVertexData):Be.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}var Cb,Db,Ib,wb;let qi=(()=>{var a;let e=fl,t,i=[],s=[],r,o=[],c=[],h,f=[],_=[],d,g=[],p=[],x,b=[],T=[],R,S=[],M=[],I,A=[],D=[],C,k=[],H=[],L,J=[],te=[];return a=class extends e{get billboardMode(){return this._billboardMode}set billboardMode(B){this._billboardMode!==B&&(this._billboardMode=B,this._cache.useBillboardPosition=(this._billboardMode&a.BILLBOARDMODE_USE_POSITION)!==0)}get infiniteDistance(){return this._infiniteDistance}set infiniteDistance(B){this._infiniteDistance!==B&&(this._infiniteDistance=B)}constructor(B,$=null,z=!0){super(B,$,!1),this._forward=new E(0,0,1),this._up=new E(0,1,0),this._right=new E(1,0,0),this._position=Z(this,i,E.Zero()),this._rotation=(Z(this,s),Z(this,o,E.Zero())),this._rotationQuaternion=(Z(this,c),Z(this,f,null)),this._scaling=(Z(this,_),Z(this,g,E.One())),this._transformToBoneReferal=(Z(this,p),null),this._isAbsoluteSynced=!1,this._billboardMode=Z(this,b,a.BILLBOARDMODE_NONE),this.scalingDeterminant=(Z(this,T),Z(this,S,1)),this._infiniteDistance=(Z(this,M),Z(this,A,!1)),this.ignoreNonUniformScaling=(Z(this,D),Z(this,k,!1)),this.reIntegrateRotationIntoRotationQuaternion=(Z(this,H),Z(this,J,!1)),this._poseMatrix=(Z(this,te),null),this._localMatrix=se.Zero(),this._usePivotMatrix=!1,this._absolutePosition=E.Zero(),this._absoluteScaling=E.Zero(),this._absoluteRotationQuaternion=Oe.Identity(),this._pivotMatrix=se.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new Ae,this._nonUniformScaling=!1,z&&this.getScene().addTransformNode(this)}getClassName(){return"TransformNode"}get position(){return this._position}set position(B){this._position=B,this._markAsDirtyInternal()}isUsingPivotMatrix(){return this._usePivotMatrix}isUsingPostMultiplyPivotMatrix(){return this._postMultiplyPivotMatrix}get rotation(){return this._rotation}set rotation(B){this._rotation=B,this._rotationQuaternion=null,this._markAsDirtyInternal()}get scaling(){return this._scaling}set scaling(B){this._scaling=B,this._markAsDirtyInternal()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(B){this._rotationQuaternion=B,B&&this._rotation.setAll(0),this._markAsDirtyInternal()}_markAsDirtyInternal(){this._isDirty||(this._isDirty=!0,this.customMarkAsDirty&&this.customMarkAsDirty())}get forward(){return E.TransformNormalFromFloatsToRef(0,0,this.getScene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){return E.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){return E.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(B){return this._poseMatrix?(this._poseMatrix.copyFrom(B),this):(this._poseMatrix=B.clone(),this)}getPoseMatrix(){return this._poseMatrix||(this._poseMatrix=se.Identity()),this._poseMatrix}_isSynchronized(){const B=this._cache;return!(this._billboardMode!==B.billboardMode||this._billboardMode!==a.BILLBOARDMODE_NONE||B.pivotMatrixUpdated||this._infiniteDistance||this._position._isDirty||this._scaling._isDirty||this._rotationQuaternion&&this._rotationQuaternion._isDirty||this._rotation._isDirty)}_initCache(){super._initCache();const B=this._cache;B.localMatrixUpdated=!1,B.billboardMode=-1,B.infiniteDistance=!1,B.useBillboardPosition=!1}get absolutePosition(){return this.getAbsolutePosition()}get absoluteScaling(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(B){return this.setPivotMatrix(B,!1)}setPivotMatrix(B,$=!0){return this._pivotMatrix.copyFrom(B),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=$,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=se.Invert(this._pivotMatrix)),this}getPivotMatrix(){return this._pivotMatrix}instantiateHierarchy(B=null,$,z){const X=this.clone("Clone of "+(this.name||this.id),B||this.parent,!0);X&&z&&z(this,X);for(const q of this.getChildTransformNodes(!0))q.instantiateHierarchy(X,$,z);return X}freezeWorldMatrix(B=null,$=!1){return B?$?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||Oe.Identity(),B.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=B,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){return this._isWorldMatrixFrozen}getAbsolutePosition(){return this.computeWorldMatrix(),this._absolutePosition}setAbsolutePosition(B){if(!B)return this;let $,z,X;if(B.x===void 0){if(arguments.length<3)return this;$=arguments[0],z=arguments[1],X=arguments[2]}else $=B.x,z=B.y,X=B.z;if(this.parent){const q=fe.Matrix[0];this.parent.getWorldMatrix().invertToRef(q),E.TransformCoordinatesFromFloatsToRef($,z,X,q,this.position)}else this.position.x=$,this.position.y=z,this.position.z=X;return this._absolutePosition.copyFrom(B),this}setPositionWithLocalVector(B){return this.computeWorldMatrix(),this.position=E.TransformNormal(B,this._localMatrix),this}getPositionExpressedInLocalSpace(){this.computeWorldMatrix();const B=fe.Matrix[0];
vendor: 8,632 bytes, line 154
154return this._localMatrix.invertToRef(B),E.TransformNormal(this.position,B)}locallyTranslate(B){return this.computeWorldMatrix(!0),this.position=E.TransformCoordinates(B,this._localMatrix),this}lookAt(B,$=0,z=0,X=0,q=0){const G=a._LookAtVectorCache,j=q===0?this.position:this.getAbsolutePosition();if(B.subtractToRef(j,G),this.setDirection(G,$,z,X),q===1&&this.parent)if(this.rotationQuaternion){const w=fe.Matrix[0];this.rotationQuaternion.toRotationMatrix(w);const O=fe.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(O),O.invert(),w.multiplyToRef(O,w),this.rotationQuaternion.fromRotationMatrix(w)}else{const w=fe.Quaternion[0];Oe.FromEulerVectorToRef(this.rotation,w);const O=fe.Matrix[0];w.toRotationMatrix(O);const U=fe.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(U),U.invert(),O.multiplyToRef(U,O),w.fromRotationMatrix(O),w.toEulerAnglesToRef(this.rotation)}return this}getDirection(B){const $=E.Zero();return this.getDirectionToRef(B,$),$}getDirectionToRef(B,$){return E.TransformNormalToRef(B,this.getWorldMatrix(),$),this}setDirection(B,$=0,z=0,X=0){const q=-Math.atan2(B.z,B.x)+Math.PI/2,G=Math.sqrt(B.x*B.x+B.z*B.z),j=-Math.atan2(B.y,G);return this.rotationQuaternion?Oe.RotationYawPitchRollToRef(q+$,j+z,X,this.rotationQuaternion):(this.rotation.x=j+z,this.rotation.y=q+$,this.rotation.z=X),this}setPivotPoint(B,$=0){this.getScene().getRenderId()==0&&this.computeWorldMatrix(!0);const z=this.getWorldMatrix();if($==1){const X=fe.Matrix[0];z.invertToRef(X),B=E.TransformCoordinates(B,X)}return this.setPivotMatrix(se.Translation(-B.x,-B.y,-B.z),!0)}getPivotPoint(){const B=E.Zero();return this.getPivotPointToRef(B),B}getPivotPointToRef(B){return B.x=-this._pivotMatrix.m[12],B.y=-this._pivotMatrix.m[13],B.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){const B=E.Zero();return this.getAbsolutePivotPointToRef(B),B}getAbsolutePivotPointToRef(B){return this.getPivotPointToRef(B),E.TransformCoordinatesToRef(B,this.getWorldMatrix(),B),this}markAsDirty(B){if(this._isDirty)return this;if(this._children)for(const $ of this._children)$.markAsDirty(B);return super.markAsDirty(B)}setParent(B,$=!1,z=!1){if(!B&&!this.parent)return this;const X=fe.Quaternion[0],q=fe.Vector3[0],G=fe.Vector3[1],j=fe.Matrix[1];se.IdentityToRef(j);const w=fe.Matrix[0];this.computeWorldMatrix(!0);let O=this.rotationQuaternion;return O||(O=a._TmpRotation,Oe.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,O)),se.ComposeToRef(this.scaling,O,this.position,w),this.parent&&w.multiplyToRef(this.parent.computeWorldMatrix(!0),w),B&&(B.computeWorldMatrix(!0).invertToRef(j),w.multiplyToRef(j,w)),w.decompose(G,X,q,$?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(X):X.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(G),this.position.copyFrom(q),this.parent=B,z&&this.setPivotMatrix(se.Identity()),this}addChild(B,$=!1){return B.setParent(this,$),this}removeChild(B,$=!1){return B.parent!==this?this:(B.setParent(null,$),this)}get nonUniformScaling(){return this._nonUniformScaling}_updateNonUniformScalingState(B){return this._nonUniformScaling===B?!1:(this._nonUniformScaling=B,!0)}attachToBone(B,$){return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=$,this.parent=B,B.getSkeleton().prepare(!0),B.getFinalMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this}detachFromBone(B=!1){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,B?this.parent=this._currentParentWhenAttachingToBone:this.parent=null,this):(B&&(this.parent=this._currentParentWhenAttachingToBone),this)}rotate(B,$,z){B.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0));let X;if(!z||z===0)X=Oe.RotationAxisToRef(B,$,a._RotationAxisCache),this.rotationQuaternion.multiplyToRef(X,this.rotationQuaternion);else{if(this.parent){const q=this.parent.getWorldMatrix(),G=fe.Matrix[0];q.invertToRef(G),B=E.TransformNormal(B,G),q.determinant()<0&&($*=-1)}X=Oe.RotationAxisToRef(B,$,a._RotationAxisCache),X.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}return this}rotateAround(B,$,z){$.normalize(),this.rotationQuaternion||(this.rotationQuaternion=Oe.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));const X=fe.Vector3[0],q=fe.Vector3[1],G=fe.Vector3[2],j=fe.Quaternion[0],w=fe.Matrix[0],O=fe.Matrix[1],U=fe.Matrix[2],W=fe.Matrix[3];return B.subtractToRef(this.position,X),se.TranslationToRef(X.x,X.y,X.z,w),se.TranslationToRef(-X.x,-X.y,-X.z,O),se.RotationAxisToRef($,z,U),O.multiplyToRef(U,W),W.multiplyToRef(w,W),W.decompose(q,j,G),this.position.addInPlace(G),j.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(B,$,z){const X=B.scale($);if(!z||z===0){const q=this.getPositionExpressedInLocalSpace().add(X);this.setPositionWithLocalVector(q)}else this.setAbsolutePosition(this.getAbsolutePosition().add(X));return this}addRotation(B,$,z){let X;this.rotationQuaternion?X=this.rotationQuaternion:(X=fe.Quaternion[1],Oe.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,X));const q=fe.Quaternion[0];return Oe.RotationYawPitchRollToRef($,B,z,q),X.multiplyInPlace(q),this.rotationQuaternion||X.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){return this.parent}isWorldMatrixCameraDependent(){return this._infiniteDistance&&!this.parent||this._billboardMode!==a.BILLBOARDMODE_NONE}computeWorldMatrix(B=!1,$=null){if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;const z=this.getScene().getRenderId();if(!this._isDirty&&!B&&(this._currentRenderId===z||this.isSynchronized()))return this._currentRenderId=z,this._worldMatrix;$=$||this.getScene().activeCamera,this._updateCache();const X=this._cache;X.pivotMatrixUpdated=!1,X.billboardMode=this.billboardMode,X.infiniteDistance=this.infiniteDistance,X.parent=this._parentNode,this._currentRenderId=z,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;const q=this._getEffectiveParent(),G=a._TmpScaling;let j=this._position;if(this._infiniteDistance&&!this.parent&&$){const U=$.getWorldMatrix().m;j=a._TmpTranslation,j.copyFromFloats(this._position.x+U[12],this._position.y+U[13],this._position.z+U[14])}G.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant);let w;if(this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,w=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(Oe.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(w=a._TmpRotation,Oe.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,w)),this._usePivotMatrix){const O=fe.Matrix[1];se.ScalingToRef(G.x,G.y,G.z,O);const U=fe.Matrix[0];w.toRotationMatrix(U),this._pivotMatrix.multiplyToRef(O,fe.Matrix[4]),fe.Matrix[4].multiplyToRef(U,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(j.x,j.y,j.z)}else se.ComposeToRef(G,w,j,this._localMatrix);if(q&&q.getWorldMatrix){if(B&&q.computeWorldMatrix(B),this.billboardMode){if(this._transformToBoneReferal){const oe=this.parent;oe.getSkeleton().prepare(),oe.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),fe.Matrix[7])}else fe.Matrix[7].copyFrom(q.getWorldMatrix());const O=fe.Vector3[5],U=fe.Vector3[6],W=fe.Quaternion[0];fe.Matrix[7].decompose(U,W,O),se.ScalingToRef(U.x,U.y,U.z,fe.Matrix[7]),fe.Matrix[7].setTranslation(O),a.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(W,O),this._localMatrix.setTranslation(O)),this._localMatrix.multiplyToRef(fe.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){const O=this.parent;O.getSkeleton().prepare(),this._localMatrix.multiplyToRef(O.getFinalMatrix(),fe.Matrix[6]),fe.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else this._localMatrix.multiplyToRef(q.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if($&&this.billboardMode)if(X.useBillboardPosition){const O=fe.Vector3[0];this._worldMatrix.getTranslationToRef(O);const U=$.globalPosition;this._worldMatrix.invertToRef(fe.Matrix[1]);const W=fe.Vector3[1];
vendor: 4,141 bytes, line 154
154E.TransformCoordinatesToRef(U,fe.Matrix[1],W),W.normalize();const oe=-Math.atan2(W.z,W.x)+Math.PI/2,le=Math.sqrt(W.x*W.x+W.z*W.z),be=-Math.atan2(W.y,le);if(Oe.RotationYawPitchRollToRef(oe,be,0,fe.Quaternion[0]),(this.billboardMode&a.BILLBOARDMODE_ALL)!==a.BILLBOARDMODE_ALL){const Ee=fe.Vector3[1];fe.Quaternion[0].toEulerAnglesToRef(Ee),(this.billboardMode&a.BILLBOARDMODE_X)!==a.BILLBOARDMODE_X&&(Ee.x=0),(this.billboardMode&a.BILLBOARDMODE_Y)!==a.BILLBOARDMODE_Y&&(Ee.y=0),(this.billboardMode&a.BILLBOARDMODE_Z)!==a.BILLBOARDMODE_Z&&(Ee.z=0),se.RotationYawPitchRollToRef(Ee.y,Ee.x,Ee.z,fe.Matrix[0])}else se.FromQuaternionToRef(fe.Quaternion[0],fe.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(fe.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(fe.Vector3[0])}else{const O=fe.Vector3[0];this._worldMatrix.getTranslationToRef(O),fe.Matrix[1].copyFrom($.getViewMatrix());const U=this.getScene().useRightHandedSystem;if(U&&fe.Matrix[1].multiplyToRef(a._TmpRHRestore,fe.Matrix[1]),fe.Matrix[1].setTranslationFromFloats(0,0,0),fe.Matrix[1].invertToRef(fe.Matrix[0]),(this.billboardMode&a.BILLBOARDMODE_ALL)!==a.BILLBOARDMODE_ALL){fe.Matrix[0].decompose(void 0,fe.Quaternion[0],void 0);const W=fe.Vector3[1];fe.Quaternion[0].toEulerAnglesToRef(W),(this.billboardMode&a.BILLBOARDMODE_X)!==a.BILLBOARDMODE_X&&(W.x=0),(this.billboardMode&a.BILLBOARDMODE_Y)!==a.BILLBOARDMODE_Y&&(W.y=0),(this.billboardMode&a.BILLBOARDMODE_Z)!==a.BILLBOARDMODE_Z&&(W.z=0),U&&(W.y+=Math.PI),se.RotationYawPitchRollToRef(W.y,W.x,W.z,fe.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(fe.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(fe.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):q&&q._nonUniformScaling?this._updateNonUniformScalingState(q._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=se.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(B=!0){if(this.computeWorldMatrix(),B){const $=this.getChildren();for(let z=0;z<$.length;++z){const X=$[z];if(X){X.computeWorldMatrix();const q=fe.Matrix[0];X._localMatrix.multiplyToRef(this._localMatrix,q);const G=fe.Quaternion[0];q.decompose(X.scaling,G,X.position),X.rotationQuaternion?X.rotationQuaternion.copyFrom(G):G.toEulerAnglesToRef(X.rotation)}}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=Oe.Identity()),this._worldMatrix=se.Identity()}_afterComputeWorldMatrix(){}registerAfterWorldMatrixUpdate(B){return this.onAfterWorldMatrixUpdateObservable.add(B),this}unregisterAfterWorldMatrixUpdate(B){return this.onAfterWorldMatrixUpdateObservable.removeCallback(B),this}getPositionInCameraSpace(B=null){return B||(B=this.getScene().activeCamera),E.TransformCoordinates(this.getAbsolutePosition(),B.getViewMatrix())}getDistanceToCamera(B=null){return B||(B=this.getScene().activeCamera),this.getAbsolutePosition().subtract(B.globalPosition).length()}clone(B,$,z){const X=Rt.Clone(()=>new a(B,this.getScene()),this);if(X.name=B,X.id=B,$&&(X.parent=$),!z){const q=this.getDescendants(!0);for(let G=0;G<q.length;G++){const j=q[G];j.clone&&j.clone(B+"."+j.name,X)}}return X}serialize(B){const $=Rt.Serialize(this,B);return $.type=this.getClassName(),$.uniqueId=this.uniqueId,this.parent&&this.parent._serializeAsParent($),$.localMatrix=this.getPivotMatrix().asArray(),$.isEnabled=this.isEnabled(),this._isWorldMatrixFrozen&&($.freezeWorldMatrix=!0),Rt.AppendSerializedAnimations(this,$),$.ranges=this.serializeAnimationRanges(),$}getChildTransformNodes(B,$){const z=[];return this._getDescendants(z,B,X=>(!$||$(X))&&X instanceof a),z}
154dispose(B,$=!1){if(this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){const z=this._parentContainer.transformNodes.indexOf(this);z>-1&&this._parentContainer.transformNodes.splice(z,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),B){const z=this.getChildTransformNodes(!0);for(const X of z)X.parent=null,X.computeWorldMatrix(!0)}super.dispose(B,$)}normalizeToUnitCube(B=!0,$=!1,z){let X=null,q=null;$&&(this.rotationQuaternion?(q=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(X=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));const G=this.getHierarchyBoundingVectors(B,z),j=G.max.subtract(G.min),w=Math.max(j.x,j.y,j.z);if(w===0)return this;const O=1/w;return this.scaling.scaleInPlace(O),$&&(this.rotationQuaternion&&q?this.rotationQuaternion.copyFrom(q):this.rotation&&X&&this.rotation.copyFrom(X)),this}_syncAbsoluteScalingAndRotation(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}},(()=>{const ae=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[vr("position")],r=[vr("rotation")],h=[iI("rotationQuaternion")],d=[vr("scaling")],x=[pe("billboardMode")],R=[pe()],I=[pe("infiniteDistance")],C=[pe()],L=[pe()],he(null,null,t,{kind:"field",name:"_position",static:!1,private:!1,access:{has:B=>"_position"in B,get:B=>B._position,set:(B,$)=>{B._position=$}},metadata:ae},i,s),he(null,null,r,{kind:"field",name:"_rotation",static:!1,private:!1,access:{has:B=>"_rotation"in B,get:B=>B._rotation,set:(B,$)=>{B._rotation=$}},metadata:ae},o,c),he(null,null,h,{kind:"field",name:"_rotationQuaternion",static:!1,private:!1,access:{has:B=>"_rotationQuaternion"in B,get:B=>B._rotationQuaternion,set:(B,$)=>{B._rotationQuaternion=$}},metadata:ae},f,_),he(null,null,d,{kind:"field",name:"_scaling",static:!1,private:!1,access:{has:B=>"_scaling"in B,get:B=>B._scaling,set:(B,$)=>{B._scaling=$}},metadata:ae},g,p),he(null,null,x,{kind:"field",name:"_billboardMode",static:!1,private:!1,access:{has:B=>"_billboardMode"in B,get:B=>B._billboardMode,set:(B,$)=>{B._billboardMode=$}},metadata:ae},b,T),he(null,null,R,{kind:"field",name:"scalingDeterminant",static:!1,private:!1,access:{has:B=>"scalingDeterminant"in B,get:B=>B.scalingDeterminant,set:(B,$)=>{B.scalingDeterminant=$}},metadata:ae},S,M),he(null,null,I,{kind:"field",name:"_infiniteDistance",static:!1,private:!1,access:{has:B=>"_infiniteDistance"in B,get:B=>B._infiniteDistance,set:(B,$)=>{B._infiniteDistance=$}},metadata:ae},A,D),he(null,null,C,{kind:"field",name:"ignoreNonUniformScaling",static:!1,private:!1,access:{has:B=>"ignoreNonUniformScaling"in B,get:B=>B.ignoreNonUniformScaling,set:(B,$)=>{B.ignoreNonUniformScaling=$}},metadata:ae},k,H),he(null,null,L,{kind:"field",name:"reIntegrateRotationIntoRotationQuaternion",static:!1,private:!1,access:{has:B=>"reIntegrateRotationIntoRotationQuaternion"in B,get:B=>B.reIntegrateRotationIntoRotationQuaternion,set:(B,$)=>{B.reIntegrateRotationIntoRotationQuaternion=$}},metadata:ae},J,te),ae&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ae})})(),a.BILLBOARDMODE_NONE=0,a.BILLBOARDMODE_X=1,a.BILLBOARDMODE_Y=2,a.BILLBOARDMODE_Z=4,a.BILLBOARDMODE_ALL=7,a.BILLBOARDMODE_USE_POSITION=128,a.BillboardUseParentOrientation=!1,a._TmpRotation=Oe.Zero(),a._TmpScaling=E.Zero(),a._TmpTranslation=E.Zero(),a._TmpRHRestore=se.Scaling(1,1,-1),a._LookAtVectorCache=new E(0,0,0),a._RotationAxisCache=new Oe,a})();(Cb=qi.prototype).getPhysicsBody??(Cb.getPhysicsBody=He("TransformNode","getPhysicsBody"));(Db=qi.prototype).applyImpulse??(Db.applyImpulse=He("TransformNode","applyImpulse"));(Ib=qi.prototype).applyAngularImpulse??(Ib.applyAngularImpulse=He("TransformNode","applyAngularImpulse"));(wb=qi.prototype).applyTorque??(wb.applyTorque=He("TransformNode","applyTorque"));Object.getOwnPropertyDescriptor(qi.prototype,"physicsBody")||Object.defineProperty(qi.prototype,"physicsBody",mt("TransformNode","physicsBody"));class _l{constructor(){this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(e=!1,t=!0){if(!this.pickedMesh||t&&!this.pickedMesh.isVerticesDataPresent(F.NormalKind))return null;let i=this.pickedMesh.getIndices();i?.length===0&&(i=null);let s;const r=fe.Vector3[0],o=fe.Vector3[1],c=fe.Vector3[2];if(t){const f=this.pickedMesh.getVerticesData(F.NormalKind);let _=i?E.FromArrayToRef(f,i[this.faceId*3]*3,r):r.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),d=i?E.FromArrayToRef(f,i[this.faceId*3+1]*3,o):o.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),g=i?E.FromArrayToRef(f,i[this.faceId*3+2]*3,c):c.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]);_=_.scale(this.bu),d=d.scale(this.bv),g=g.scale(1-this.bu-this.bv),s=new E(_.x+d.x+g.x,_.y+d.y+g.y,_.z+d.z+g.z)}else{const f=this.pickedMesh.getVerticesData(F.PositionKind),_=i?E.FromArrayToRef(f,i[this.faceId*3]*3,r):r.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),d=i?E.FromArrayToRef(f,i[this.faceId*3+1]*3,o):o.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),g=i?E.FromArrayToRef(f,i[this.faceId*3+2]*3,c):c.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]),p=_.subtract(d),x=g.subtract(d);s=E.Cross(p,x)}const h=(f,_)=>{if(this.thinInstanceIndex!==-1){const g=f._thinInstanceDataStorage.matrixData,p=this.thinInstanceIndex<<4;if(g&&g.length>p){const x=fe.Matrix[0];se.FromArrayToRef(g,p,x),E.TransformNormalToRef(_,x,_)}}let d=f.getWorldMatrix();
vendor: 4,243 bytes, line 154
154f.nonUniformScaling&&(fe.Matrix[0].copyFrom(d),d=fe.Matrix[0],d.setTranslationFromFloats(0,0,0),d.invert(),d.transposeToRef(fe.Matrix[1]),d=fe.Matrix[1]),E.TransformNormalToRef(_,d,_)};if(e&&h(this.pickedMesh,s),this.ray){const f=fe.Vector3[0].copyFrom(s);e||h(this.pickedMesh,f),E.Dot(f,this.ray.direction)>0&&s.negateInPlace()}return s.normalize(),s}getTextureCoordinates(e=F.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;const t=this.pickedMesh.getIndices();if(!t)return null;const i=this.pickedMesh.getVerticesData(e);if(!i)return null;let s=Ue.FromArray(i,t[this.faceId*3]*2),r=Ue.FromArray(i,t[this.faceId*3+1]*2),o=Ue.FromArray(i,t[this.faceId*3+2]*2);return s=s.scale(this.bu),r=r.scale(this.bv),o=o.scale(1-this.bu-this.bv),new Ue(s.x+r.x+o.x,s.y+r.y+o.y)}}class Le{constructor(e,t,i=!1,s,r=!1,o){this._uniformNames=[],this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||r,this._dynamic=i,this._name=s??"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(o===void 0&&this._engine._features.trackUbosInFrame||o===!0)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic}getData(){return this._bufferData}getBuffer(){return this._buffer}getUniformNames(){return this._uniformNames}_fillAlignment(e){let t;if(e<=2?t=e:t=4,this._uniformLocationPointer%t!==0){const i=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;const s=this._uniformLocationPointer-i;for(let r=0;r<s;r++)this._data.push(0)}}
154addUniform(e,t,i=0){if(i>0&&typeof t=="number"&&(this._uniformArraySizes[e]={strideSize:t,arraySize:i}),this._uniformLocations[e]!==void 0||(this._uniformNames.push(e),this._noUBO))return;let s;if(i>0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),t==16)t=t*i;else{const o=(4-t)*i;t=t*i+o}s=[];for(let r=0;r<t;r++)s.push(0)}else{if(t instanceof Array)s=t,t=s.length;else{s=[];for(let r=0;r<t;r++)s.push(0)}this._fillAlignment(t)}this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(let r=0;r<t;r++)this._data.push(s[r]);this._needSync=!0}addMatrix(e,t){this.addUniform(e,Array.prototype.slice.call(t.asArray()))}addFloat2(e,t,i){const s=[t,i];this.addUniform(e,s)}addFloat3(e,t,i,s){const r=[t,i,s];this.addUniform(e,r)}addColor3(e,t){const i=[t.r,t.g,t.b];this.addUniform(e,i)}addColor4(e,t,i){const s=[t.r,t.g,t.b,i];this.addUniform(e,s)}addVector3(e,t){const i=[t.x,t.y,t.z];this.addUniform(e,i)}addMatrix3x3(e){this.addUniform(e,12)}addMatrix2x2(e){this.addUniform(e,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){const e=[];let t=0;for(const i in this._uniformLocations)if(e.push(i),++t===10)break;return e.join(",")}_rebuild(){this._noUBO||!this._bufferData||(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()),this._trackUBOsInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){this._trackUBOsInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){return this._buffers.length}get _indexBuffer(){return this._bufferIndex}get name(){return this._name}set name(e){this._name=e}get currentEffect(){return this._currentEffect}_buffersEqual(e,t){for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}_copyBuffer(e,t){for(let i=0;i<e.length;++i)t[i]=e[i]}update(){if(!this._noUBO){if(this.bindUniformBuffer(),!this._buffer){this.create();return}if(!this._dynamic&&!this._needSync){this._createBufferOnWrite=this._trackUBOsInFrame;return}if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._bufferUpdatedLastFrame=!0,this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame}}_createNewBuffer(){this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][0],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){this._trackUBOsInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(this._buffers.length===1?this._needSync=!this._bufferUpdatedLastFrame:this._needSync=this._bufferIndex!==0,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,t,i){this._checkNewFrame();let s=this._uniformLocations[e];if(s===void 0){if(this._buffer){me.Error("Cannot add an uniform after UBO has been created. uniformName="+e);return}this.addUniform(e,i),s=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let r=0;r<i;r++)this._bufferData[s+r]=t[r];else{let r=!1;for(let o=0;o<i;o++)(i===16&&!this._engine._features.uniformBufferHardCheckMatrix||this._bufferData[s+o]!==Math.fround(t[o]))&&(r=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+o]=t[o]);this._needSync=this._needSync||r}}updateUniformArray(e,t,i){this._checkNewFrame();const s=this._uniformLocations[e];if(s===void 0){me.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");return}this._buffer||this.create();const r=this._uniformArraySizes[e];if(this._dynamic)for(let o=0;o<i;o++)this._bufferData[s+o]=t[o];else{let o=!1,c=0,h=0;for(let f=0;f<i;
vendor: 4,122 bytes, line 154
154f++)if(this._bufferData[s+h*4+c]!==_t.FloatRound(t[f])&&(o=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+h*4+c]=t[f]),c++,c===r.strideSize){for(;c<4;c++)this._bufferData[s+h*4+c]=0;c=0,h++}this._needSync=this._needSync||o}}_cacheMatrix(e,t){this._checkNewFrame();const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_updateMatrix3x3ForUniform(e,t){for(let i=0;i<3;i++)Le._TempBuffer[i*4]=t[i*3],Le._TempBuffer[i*4+1]=t[i*3+1],Le._TempBuffer[i*4+2]=t[i*3+2],Le._TempBuffer[i*4+3]=0;this.updateUniform(e,Le._TempBuffer,12)}_updateMatrix3x3ForEffect(e,t){this._currentEffect.setMatrix3x3(e,t)}_updateMatrix2x2ForEffect(e,t){this._currentEffect.setMatrix2x2(e,t)}_updateMatrix2x2ForUniform(e,t){for(let i=0;i<2;i++)Le._TempBuffer[i*4]=t[i*2],Le._TempBuffer[i*4+1]=t[i*2+1],Le._TempBuffer[i*4+2]=0,Le._TempBuffer[i*4+3]=0;this.updateUniform(e,Le._TempBuffer,8)}_updateFloatForEffect(e,t,i=""){this._currentEffect.setFloat(e+i,t)}_updateFloatForUniform(e,t){Le._TempBuffer[0]=t,this.updateUniform(e,Le._TempBuffer,1)}_updateFloat2ForEffect(e,t,i,s=""){this._currentEffect.setFloat2(e+s,t,i)}_updateFloat2ForUniform(e,t,i){Le._TempBuffer[0]=t,Le._TempBuffer[1]=i,this.updateUniform(e,Le._TempBuffer,2)}_updateFloat3ForEffect(e,t,i,s,r=""){this._currentEffect.setFloat3(e+r,t,i,s)}_updateFloat3ForUniform(e,t,i,s){Le._TempBuffer[0]=t,Le._TempBuffer[1]=i,Le._TempBuffer[2]=s,this.updateUniform(e,Le._TempBuffer,3)}_updateFloat4ForEffect(e,t,i,s,r,o=""){this._currentEffect.setFloat4(e+o,t,i,s,r)}_updateFloat4ForUniform(e,t,i,s,r){Le._TempBuffer[0]=t,Le._TempBuffer[1]=i,Le._TempBuffer[2]=s,Le._TempBuffer[3]=r,this.updateUniform(e,Le._TempBuffer,4)}_updateFloatArrayForEffect(e,t,i=""){switch(this._uniformArraySizes[e]?.strideSize){case 2:this._currentEffect.setFloatArray2(e+i,t);break;case 3:this._currentEffect.setFloatArray3(e+i,t);break;case 4:this._currentEffect.setFloatArray4(e+i,t);break;default:this._currentEffect.setFloatArray(e+i,t);break}}_updateFloatArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateArrayForEffect(e,t){this._currentEffect.setArray(e,t)}_updateArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateIntArrayForEffect(e,t){this._currentEffect.setIntArray(e,t)}_updateIntArrayForUniform(e,t){Le._TempBufferInt32View.set(t),this.updateUniformArray(e,Le._TempBuffer,t.length)}_updateUIntArrayForEffect(e,t){this._currentEffect.setUIntArray(e,t)}_updateUIntArrayForUniform(e,t){Le._TempBufferUInt32View.set(t),this.updateUniformArray(e,Le._TempBuffer,t.length)}_updateMatrixForEffect(e,t){this._currentEffect.setMatrix(e,t)}_updateMatrixForUniform(e,t){this._cacheMatrix(e,t)&&this.updateUniform(e,t.asArray(),16)}_updateMatricesForEffect(e,t){this._currentEffect.setMatrices(e,t)}_updateMatricesForUniform(e,t){this.updateUniform(e,t,t.length)}_updateVector3ForEffect(e,t){this._currentEffect.setVector3(e,t)}_updateVector3ForUniform(e,t){Le._TempBuffer[0]=t.x,Le._TempBuffer[1]=t.y,Le._TempBuffer[2]=t.z,this.updateUniform(e,Le._TempBuffer,3)}_updateVector4ForEffect(e,t){this._currentEffect.setVector4(e,t)}_updateVector4ForUniform(e,t){Le._TempBuffer[0]=t.x,Le._TempBuffer[1]=t.y,Le._TempBuffer[2]=t.z,Le._TempBuffer[3]=t.w,this.updateUniform(e,Le._TempBuffer,4)}_updateColor3ForEffect(e,t,i=""){this._currentEffect.setColor3(e+i,t)}_updateColor3ForUniform(e,t){Le._TempBuffer[0]=t.r,Le._TempBuffer[1]=t.g,Le._TempBuffer[2]=t.b,this.updateUniform(e,Le._TempBuffer,3)}_updateColor4ForEffect(e,t,i,s=""){this._currentEffect.setColor4(e+s,t,i)}_updateDirectColor4ForEffect(e,t,i=""){this._currentEffect.setDirectColor4(e+i,t)}_updateColor4ForUniform(e,t,i){Le._TempBuffer[0]=t.r,Le._TempBuffer[1]=t.g,Le._TempBuffer[2]=t.b,Le._TempBuffer[3]=i,this.updateUniform(e,Le._TempBuffer,4)}_updateDirectColor4ForUniform(e,t){Le._TempBuffer[0]=t.r,Le._TempBuffer[1]=t.g,Le._TempBuffer[2]=t.b,Le._TempBuffer[3]=t.a,this.updateUniform(e,Le._TempBuffer,4)}_updateIntForEffect(e,t,i=""){this._currentEffect.setInt(e+i,t)}_updateIntForUniform(e,t){Le._TempBufferInt32View[0]=t,this.updateUniform(e,Le._TempBuffer,1)}
154_updateInt2ForEffect(e,t,i,s=""){this._currentEffect.setInt2(e+s,t,i)}_updateInt2ForUniform(e,t,i){Le._TempBufferInt32View[0]=t,Le._TempBufferInt32View[1]=i,this.updateUniform(e,Le._TempBuffer,2)}_updateInt3ForEffect(e,t,i,s,r=""){this._currentEffect.setInt3(e+r,t,i,s)}_updateInt3ForUniform(e,t,i,s){Le._TempBufferInt32View[0]=t,Le._TempBufferInt32View[1]=i,Le._TempBufferInt32View[2]=s,this.updateUniform(e,Le._TempBuffer,3)}_updateInt4ForEffect(e,t,i,s,r,o=""){this._currentEffect.setInt4(e+o,t,i,s,r)}_updateInt4ForUniform(e,t,i,s,r){Le._TempBufferInt32View[0]=t,Le._TempBufferInt32View[1]=i,Le._TempBufferInt32View[2]=s,Le._TempBufferInt32View[3]=r,this.updateUniform(e,Le._TempBuffer,4)}_updateUIntForEffect(e,t,i=""){this._currentEffect.setUInt(e+i,t)}_updateUIntForUniform(e,t){Le._TempBufferUInt32View[0]=t,this.updateUniform(e,Le._TempBuffer,1)}_updateUInt2ForEffect(e,t,i,s=""){this._currentEffect.setUInt2(e+s,t,i)}_updateUInt2ForUniform(e,t,i){Le._TempBufferUInt32View[0]=t,Le._TempBufferUInt32View[1]=i,this.updateUniform(e,Le._TempBuffer,2)}_updateUInt3ForEffect(e,t,i,s,r=""){this._currentEffect.setUInt3(e+r,t,i,s)}_updateUInt3ForUniform(e,t,i,s){Le._TempBufferUInt32View[0]=t,Le._TempBufferUInt32View[1]=i,Le._TempBufferUInt32View[2]=s,this.updateUniform(e,Le._TempBuffer,3)}_updateUInt4ForEffect(e,t,i,s,r,o=""){this._currentEffect.setUInt4(e+o,t,i,s,r)}_updateUInt4ForUniform(e,t,i,s,r){Le._TempBufferUInt32View[0]=t,Le._TempBufferUInt32View[1]=i,Le._TempBufferUInt32View[2]=s,Le._TempBufferUInt32View[3]=r,this.updateUniform(e,Le._TempBuffer,4)}setTexture(e,t){this._currentEffect.setTexture(e,t)}setTextureArray(e,t){this._currentEffect.setTextureArray(e,t)}bindTexture(e,t){this._currentEffect._bindTexture(e,t)}updateUniformDirectly(e,t){this.updateUniform(e,t,t.length),this.update()}bindToEffect(e,t){this._currentEffect=e,this._currentEffectName=t}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(e){if(!this._buffers)return this._buffer===e;for(let t=0;t<this._buffers.length;++t)if(this._buffers[t][0]===e)return this._bufferIndex=t,this._buffer=e,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[t][1]&&this._bufferData.set(this._buffers[t][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(e){return this._uniformLocations[e]!==void 0}dispose(){if(this._noUBO)return;const e=this._engine._uniformBuffers,t=e.indexOf(this);if(t!==-1&&(e[t]=e[e.length-1],e.pop()),this._trackUBOsInFrame&&this._buffers)for(let i=0;i<this._buffers.length;++i){const s=this._buffers[i][0];this._engine._releaseBuffer(s)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}Le._MAX_UNIFORM_SIZE=256;Le._TempBuffer=new Float32Array(Le._MAX_UNIFORM_SIZE);Le._TempBufferInt32View=new Int32Array(Le._TempBuffer.buffer);Le._TempBufferUInt32View=new Uint32Array(Le._TempBuffer.buffer);class jI{constructor(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new E(0,0,0),this._diffPositionForCollisions=new E(0,0,0),this._collisionResponse=!0}}var Pb,Ob,Fb;function YI(a,e,t){let i;switch(e){case F.PositionKind:i=s=>s.getPositions();break;case F.NormalKind:i=s=>s.getNormals();break;case F.TangentKind:i=s=>s.getTangents();break;case F.UVKind:i=s=>s.getUVs();break;case F.UV2Kind:i=s=>s.getUV2s();break;case F.ColorKind:i=s=>s.getColors();break;default:return}for(let s=0;s<a.length;s++){let r=a[s];for(let o=0;o<t.numTargets;o++){const c=t.getTarget(o),h=c.influence;if(h!==0){const f=i(c);f&&(r+=(f[s]-a[s])*h)}}a[s]=r}}function KI(a,e,t,i,s,r,o){const c=fe.Vector3[0],h=fe.Matrix[0],f=fe.Matrix[1],_=e===F.NormalKind?E.TransformNormalFromFloatsToRef:E.TransformCoordinatesFromFloatsToRef;for(let d=0,g=0;d<a.length;d+=3,g+=4){h.reset();let p,x;for(p=0;p<4;p++)x=s[g+p],x>0&&(se.FromFloat32ArrayToRefScaled(t,Math.floor(i[g+p]*16),x,f),h.addToSelf(f));if(r&&o)for(p=0;p<4;p++)x=o[g+p],x>0&&(se.FromFloat32ArrayToRefScaled(t,Math.floor(r[g+p]*16),x,f),h.addToSelf(f));_(a[d],a[d+1],a[d+2],h,c),c.toArray(a,d)}}function Bb(a,e){return a-Math.floor(a/e)*e}function ZI(a,e){const t=a.y-a.x+1,i=e*a.w/t,s=i<1?0:1,r=t-s;let o=Bb(i-Math.floor(i),1)*r;return o=Bb(o+a.z,r),Math.floor(o)+a.x+s}
154function Lb(a,e,t){if(a instanceof Float32Array){se.FromArrayToRef(a,e,t);return}t.copyFromFloats(Wi(a[e]),Wi(a[e+1]),Wi(a[e+2]),Wi(a[e+3]),Wi(a[e+4]),Wi(a[e+5]),Wi(a[e+6]),Wi(a[e+7]),Wi(a[e+8]),Wi(a[e+9]),Wi(a[e+10]),Wi(a[e+11]),Wi(a[e+12]),Wi(a[e+13]),Wi(a[e+14]),Wi(a[e+15]))}function QI(a,e,t,i,s,r,o,c,h){const f=t.texture,d=f?.getInternalTexture()?._bufferView;if(!(d instanceof Float32Array)&&!(d instanceof Uint16Array))return me.Warn("Baked vertex animation bounding info requires CPU-readable Float32Array or Uint16Array texture data.",1),!1;const g=f.getSize(),p=ZI(i,t.time);if(!isFinite(p)||p<0||p>=g.height)return me.Warn("Baked vertex animation bounding info could not be refreshed because the computed frame is outside the texture.",1),!1;const x=fe.Vector3[0],b=fe.Matrix[0],T=fe.Matrix[1],R=p*g.width*4,S=e===F.NormalKind?E.TransformNormalFromFloatsToRef:E.TransformCoordinatesFromFloatsToRef;for(let M=0,I=0;M<a.length;M+=3,I+=4){b.reset();let A,D;for(A=0;A<4&&A<h;A++)D=r[I+A],D>0&&(Lb(d,R+Math.floor(s[I+A])*16,T),T.scaleAndAddToRef(D,b));if(o&&c)for(A=0;A<4&&A+4<h;A++)D=c[I+A],D>0&&(Lb(d,R+Math.floor(o[I+A])*16,T),T.scaleAndAddToRef(D,b));S(a[M],a[M+1],a[M+2],b,x),x.toArray(a,M)}return!0}class $I{constructor(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=E.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class JI{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new $I,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=new Map,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new jI,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1,this._wasActiveLastFrame=!1}}let Lt=(()=>{var a;let e=qi,t=[],i;return a=class extends e{static get BILLBOARDMODE_NONE(){return qi.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return qi.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return qi.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return qi.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return qi.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return qi.BILLBOARDMODE_USE_POSITION}get facetNb(){return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(r){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=r}get partitioningBBoxRatio(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(r){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=r}get mustDepthSortFacets(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(r){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=r}get facetDepthSortFrom(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(r){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=r}get collisionRetryCount(){return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(r){this._internalAbstractMeshDataInfo._collisionRetryCount=r}get isFacetDataEnabled(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(r){this._internalAbstractMeshDataInfo._morphTargetManager!==r&&(this._internalAbstractMeshDataInfo._morphTargetManager=r,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(r){this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==r&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=r,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(r){return super._updateNonUniformScalingState(r)?(this._markSubMeshesAsMiscDirty(),!0):!1}get rawBoundingInfo(){return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(r){this._internalAbstractMeshDataInfo._rawBoundingInfo=r}set onCollide(r){this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(r)}set onCollisionPositionChange(r){this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(r)}get visibility(){return this._internalAbstractMeshDataInfo._visibility}set visibility(r){if(this._internalAbstractMeshDataInfo._visibility===r)return;const o=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=r,(o===1&&r!==1||o!==1&&r===1)&&this._markSubMeshesAsDirty(c=>{c.markAsMiscDirty(),c.markAsPrePassDirty()})}get pointerOverDisableMeshTesting(){return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(r){this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=r}get renderingGroupId(){return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(r){this._internalAbstractMeshDataInfo._renderingGroupId=r}get material(){return this._internalAbstractMeshDataInfo._material}set material(r){this._setMaterial(r)}_setMaterial(r){this._internalAbstractMeshDataInfo._material!==r&&(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=r,r&&r.meshMap&&(r.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(void 0,r==null),this._unBindEffect()))}getMaterialForRenderPass(r){return this._internalAbstractMeshDataInfo._materialForRenderPass?.[r]}setMaterialForRenderPass(r,o){this.resetDrawCache(r),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]);const c=this._internalAbstractMeshDataInfo._materialForRenderPass[r];c?.meshMap?.[this.uniqueId]&&(c.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._materialForRenderPass[r]=o,o&&o.meshMap&&(o.meshMap[this.uniqueId]=this)}get receiveShadows(){return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(r){this._internalAbstractMeshDataInfo._receiveShadows!==r&&(this._internalAbstractMeshDataInfo._receiveShadows=r,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(r){this._internalAbstractMeshDataInfo._hasVertexAlpha!==r&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=r,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(r){this._internalAbstractMeshDataInfo._useVertexColors!==r&&(this._internalAbstractMeshDataInfo._useVertexColors=r,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(r){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==r&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=r,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(r){this._internalAbstractMeshDataInfo._numBoneInfluencers!==r&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=r,this._markSubMeshesAsAttributesDirty())}get applyFog(){return this._internalAbstractMeshDataInfo._applyFog}set applyFog(r){this._internalAbstractMeshDataInfo._applyFog!==r&&(this._internalAbstractMeshDataInfo._applyFog=r,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(r){this._internalAbstractMeshDataInfo._enableDistantPicking=r}get layerMask(){return this._internalAbstractMeshDataInfo._layerMask}set layerMask(r){r!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=r,this._resyncLightSources())}get collisionMask(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(r){this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(r)?-1:r}
vendor: 19,137 bytes, line 154
154get collisionResponse(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(r){this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=r}get collisionGroup(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(r){this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(r)?-1:r}get surroundingMeshes(){return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(r){this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=r}get lightSources(){return this._lightSources}set skeleton(r){const o=this._internalAbstractMeshDataInfo._skeleton;o&&o.needInitialSkinMatrix&&o._unregisterMeshWithPoseMatrix(this),r&&r.needInitialSkinMatrix&&r._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=r,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){return this._internalAbstractMeshDataInfo._skeleton}constructor(r,o=null){switch(super(r,o,!1),this._internalAbstractMeshDataInfo=new JI,this._waitingMaterialId=null,this._waitingMorphTargetManagerId=null,this._waitingSkeletonId=null,this._waitingSkeletonUniqueId=null,this.cullingStrategy=a.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new Ae,this.onCollisionPositionChangeObservable=new Ae,this.onMaterialChangedObservable=new Ae,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this.isPickable=a.DefaultIsPickable,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=lt.Red(),this.outlineWidth=.02,this.overlayColor=lt.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new E(.5,1,.5),this.ellipsoidOffset=new E(0,0,0),this.edgesWidth=1,this.edgesColor=new dt(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=new Array,this._unIndexed=!1,this._lightSources=new Array,this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new Ae,this._onCollisionPositionChange=(c,h,f=null)=>{h.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>Ve.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),f&&this.onCollideObservable.notifyObservers(f),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},o=this.getScene(),this.layerMask=o.defaultRenderableLayerMask,o.addMesh(this),this._resyncLightSources(),this._uniformBuffer=new Le(this.getScene().getEngine(),void 0,void 0,r,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),o.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1;break}}_buildUniformLayout(){this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(r){const o=this._uniformBuffer;o.updateMatrix("world",r),o.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),o.update()}getMeshUniformBuffer(){return this._uniformBuffer}getClassName(){return"AbstractMesh"}toString(r){let o="Name: "+this.name+", isInstance: "+(this.getClassName()==="InstancedMesh"?"YES":"NO");o+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);const c=this._internalAbstractMeshDataInfo._skeleton;return c&&(o+=", skeleton: "+c.name),r&&(o+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],o+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),o}_getEffectiveParent(){return this._masterMesh&&this.billboardMode!==qi.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(r,o=!0){if(this.actionManager&&(o||this.actionManager.isRecursive))if(r){if(this.actionManager.hasSpecificTrigger(r))return this.actionManager}else return this.actionManager;return this.parent?this.parent._getActionManagerForTrigger(r,!1):null}_releaseRenderPassId(r){}_rebuild(r=!1){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery!==null&&(this._occlusionQuery=null),!!this.subMeshes){for(const o of this.subMeshes)o._rebuild();this.resetDrawCache()}}_resyncLightSources(){this._lightSources.length=0;for(const r of this.getScene().lights)r.isEnabled()&&r.canAffectMesh(this)&&this._lightSources.push(r);this._markSubMeshesAsLightDirty()}_resyncLightSource(r){const o=r.isEnabled()&&r.canAffectMesh(this),c=this._lightSources.indexOf(r);let h=!1;if(c===-1){if(!o)return;this._lightSources.push(r)}else{if(o)return;h=!0,this._lightSources.splice(c,1)}this._markSubMeshesAsLightDirty(h)}_unBindEffect(){for(const r of this.subMeshes)r.setEffect(null)}_removeLightSource(r,o){const c=this._lightSources.indexOf(r);c!==-1&&(this._lightSources.splice(c,1),this._markSubMeshesAsLightDirty(o))}_markSubMeshesAsDirty(r){if(this.subMeshes)for(const o of this.subMeshes)for(let c=0;c<o._drawWrappers.length;++c){const h=o._drawWrappers[c];!h||!h.defines||!h.defines.markAllAsDirty||r(h.defines)}}_markSubMeshesAsLightDirty(r=!1){this._markSubMeshesAsDirty(o=>o.markAsLightDirty(r))}_markSubMeshesAsAttributesDirty(){this._markSubMeshesAsDirty(r=>r.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){this._markSubMeshesAsDirty(r=>r.markAsMiscDirty())}markAsDirty(r){return this._currentRenderId=Number.MAX_VALUE,super.markAsDirty(r),this._isDirty=!0,this}resetDrawCache(r,o=!1){if(this.subMeshes)for(const c of this.subMeshes)c.resetDrawCache(r,o)}get isBlocked(){return!1}getLOD(r){return this}getTotalVertices(){return 0}getTotalIndices(){return 0}getIndices(){return null}getVerticesData(r){return null}setVerticesData(r,o,c,h){return this}updateVerticesData(r,o,c,h){return this}setIndices(r,o){return this}isVerticesDataPresent(r){return!1}getBoundingInfo(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){return this.rawBoundingInfo??this.getBoundingInfo()}setBoundingInfo(r){return this._boundingInfo=r,this}get hasBoundingInfo(){return this._boundingInfo!==null}buildBoundingInfo(r,o,c){return this._boundingInfo=new Ms(r,o,c),this._boundingInfo}normalizeToUnitCube(r=!0,o=!1,c){return super.normalizeToUnitCube(r,o,c)}get useBones(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(F.MatricesIndicesKind)&&this.isVerticesDataPresent(F.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(r){}_activate(r,o){return this._renderId=r,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===qi.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){return!1}get hasInstances(){return!1}get hasThinInstances(){return!1}movePOV(r,o,c){return this.position.addInPlace(this.calcMovePOV(r,o,c)),this}calcMovePOV(r,o,c){const h=new se;(this.rotationQuaternion?this.rotationQuaternion:Oe.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(h);const _=E.Zero(),d=this.definedFacingForward?-1:1;return E.TransformCoordinatesFromFloatsToRef(r*d,o,c*d,h,_),_}rotatePOV(r,o,c){return this.rotation.addInPlace(this.calcRotatePOV(r,o,c)),this}calcRotatePOV(r,o,c){const h=this.definedFacingForward?1:-1;return new E(r*h,o,c*h)}_refreshBoundingInfo(r,o){if(r){const c=R1(r,0,this.getTotalVertices(),o);this._boundingInfo?this._boundingInfo.reConstruct(c.minimum,c.maximum):this._boundingInfo=new Ms(c.minimum,c.maximum)}if(this.subMeshes)for(let c=0;c<this.subMeshes.length;c++)this.subMeshes[c].refreshBoundingInfo(r);this._updateBoundingInfo()}_refreshBoundingInfoDirect(r){if(this._boundingInfo?this._boundingInfo.reConstruct(r.minimum,r.maximum):this._boundingInfo=new Ms(r.minimum,r.maximum),this.subMeshes)for(let o=0;o<this.subMeshes.length;o++)this.subMeshes[o].refreshBoundingInfo(null);this._updateBoundingInfo()}static _ApplySkeleton(r,o,c,h,f,_,d){KI(r,o,c,h,f,_,d)}_getData(r,o,c=F.PositionKind){const h=r.cache,f=g=>{if(h){const p=h._vertexData||(h._vertexData={});return p[g]||this.copyVerticesData(g,p),p[g]}return this.getVerticesData(g)};if(o||(o=f(c)),!o)return null;h?(h._outputData?h._outputData.set(o):h._outputData=new Float32Array(o),o=h._outputData):(r.applyMorph&&this.morphTargetManager||r.applySkeleton&&this.skeleton||r.applyBakedVertexAnimation&&this.bakedVertexAnimationManager?.isEnabled)&&(o=o.slice()),r.applyMorph&&this.morphTargetManager&&YI(o,c,this.morphTargetManager);const _=this.bakedVertexAnimationManager;let d=!1;if(r.applyBakedVertexAnimation&&_?.isEnabled){const g=f(F.MatricesIndicesKind),p=f(F.MatricesWeightsKind);if(p&&g){const x=this.numBoneInfluencers>4,b=x?f(F.MatricesIndicesExtraKind):null,T=x?f(F.MatricesWeightsExtraKind):null;d=QI(o,c,_,r.bakedVertexAnimationSettings??_.animationParameters,g,p,b,T,this.numBoneInfluencers)}}if(!d&&r.applySkeleton&&this.skeleton){const g=f(F.MatricesIndicesKind),p=f(F.MatricesWeightsKind);if(p&&g){const x=this.numBoneInfluencers>4,b=x?f(F.MatricesIndicesExtraKind):null,T=x?f(F.MatricesWeightsExtraKind):null,R=this.skeleton.getTransformMatrices(this);a._ApplySkeleton(o,c,R,g,p,b,T)}}if(r.updatePositionsArray!==!1&&c===F.PositionKind){const g=this._internalAbstractMeshDataInfo._positions||[],p=g.length;if(g.length=o.length/3,p<g.length)for(let x=p;x<g.length;x++)g[x]=new E;for(let x=0,b=0;x<g.length;x++,b+=3)g[x].copyFromFloats(o[b],o[b+1],o[b+2]);this._internalAbstractMeshDataInfo._positions=g}return o}getNormalsData(r=!1,o=!1){return this._getData({applySkeleton:r,applyMorph:o,updatePositionsArray:!1},null,F.NormalKind)}getPositionData(r=!1,o=!1,c=null){return this._getData({applySkeleton:r,applyMorph:o,updatePositionsArray:!1},c,F.PositionKind)}_updateBoundingInfo(){return this._boundingInfo?this._boundingInfo.update(this.worldMatrixFromCache):this._boundingInfo=new Ms(E.Zero(),E.Zero(),this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}_updateSubMeshesBoundingInfo(r){if(!this.subMeshes)return this;const o=this.subMeshes.length;for(let c=0;c<o;c++){const h=this.subMeshes[c];(o>1||!h.IsGlobal)&&h.updateBoundingInfo(r)}return this}_afterComputeWorldMatrix(){this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(r){return this.getBoundingInfo().isInFrustum(r,this.cullingStrategy)}isCompletelyInFrustum(r){return this.getBoundingInfo().isCompletelyInFrustum(r)}intersectsMesh(r,o=!1,c){const h=this.getBoundingInfo(),f=r.getBoundingInfo();if(h.intersects(f,o))return!0;if(c){for(const _ of this.getChildMeshes())if(_.intersectsMesh(r,o,!0))return!0}return!1}intersectsPoint(r){return this.getBoundingInfo().intersectsPoint(r)}get checkCollisions(){return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(r){this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=r}get collider(){return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(r,o=!0){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);const h=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=h.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,h.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,r,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId,o),this}_collideForSubMesh(r,o,c){if(this._generatePointsArray(),!this._positions)return this;if(!r._lastColliderWorldVertices||!r._lastColliderTransformMatrix.equals(o)){r._lastColliderTransformMatrix=o.clone(),r._lastColliderWorldVertices=[],r._trianglePlanes=[];const h=r.verticesStart,f=r.verticesStart+r.verticesCount;for(let _=h;_<f;_++)r._lastColliderWorldVertices.push(E.TransformCoordinates(this._positions[_],o))}return c._collide(r._trianglePlanes,r._lastColliderWorldVertices,this.getIndices(),r.indexStart,r.indexStart+r.indexCount,r.verticesStart,!!r.getMaterial(),this,this._shouldConvertRHS(),r.getMaterial()?.fillMode===7),this}_processCollisionsForSubMeshes(r,o){const c=this._scene.getCollidingSubMeshCandidates(this,r),h=c.length;for(let f=0;f<h;f++){const _=c.data[f];h>1&&!_._checkCollision(r)||this._collideForSubMesh(_,o,r)}return this}_shouldConvertRHS(){return!1}_checkCollision(r){if(!this.getBoundingInfo()._checkCollision(r))return this;const o=fe.Matrix[0],c=fe.Matrix[1];return se.ScalingToRef(1/r._radius.x,1/r._radius.y,1/r._radius.z,o),this.worldMatrixFromCache.multiplyToRef(o,c),this._processCollisionsForSubMeshes(r,c),this}_generatePointsArray(){return!1}intersects(r,o,c,h=!1,f,_=!1){const d=new _l,g=this.getClassName(),p=g==="InstancedLinesMesh"||g==="LinesMesh"||g==="GreasedLineMesh"?this.intersectionThreshold:0,x=this.getBoundingInfo();if(!this.subMeshes||!_&&(!r.intersectsSphere(x.boundingSphere,p)||!r.intersectsBox(x.boundingBox,p)))return d;if(h)return d.hit=!_,d.pickedMesh=_?null:this,d.distance=_?0:E.Distance(r.origin,x.boundingSphere.center),d.subMeshId=0,d;if(!this._generatePointsArray())return d;let b=null;const T=this._scene.getIntersectingSubMeshCandidates(this,r),R=T.length;let S=!1;for(let M=0;M<R;M++){const A=T.data[M].getMaterial();if(A&&(A.fillMode==7||A.fillMode==0||A.fillMode==1||A.fillMode==2||A.fillMode==4)){S=!0;break}}if(!S)return d.hit=!0,d.pickedMesh=this,d.distance=E.Distance(r.origin,x.boundingSphere.center),d.subMeshId=-1,d;for(let M=0;M<R;M++){const I=T.data[M];if(R>1&&!_&&!I.canIntersects(r))continue;const A=I.intersects(r,this._positions,this.getIndices(),o,c);if(A&&(o||!b||A.distance<b.distance)&&(b=A,b.subMeshId=I._id,b._internalSubMeshId=M,o))break}if(b){const M=f??this.getWorldMatrix(),I=fe.Vector3[0],A=fe.Vector3[1];E.TransformCoordinatesToRef(r.origin,M,I),r.direction.scaleToRef(b.distance,A);const C=E.TransformNormal(A,M).addInPlace(I);return d.hit=!0,d.distance=E.Distance(I,C),d.pickedPoint=C,d.pickedMesh=this,d.bu=b.bu||0,d.bv=b.bv||0,d.subMeshFaceId=b.faceId,d.faceId=b.faceId+T.data[b._internalSubMeshId].indexStart/(this.getClassName().indexOf("LinesMesh")!==-1?2:3),d.subMeshId=b.subMeshId,d}return d}clone(r,o,c){return null}releaseSubMeshes(r=!1){if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose(r);else this.subMeshes=[];return this}dispose(r,o=!1){let c;const h=this.getScene();for(this._scene.useMaterialMeshMap&&this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),h.freeActiveMeshes(),h.freeRenderingGroups(),h.renderingManager.maintainStateBetweenFrames&&h.renderingManager.restoreDispachedFlags(),this.actionManager!==void 0&&this.actionManager!==null&&(this.actionManager.disposeWhenUnowned&&!this._scene.meshes.some(d=>d!==this&&d.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),c=0;c<this._intersectionsInProgress.length;c++){const d=this._intersectionsInProgress[c],g=d._intersectionsInProgress.indexOf(this);d._intersectionsInProgress.splice(g,1)}this._intersectionsInProgress.length=0;const f=h.lights;for(const d of f){let g=d.includedOnlyMeshes.indexOf(this);g!==-1&&d.includedOnlyMeshes.splice(g,1),g=d.excludedMeshes.indexOf(this),g!==-1&&d.excludedMeshes.splice(g,1);const p=d.getShadowGenerators();if(p){const x=p.values();for(let b=x.next();b.done!==!0;b=x.next()){const R=b.value.getShadowMap();R&&R.renderList&&(g=R.renderList.indexOf(this),g!==-1&&R.renderList.splice(g,1))}}}this.releaseSubMeshes(h._isDisposing);const _=h.getEngine();if(this._occlusionQuery!==null&&(this.isOcclusionQueryInProgress=!1,_.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),_.wipeCaches(),h.removeMesh(this),this._parentContainer){const d=this._parentContainer.meshes.indexOf(this);d>-1&&this._parentContainer.meshes.splice(d,1),this._parentContainer=null}if(o&&this.material&&(this.material.getClassName()==="MultiMaterial"?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!r)for(c=0;c<h.particleSystems.length;c++)h.particleSystems[c].emitter===this&&(h.particleSystems[c].dispose(),c--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this._uniformBuffer.dispose(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),super.dispose(r,o)}_initFacetData(){const r=this._internalAbstractMeshDataInfo._facetData;r.facetNormals||(r.facetNormals=[]),r.facetPositions||(r.facetPositions=[]),r.facetPartitioning||(r.facetPartitioning=new Array),r.facetNb=this.getIndices().length/3|0,r.partitioningSubdivisions=r.partitioningSubdivisions?r.partitioningSubdivisions:10,r.partitioningBBoxRatio=r.partitioningBBoxRatio?r.partitioningBBoxRatio:1.01;for(let o=0;o<r.facetNb;o++)r.facetNormals[o]=E.Zero(),r.facetPositions[o]=E.Zero();return r.facetDataEnabled=!0,this}updateFacetData(){const r=this._internalAbstractMeshDataInfo._facetData;r.facetDataEnabled||this._initFacetData();const o=this.getVerticesData(F.PositionKind),c=this.getIndices(),h=this.getVerticesData(F.NormalKind)?.slice(),f=this.getBoundingInfo();if(r.facetDepthSort&&!r.facetDepthSortEnabled){if(r.facetDepthSortEnabled=!0,c instanceof Uint16Array)r.depthSortedIndices=new Uint16Array(c);else if(c instanceof Uint32Array)r.depthSortedIndices=new Uint32Array(c);else{let d=!1;for(let g=0;g<c.length;g++)if(c[g]>65535){d=!0;break}d?r.depthSortedIndices=new Uint32Array(c):r.depthSortedIndices=new Uint16Array(c)}if(r.facetDepthSortFunction=function(d,g){return g.sqDistance-d.sqDistance},!r.facetDepthSortFrom){const d=this.getScene().activeCamera;r.facetDepthSortFrom=d?d.position:E.Zero()}r.depthSortedFacets=[];for(let d=0;d<r.facetNb;
vendor: 14,828 bytes, line 154
154d++){const g={ind:d*3,sqDistance:0};r.depthSortedFacets.push(g)}r.invertedMatrix=se.Identity(),r.facetDepthSortOrigin=E.Zero()}r.bbSize.x=f.maximum.x-f.minimum.x>Bt?f.maximum.x-f.minimum.x:Bt,r.bbSize.y=f.maximum.y-f.minimum.y>Bt?f.maximum.y-f.minimum.y:Bt,r.bbSize.z=f.maximum.z-f.minimum.z>Bt?f.maximum.z-f.minimum.z:Bt;let _=r.bbSize.x>r.bbSize.y?r.bbSize.x:r.bbSize.y;if(_=_>r.bbSize.z?_:r.bbSize.z,r.subDiv.max=r.partitioningSubdivisions,r.subDiv.X=Math.floor(r.subDiv.max*r.bbSize.x/_),r.subDiv.Y=Math.floor(r.subDiv.max*r.bbSize.y/_),r.subDiv.Z=Math.floor(r.subDiv.max*r.bbSize.z/_),r.subDiv.X=r.subDiv.X<1?1:r.subDiv.X,r.subDiv.Y=r.subDiv.Y<1?1:r.subDiv.Y,r.subDiv.Z=r.subDiv.Z<1?1:r.subDiv.Z,r.facetParameters.facetNormals=this.getFacetLocalNormals(),r.facetParameters.facetPositions=this.getFacetLocalPositions(),r.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),r.facetParameters.bInfo=f,r.facetParameters.bbSize=r.bbSize,r.facetParameters.subDiv=r.subDiv,r.facetParameters.ratio=this.partitioningBBoxRatio,r.facetParameters.depthSort=r.facetDepthSort,r.facetDepthSort&&r.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(r.invertedMatrix),E.TransformCoordinatesToRef(r.facetDepthSortFrom,r.invertedMatrix,r.facetDepthSortOrigin),r.facetParameters.distanceTo=r.facetDepthSortOrigin),r.facetParameters.depthSortedFacets=r.depthSortedFacets,h&&Be.ComputeNormals(o,c,h,r.facetParameters),r.facetDepthSort&&r.facetDepthSortEnabled){r.depthSortedFacets.sort(r.facetDepthSortFunction);const d=r.depthSortedIndices.length/3|0;for(let g=0;g<d;g++){const p=r.depthSortedFacets[g].ind;r.depthSortedIndices[g*3]=c[p],r.depthSortedIndices[g*3+1]=c[p+1],r.depthSortedIndices[g*3+2]=c[p+2]}this.updateIndices(r.depthSortedIndices,void 0,!0)}return this}getFacetLocalNormals(){const r=this._internalAbstractMeshDataInfo._facetData;return r.facetNormals||this.updateFacetData(),r.facetNormals}getFacetLocalPositions(){const r=this._internalAbstractMeshDataInfo._facetData;return r.facetPositions||this.updateFacetData(),r.facetPositions}getFacetLocalPartitioning(){const r=this._internalAbstractMeshDataInfo._facetData;return r.facetPartitioning||this.updateFacetData(),r.facetPartitioning}getFacetPosition(r){const o=E.Zero();return this.getFacetPositionToRef(r,o),o}getFacetPositionToRef(r,o){const c=this.getFacetLocalPositions()[r],h=this.getWorldMatrix();return E.TransformCoordinatesToRef(c,h,o),this}getFacetNormal(r){const o=E.Zero();return this.getFacetNormalToRef(r,o),o}getFacetNormalToRef(r,o){const c=this.getFacetLocalNormals()[r];return E.TransformNormalToRef(c,this.getWorldMatrix(),o),this}getFacetsAtLocalCoordinates(r,o,c){const h=this.getBoundingInfo(),f=this._internalAbstractMeshDataInfo._facetData,_=Math.floor((r-h.minimum.x*f.partitioningBBoxRatio)*f.subDiv.X*f.partitioningBBoxRatio/f.bbSize.x),d=Math.floor((o-h.minimum.y*f.partitioningBBoxRatio)*f.subDiv.Y*f.partitioningBBoxRatio/f.bbSize.y),g=Math.floor((c-h.minimum.z*f.partitioningBBoxRatio)*f.subDiv.Z*f.partitioningBBoxRatio/f.bbSize.z);return _<0||_>f.subDiv.max||d<0||d>f.subDiv.max||g<0||g>f.subDiv.max?null:f.facetPartitioning[_+f.subDiv.max*d+f.subDiv.max*f.subDiv.max*g]}getClosestFacetAtCoordinates(r,o,c,h,f=!1,_=!0){const d=this.getWorldMatrix(),g=fe.Matrix[5];d.invertToRef(g);const p=fe.Vector3[8];E.TransformCoordinatesFromFloatsToRef(r,o,c,g,p);const x=this.getClosestFacetAtLocalCoordinates(p.x,p.y,p.z,h,f,_);return h&&E.TransformCoordinatesFromFloatsToRef(h.x,h.y,h.z,d,h),x}getClosestFacetAtLocalCoordinates(r,o,c,h,f=!1,_=!0){let d=null,g,p,x,b,T,R,S,M;const I=this.getFacetLocalPositions(),A=this.getFacetLocalNormals(),D=this.getFacetsAtLocalCoordinates(r,o,c);if(!D)return null;let C=Number.MAX_VALUE,k,H,L,J;for(let te=0;te<D.length;te++)H=D[te],L=A[H],J=I[H],b=(r-J.x)*L.x+(o-J.y)*L.y+(c-J.z)*L.z,(!f||f&&_&&b>=0||f&&!_&&b<=0)&&(b=L.x*J.x+L.y*J.y+L.z*J.z,T=-(L.x*r+L.y*o+L.z*c-b)/(L.x*L.x+L.y*L.y+L.z*L.z),R=r+L.x*T,S=o+L.y*T,M=c+L.z*T,g=R-r,p=S-o,x=M-c,k=g*g+p*p+x*x,k<C&&(C=k,d=H,h&&(h.x=R,h.y=S,h.z=M)));return d}getFacetDataParameters(){return this._internalAbstractMeshDataInfo._facetData.facetParameters}disableFacetData(){const r=this._internalAbstractMeshDataInfo._facetData;return r.facetDataEnabled&&(r.facetDataEnabled=!1,r.facetPositions=[],r.facetNormals=[],r.facetPartitioning=new Array,r.facetParameters={},r.depthSortedIndices=new Uint32Array(0)),this}updateIndices(r,o,c=!1){return this}createNormals(r){const o=this.getVerticesData(F.PositionKind),c=this.getIndices();let h;return this.isVerticesDataPresent(F.NormalKind)?h=this.getVerticesData(F.NormalKind):h=[],Be.ComputeNormals(o,c,h,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(F.NormalKind,h,r),this}async optimizeIndicesAsync(){const r=this.getIndices();if(!r)return this;const{OptimizeIndices:o}=await Ji(async()=>{const{OptimizeIndices:c}=await import("./mesh.vertexData.functions-ayNlGC5K.js");return{OptimizeIndices:c}},[]);return o(r),this.setIndices(r,this.getTotalVertices()),this}alignWithNormal(r,o){o||(o=ea.Y);const c=fe.Vector3[0],h=fe.Vector3[1];return E.CrossToRef(o,r,h),E.CrossToRef(r,h,c),this.rotationQuaternion?Oe.RotationQuaternionFromAxisToRef(c,r,h,this.rotationQuaternion):E.RotationFromAxisToRef(c,r,h,this.rotation),this}_checkOcclusionQuery(r=!1){return!1}disableEdgesRendering(){throw je("EdgesRenderer")}enableEdgesRendering(r,o,c){throw je("EdgesRenderer")}getConnectedParticleSystems(){return this._scene.particleSystems.filter(r=>r.emitter===this)}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[yr.filter((...r)=>!Array.isArray(r[0])&&!Array.isArray(r[3])&&!Array.isArray(r[4])&&!Array.isArray(r[5])&&!Array.isArray(r[6]))],he(a,null,i,{kind:"method",name:"_ApplySkeleton",static:!0,private:!1,access:{has:r=>"_ApplySkeleton"in r,get:r=>r._ApplySkeleton},metadata:s},null,t),s&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),a.OCCLUSION_TYPE_NONE=(Z(a,t),0),a.OCCLUSION_TYPE_OPTIMISTIC=1,a.OCCLUSION_TYPE_STRICT=2,a.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,a.CULLINGSTRATEGY_STANDARD=0,a.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,a.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,a.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,a.DefaultIsPickable=!0,a})();(Pb=Lt.prototype).createOrUpdateSubmeshesOctree??(Pb.createOrUpdateSubmeshesOctree=He("AbstractMesh","createOrUpdateSubmeshesOctree"));(Ob=Lt.prototype).getPhysicsImpostor??(Ob.getPhysicsImpostor=He("AbstractMesh","getPhysicsImpostor"));(Fb=Lt.prototype).setPhysicsLinkWith??(Fb.setPhysicsLinkWith=He("AbstractMesh","setPhysicsLinkWith"));Object.getOwnPropertyDescriptor(Lt.prototype,"occlusionRetryCount")||Object.defineProperty(Lt.prototype,"occlusionRetryCount",mt("AbstractMesh","occlusionRetryCount"));Object.getOwnPropertyDescriptor(Lt.prototype,"occlusionType")||Object.defineProperty(Lt.prototype,"occlusionType",mt("AbstractMesh","occlusionType"));Object.getOwnPropertyDescriptor(Lt.prototype,"occlusionQueryAlgorithmType")||Object.defineProperty(Lt.prototype,"occlusionQueryAlgorithmType",mt("AbstractMesh","occlusionQueryAlgorithmType"));Object.getOwnPropertyDescriptor(Lt.prototype,"isOccluded")||Object.defineProperty(Lt.prototype,"isOccluded",mt("AbstractMesh","isOccluded"));Object.getOwnPropertyDescriptor(Lt.prototype,"isOcclusionQueryInProgress")||Object.defineProperty(Lt.prototype,"isOcclusionQueryInProgress",mt("AbstractMesh","isOcclusionQueryInProgress"));Object.getOwnPropertyDescriptor(Lt.prototype,"forceRenderingWhenOccluded")||Object.defineProperty(Lt.prototype,"forceRenderingWhenOccluded",mt("AbstractMesh","forceRenderingWhenOccluded"));Object.getOwnPropertyDescriptor(Lt.prototype,"occlusionForRenderPassId")||Object.defineProperty(Lt.prototype,"occlusionForRenderPassId",mt("AbstractMesh","occlusionForRenderPassId"));Object.getOwnPropertyDescriptor(Lt.prototype,"decalMap")||Object.defineProperty(Lt.prototype,"decalMap",mt("AbstractMesh","decalMap"));Object.getOwnPropertyDescriptor(Lt.prototype,"instancedBuffers")||Object.defineProperty(Lt.prototype,"instancedBuffers",mt("AbstractMesh","instancedBuffers"));Object.getOwnPropertyDescriptor(Lt.prototype,"physicsImpostor")||Object.defineProperty(Lt.prototype,"physicsImpostor",mt("AbstractMesh","physicsImpostor"));Object.getOwnPropertyDescriptor(Lt.prototype,"showBoundingBox")||Object.defineProperty(Lt.prototype,"showBoundingBox",mt("AbstractMesh","showBoundingBox"));Object.getOwnPropertyDescriptor(Lt.prototype,"edgesRenderer")||Object.defineProperty(Lt.prototype,"edgesRenderer",mt("AbstractMesh","edgesRenderer"));Object.getOwnPropertyDescriptor(Lt.prototype,"renderOutline")||Object.defineProperty(Lt.prototype,"renderOutline",mt("AbstractMesh","renderOutline"));Object.getOwnPropertyDescriptor(Lt.prototype,"renderOverlay")||Object.defineProperty(Lt.prototype,"renderOverlay",mt("AbstractMesh","renderOverlay"));let ew=(()=>{var a;let e=[],t,i,s,r,o,c,h,f,_,d,g,p;return a=class{constructor(){this._func=Z(this,e),this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=519,this.opStencilFail=7680,this.opDepthFail=7680,this.opStencilDepthPass=7681,this.backFunc=519,this.backOpStencilFail=7680,this.backOpDepthFail=7680,this.backOpStencilDepthPass=7681}get func(){return this._func}set func(b){this._func=b}get backFunc(){return this._backFunc}set backFunc(b){this._backFunc=b}get funcRef(){return this._funcRef}set funcRef(b){this._funcRef=b}get funcMask(){return this._funcMask}set funcMask(b){this._funcMask=b}get opStencilFail(){return this._opStencilFail}set opStencilFail(b){this._opStencilFail=b}get opDepthFail(){return this._opDepthFail}set opDepthFail(b){this._opDepthFail=b}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(b){this._opStencilDepthPass=b}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(b){this._backOpStencilFail=b}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(b){this._backOpDepthFail=b}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(b){this._backOpStencilDepthPass=b}get mask(){return this._mask}set mask(b){this._mask=b}get enabled(){return this._enabled}set enabled(b){this._enabled=b}getClassName(){return"MaterialStencilState"}copyTo(b){Rt.Clone(()=>b,this)}serialize(){return Rt.Serialize(this)}parse(b,T,R){Rt.Parse(()=>this,b,T,R)}},(()=>{const x=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[pe()],i=[pe()],s=[pe()],r=[pe()],o=[pe()],c=[pe()],h=[pe()],f=[pe()],_=[pe()],d=[pe()],g=[pe()],p=[pe()],he(a,null,t,{kind:"getter",name:"func",static:!1,private:!1,access:{has:b=>"func"in b,get:b=>b.func},metadata:x},null,e),he(a,null,i,{kind:"getter",name:"backFunc",static:!1,private:!1,access:{has:b=>"backFunc"in b,get:b=>b.backFunc},metadata:x},null,e),he(a,null,s,{kind:"getter",name:"funcRef",static:!1,private:!1,access:{has:b=>"funcRef"in b,get:b=>b.funcRef},metadata:x},null,e),he(a,null,r,{kind:"getter",name:"funcMask",static:!1,private:!1,access:{has:b=>"funcMask"in b,get:b=>b.funcMask},metadata:x},null,e),he(a,null,o,{kind:"getter",name:"opStencilFail",static:!1,private:!1,access:{has:b=>"opStencilFail"in b,get:b=>b.opStencilFail},metadata:x},null,e),he(a,null,c,{kind:"getter",name:"opDepthFail",static:!1,private:!1,access:{has:b=>"opDepthFail"in b,get:b=>b.opDepthFail},metadata:x},null,e),he(a,null,h,{kind:"getter",name:"opStencilDepthPass",static:!1,private:!1,access:{has:b=>"opStencilDepthPass"in b,get:b=>b.opStencilDepthPass},metadata:x},null,e),he(a,null,f,{kind:"getter",name:"backOpStencilFail",static:!1,private:!1,access:{has:b=>"backOpStencilFail"in b,get:b=>b.backOpStencilFail},metadata:x},null,e),he(a,null,_,{kind:"getter",name:"backOpDepthFail",static:!1,private:!1,access:{has:b=>"backOpDepthFail"in b,get:b=>b.backOpDepthFail},metadata:x},null,e),he(a,null,d,{kind:"getter",name:"backOpStencilDepthPass",static:!1,private:!1,access:{has:b=>"backOpStencilDepthPass"in b,get:b=>b.backOpStencilDepthPass},metadata:x},null,e),he(a,null,g,{kind:"getter",name:"mask",static:!1,private:!1,access:{has:b=>"mask"in b,get:b=>b.mask},metadata:x},null,e),he(a,null,p,{kind:"getter",name:"enabled",static:!1,private:!1,access:{has:b=>"enabled"in b,get:b=>b.enabled},metadata:x},null,e),x&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:x})})(),a})();class Li{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}Li.FALLOFF_DEFAULT=0;Li.FALLOFF_PHYSICAL=1;Li.FALLOFF_GLTF=2;Li.FALLOFF_STANDARD=3;Li.LIGHTMAP_DEFAULT=0;Li.LIGHTMAP_SPECULAR=1;Li.LIGHTMAP_SHADOWSONLY=2;Li.INTENSITYMODE_AUTOMATIC=0;Li.INTENSITYMODE_LUMINOUSPOWER=1;Li.INTENSITYMODE_LUMINOUSINTENSITY=2;Li.INTENSITYMODE_ILLUMINANCE=3;Li.INTENSITYMODE_LUMINANCE=4;Li.LIGHTTYPEID_POINTLIGHT=0;Li.LIGHTTYPEID_DIRECTIONALLIGHT=1;Li.LIGHTTYPEID_SPOTLIGHT=2;Li.LIGHTTYPEID_HEMISPHERICLIGHT=3;Li.LIGHTTYPEID_RECT_AREALIGHT=4;Li.LIGHTTYPEID_CLUSTERED_CONTAINER=5;const ks=new se,cn=new se,hn=new se,ml={getScene:()=>{},eyeAtCamera:!0};function gl(a,e,t){const i=t.asArray(),s=e.asArray();for(let r=0;r<16;r++)i[r]=s[r];return i[12]-=a.x,i[13]-=a.y,i[14]-=a.z,t.markAsUpdated(),t}function tw(a,e,t){return th(e,cn),gl(a,cn,hn),th(hn,t),t}function fh(a,e,t){if(!ml.eyeAtCamera)return tw(a,e,t);const i=t.asArray(),s=e.asArray();for(let r=0;r<16;r++)i[r]=s[r];return i[12]=0,i[13]=0,i[14]=0,t.markAsUpdated(),t}function Pd(a,e,t,i){return cl(fh(a,e,i),t,i),i}function Ub(a,e,t,i){return th(t,cn),cl(e,cn,hn),gl(a,hn,cn),fh(a,t,hn),cl(cn,hn,i),i}function kb(a,e,t,i,s,r){return th(t,cn),cl(e,cn,hn),gl(a,hn,cn),Pd(a,i,s,hn),cl(cn,hn,r),r}function Nb(a,e){const t=ml.getScene();if(!t||ks===e)return e;ks.updateFlag=e.updateFlag;const i=t.floatingOriginOffset;switch(a){case"world":return gl(i,e,ks);case"view":return fh(i,e,ks);case"worldView":return Ub(i,e,t.getViewMatrix(),ks);case"viewProjection":return Pd(i,t.getViewMatrix(),t.getProjectionMatrix(),ks);case"worldViewProjection":return kb(i,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),ks);default:if(a.startsWith("u_")){const s=a.toLowerCase();if(s.startsWith("u_worldviewprojection"))return kb(i,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),ks);if(s.startsWith("u_viewprojection"))return Pd(i,t.getViewMatrix(),t.getProjectionMatrix(),ks);if(s.startsWith("u_worldview"))return Ub(i,e,t.getViewMatrix(),ks);if(s.startsWith("u_world"))return gl(i,e,ks);if(s.startsWith("u_view"))return fh(i,e,ks)}return e}}const pl=Le,Od=pi,M1=pl.prototype._updateMatrixForUniform,S1=pi.prototype.setMatr
154ix;function iw(){pi.prototype.setMatrix=S1,Od._setMatrixOverride=void 0,pl.prototype._updateMatrixForUniform=M1,pl.prototype._updateMatrixForUniformOverride=void 0}function sw(){Od.prototype._setMatrixOverride=S1,Od.prototype.setMatrix=function(a,e){return this._setMatrixOverride(a,Nb(a,e)),this},pl.prototype._updateMatrixForUniformOverride=M1,pl.prototype._updateMatrixForUniform=function(a,e){this._updateMatrixForUniformOverride(a,Nb(a,e))}}function nw(a){a.indexOf("vClipPlane")===-1&&a.push("vClipPlane"),a.indexOf("vClipPlane2")===-1&&a.push("vClipPlane2"),a.indexOf("vClipPlane3")===-1&&a.push("vClipPlane3"),a.indexOf("vClipPlane4")===-1&&a.push("vClipPlane4"),a.indexOf("vClipPlane5")===-1&&a.push("vClipPlane5"),a.indexOf("vClipPlane6")===-1&&a.push("vClipPlane6")}function rw(a,e,t){const i=!!(a.clipPlane??e.clipPlane),s=!!(a.clipPlane2??e.clipPlane2),r=!!(a.clipPlane3??e.clipPlane3),o=!!(a.clipPlane4??e.clipPlane4),c=!!(a.clipPlane5??e.clipPlane5),h=!!(a.clipPlane6??e.clipPlane6);i&&t.push("#define CLIPPLANE"),s&&t.push("#define CLIPPLANE2"),r&&t.push("#define CLIPPLANE3"),o&&t.push("#define CLIPPLANE4"),c&&t.pu
154sh("#define CLIPPLANE5"),h&&t.push("#define CLIPPLANE6")}function aw(a,e,t){let i=e.clipPlane??t.clipPlane;Wa(a,"vClipPlane",i),i=e.clipPlane2??t.clipPlane2,Wa(a,"vClipPlane2",i),i=e.clipPlane3??t.clipPlane3,Wa(a,"vClipPlane3",i),i=e.clipPlane4??t.clipPlane4,Wa(a,"vClipPlane4",i),i=e.clipPlane5??t.clipPlane5,Wa(a,"vClipPlane5",i),i=e.clipPlane6??t.clipPlane6,Wa(a,"vClipPlane6",i)}function Wa(a,e,t){if(t){const i=ml.getScene()?.floatingOriginOffset||E.ZeroReadOnly;a.setFloat4(e,t.normal.x,t.normal.y,t.normal.z,t.d+E.Dot(t.normal,i))}}function ow(a,e,t){if(!a||a.LOGARITHMICDEPTH||a.indexOf&&a.indexOf("LOGARITHMICDEPTH")>=0){const i=t.activeCamera;i.mode===1&&me.Error("Logarithmic depth is not compatible with orthographic cameras!",20),e.setFloat("logarithmicDepthConstant",2/(Math.log(i.maxZ+1)/Math.LN2))}}const zb={r:0,g:0,b:0},Xr={NUM_MORPH_INFLUENCERS:0,NORMAL:!1,TANGENT:!1,UV:!1,UV2:!1,COLOR:!1};function lw(a,e,t,i=!1){t&&a.fogEnabled&&(!e||e.applyFog)&&a.fogMode!==0&&(t.setFloat4("vFogInfos",a.fogMode,a.fogStart,a.fogEnd,a.fogDensity),i?(a.fogColor.toLinearSpaceToRef(zb,a.getEngine().useExactSrgbConversions),t.setColor3("vFogColor",zb)):t.setColor3("vFogColor",a.fogColor))}function cw(a,e,t,i,s,r,o,c,h,f){const _=a.numMaxInfluencers||a.numInfluencers;return _<=0?0:(e.push("#define MORPHTARGETS"),a.hasPositions&&e.push("#define MORPHTARGETTEXTURE_HASPOSITIONS"),a.hasNormals&&e.push("#define MORPHTARGETTEXTURE_HASNORMALS"),a.hasTangents&&e.push("#define MORPHTARGETTEXTURE_HASTANGENTS"),a.hasUVs&&e.push("#define MORPHTARGETTEXTURE_HASUVS"),a.hasUV2s&&e.push("#define MORPHTARGETTEXTURE_HASUV2S"),a.hasColors&&e.push("#define MORPHTARGETTEXTURE_HASCOLORS"),a.supportsPositions&&s&&e.push("#define MORPHTARGETS_POSITION"),a.supportsNormals&&r&&e.push("#define MORPHTARGETS_NORMAL"),a.supportsTangents&&o&&e.push("#define MORPHTARGETS_TANGENT"),a.supportsUVs&&c&&e.push("#define MORPHTARGETS_UV"),a.supportsUV2s&&h&&e.push("#define MORPHTARGETS_UV2"),a.supportsColors&&f&&e.push("#define MORPHTARGETS_COLOR"),e.push("#define NUM_MORPH_INFLUENCERS "+_),a.isUsingTextureForTargets&&e.push("#define MORPHTARGETS_TEXTURE"),Xr.NUM_MORPH_INFLUENCERS=_,Xr.NORMAL=r,Xr.TANGENT=o,Xr.UV=c,Xr.UV2=h,Xr.COLOR=f,hw(t,i,Xr,s),_)}function hw(a,e,t,i=!0){const s=t.NUM_MORPH_INFLUENCERS;if(s>0&&ft.LastCreatedEngine){const r=ft.LastCreatedEngine.getCaps().maxVertexAttribs,o=e.morphTargetManager;if(o?.isUsingTextureForTargets)return;const c=o&&o.supportsPositions&&i,h=o&&o.supportsNormals&&t.NORMAL,f=o&&o.supportsTangents&&t.TANGENT,_=o&&o.supportsUVs&&t.UV1,d=o&&o.supportsUV2s&&t.UV2,g=o&&o.supportsColors&&t.VERTEXCOLOR;for(let p=0;p<s;p++)c&&a.push("position"+p),h&&a.push("normal"+p),f&&a.push("tangent"+p),_&&a.push("uv_"+p),d&&a.push("uv2_"+p),g&&a.push("color"+p),a.length>r&&me.Error("Cannot add more vertex attributes for mesh "+e.name)}}function uw(a,e=!1){a.push("world0"),a.push("world1"),a.push("world2"),a.push("world3"),e&&(a.push("previousWorld0"),a.push("previousWorld1"),a.push("previousWorld2"),a.push("previousWorld3"))}function fw(a,e){const t=a.morphTargetManager;!a||!t||e.setFloatArray("morphTargetInfluences",t.influences)}function E1(a,e){e.bindToEffect(a,"Scene")}function dw(a,e,t){if(!(!e||!a)&&(a.computeBonesUsingShaders&&e._bonesComputationForcedToCPU&&(a.computeBonesUsingShaders=!1),a.useBones&&a.computeBonesUsingShaders&&a.skeleton)){const i=a.skeleton;if(i.isUsingTextureForMatrices&&e.getUniformIndex("boneTextureInfo")>-1){const s=i.getTransformMatrixTexture(a);e.setTexture("boneSampler",s),e.setFloat2("boneTextureInfo",i._textureWidth,i._textureHeight)}else{const s=i.getTransformMatrices(a);s&&e.setMatrices("mBones",s)}}}let wi=(()=>{var a;let e=[],t,i=[],s=[],r,o=[],c=[],h,f=[],_=[],d,g=[],p=[],x,b=[],T=[],R,S=[],M=[],I,A=[],D=[],C,k=[],H=[],L,J=[],te=[],ae,B=[],$=[],z,X=[],q=[],G,j=[],w=[],O,U=[],W=[],oe,le=[],be=[],Ee,Fe=[],Y=[],ue,de=[],we=[],qe,ke=[],ut=[],Gt,Ot=[],pt=[],Nt,Ft=[],$e=[],ie,Pe=[],ei=[],Xt,ai=[],Kt=[],Zt,At=[],ti=[],Dt,zt=[],ii=[],mi,gi=[],_n=[],zs,ji,Tt,Q,Ze=[],Ri=[],ot;return a=class{get useVertexPulling(){return this._useVertexPulling}set useVertexPulling(N){this._useVertexPulling!==N&&(this._useVertexPulling=N,this.markAsDirty(a.MiscDirtyFlag))}get _supportGlowLayer(){return!1}set _glowModeEnabled(N){}get shaderLanguage(){return this._shaderLanguage}get canRenderToMRT(){return!1}set alpha(N){if(this._alpha===N)return;const xe=this._alpha;this._alpha=N,(xe===1||N===1)&&this.markAsDirty(a.MiscDirtyFlag+a.PrePassDirtyFlag)}get alpha(){return this._alpha}set backFaceCulling(N){this._backFaceCulling!==N&&(this._backFaceCulling=N,this.markAsDirty(a.TextureDirtyFlag))}
vendor: 5,858 bytes, line 154
154get backFaceCulling(){return this._backFaceCulling}set textureRepetitionMode(N){const xe=Math.max(0,Math.min(N|0,4));this._textureRepetitionMode!==xe&&(this._textureRepetitionMode=xe,this.markAsDirty(a.TextureDirtyFlag))}get textureRepetitionMode(){return this._textureRepetitionMode}set cullBackFaces(N){this._cullBackFaces!==N&&(this._cullBackFaces=N,this.markAsDirty(a.TextureDirtyFlag))}get cullBackFaces(){return this._cullBackFaces}get blockDirtyMechanism(){return this._blockDirtyMechanism}set blockDirtyMechanism(N){this._blockDirtyMechanism!==N&&(this._blockDirtyMechanism=N,N||this.markDirty())}atomicMaterialsUpdate(N){this.blockDirtyMechanism=!0;try{N(this)}finally{this.blockDirtyMechanism=!1}}get hasRenderTargetTextures(){return this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._eventInfo.hasRenderTargetTextures}set onDispose(N){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(N)}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Ae),this._onBindObservable}set onBind(N){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(N)}get onUnBindObservable(){return this._onUnBindObservable||(this._onUnBindObservable=new Ae),this._onUnBindObservable}get onEffectCreatedObservable(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new Ae),this._onEffectCreatedObservable}set alphaMode(N){this._alphaMode[0]!==N&&(this._alphaMode[0]=N,this.markAsDirty(a.TextureDirtyFlag))}get alphaMode(){return this._alphaMode[0]}get alphaModes(){return this._alphaMode}setAlphaMode(N,xe=0){this._alphaMode[xe]!==N&&(this._alphaMode[xe]=N,this.markAsDirty(a.TextureDirtyFlag))}set needDepthPrePass(N){this._needDepthPrePass!==N&&(this._needDepthPrePass=N,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))}get needDepthPrePass(){return this._needDepthPrePass}get isPrePassCapable(){return!1}set fogEnabled(N){this._fogEnabled!==N&&(this._fogEnabled=N,this.markAsDirty(a.MiscDirtyFlag))}get fogEnabled(){return this._fogEnabled}get wireframe(){switch(this._fillMode){case a.WireFrameFillMode:case a.LineListDrawMode:case a.LineLoopDrawMode:case a.LineStripDrawMode:return!0}return this._scene.forceWireframe}set wireframe(N){this.fillMode=N?a.WireFrameFillMode:a.TriangleFillMode}get pointsCloud(){switch(this._fillMode){case a.PointFillMode:case a.PointListDrawMode:return!0}return this._scene.forcePointsCloud}set pointsCloud(N){this.fillMode=N?a.PointFillMode:a.TriangleFillMode}get fillMode(){return this._fillMode}set fillMode(N){this._fillMode!==N&&(this._fillMode=N,this.markAsDirty(a.MiscDirtyFlag))}get useLogarithmicDepth(){return this._useLogarithmicDepth}set useLogarithmicDepth(N){const xe=this.getScene().getEngine().getCaps().fragmentDepthSupported;N&&!xe&&me.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it."),this._useLogarithmicDepth=N&&xe,this._markAllSubMeshesAsMiscDirty()}get isVertexOutputInvariant(){return this._isVertexOutputInvariant}set isVertexOutputInvariant(N){this._isVertexOutputInvariant!==N&&(this._isVertexOutputInvariant=N,this._markAllSubMeshesAsMiscDirty())}_getDrawWrapper(){return this._drawWrapper}_setDrawWrapper(N){this._drawWrapper=N}constructor(N,xe,ht,Ye=!1){this.customShaderNameResolve=Z(this,e),this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this._shaderLanguage=0,this._forceGLSL=!1,this._useVertexPulling=!1,this.id=Z(this,i,void 0),this.uniqueId=(Z(this,s),Z(this,o,void 0)),this._loadedUniqueId=Z(this,c),this.name=Z(this,f,void 0),this.metadata=(Z(this,_),Z(this,g,null)),this._internalMetadata=Z(this,p),this.reservedDataStore=null,this.checkReadyOnEveryCall=Z(this,b,!1),this.checkReadyOnlyOnce=(Z(this,T),Z(this,S,!1)),this.state=(Z(this,M),Z(this,A,"")),this._alpha=(Z(this,D),Z(this,k,1)),this.inspectableCustomProperties=Z(this,H),this._backFaceCulling=Z(this,J,!0),this._textureRepetitionMode=(Z(this,te),Z(this,B,0)),this.textureRepetitionHexTilingParams=(Z(this,$),Z(this,X,[1,.6,7,.5])),this._cullBackFaces=(Z(this,q),Z(this,j,!0)),this._blockDirtyMechanism=(Z(this,w),!1),this.sideOrientation=Z(this,U,null),this.onCompiled=(Z(this,W),null),this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new Ae,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=Z(this,le,[2]),this._needDepthPrePass=(Z(this,be),Z(this,Fe,!1)),this.disableDepthWrite=(Z(this,Y),Z(this,de,!1)),this.disableColorWrite=(Z(this,we),Z(this,ke,!1)),this.forceDepthWrite=(Z(this,ut),Z(this,Ot,!1)),this.depthFunction=(Z(this,pt),Z(this,Ft,0)),this.separateCullingPass=(Z(this,$e),Z(this,Pe,!1)),this._fogEnabled=(Z(this,ei),Z(this,ai,!0)),this.pointSize=(Z(this,Kt),Z(this,At,1)),this.zOffset=(Z(this,ti),Z(this,zt,0)),this.zOffsetUnits=(Z(this,ii),Z(this,gi,0)),this.clipPlane=Z(this,_n),this.stencil=new ew,this._isVertexOutputInvariant=Z(this,Ze,a.ForceVertexOutputInvariant),this._materialContext=Z(this,Ri),this._useUBO=!1,this._fillMode=a.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._parentContainer=null,this._uniformBufferLayoutBuilt=!1,this._eventInfo={},this._callbackPluginEventGeneric=()=>{},this._callbackPluginEventIsReadyForSubMesh=()=>{},this._callbackPluginEventPrepareDefines=()=>{},this._callbackPluginEventPrepareDefinesBeforeAttributes=()=>{},this._callbackPluginEventHardBindForSubMesh=()=>{},this._callbackPluginEventBindForSubMesh=()=>{},this._callbackPluginEventHasRenderTargetTextures=()=>{}
vendor: 13,531 bytes, line 154
154,this._callbackPluginEventFillRenderTargetTextures=()=>{},this._transparencyMode=null,this.name=N;const nt=xe||ft.LastCreatedScene;nt&&(this._scene=nt,this._dirtyCallbacks={},this._forceGLSL=Ye,this._dirtyCallbacks[1]=this._markAllSubMeshesAsTexturesDirty.bind(this),this._dirtyCallbacks[2]=this._markAllSubMeshesAsLightsDirty.bind(this),this._dirtyCallbacks[4]=this._markAllSubMeshesAsFresnelDirty.bind(this),this._dirtyCallbacks[8]=this._markAllSubMeshesAsAttributesDirty.bind(this),this._dirtyCallbacks[16]=this._markAllSubMeshesAsMiscDirty.bind(this),this._dirtyCallbacks[32]=this._markAllSubMeshesAsPrePassDirty.bind(this),this._dirtyCallbacks[127]=this._markAllSubMeshesAsAllDirty.bind(this),this.id=N||_t.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new A1(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new Le(this._scene.getEngine(),void 0,void 0,N),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,this._createUniformBuffer(),ht||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),a.OnEventObservable.notifyObservers(this,1))}_createUniformBuffer(){const N=this.getScene().getEngine();this._uniformBuffer?.dispose(),N.isWebGPU&&!this._forceGLSL?(this._uniformBuffer=new Le(N,void 0,void 0,this.name,!0),this._shaderLanguage=1):this._uniformBuffer=new Le(this._scene.getEngine(),void 0,void 0,this.name),this._uniformBufferLayoutBuilt=!1}toString(N){return"Name: "+this.name}getClassName(){return"Material"}get _isMaterial(){return!0}get isFrozen(){return this.checkReadyOnlyOnce}freeze(){this.markDirty(),this.checkReadyOnlyOnce=!0}unfreeze(){this.markDirty(),this.checkReadyOnlyOnce=!1}isReady(N,xe){return!0}isReadyForSubMesh(N,xe,ht){const Ye=xe.materialDefines;return Ye?(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=Ye,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh):!1}getEffect(){return this._drawWrapper.effect}getScene(){return this._scene}_getEffectiveOrientation(N){return this.sideOrientation!==null?this.sideOrientation:N.sideOrientation}get transparencyMode(){return this._transparencyMode}set transparencyMode(N){this._transparencyMode!==N&&(this._transparencyMode=N,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _hasTransparencyMode(){return this._transparencyMode!=null}get _transparencyModeIsBlend(){return this._transparencyMode===a.MATERIAL_ALPHABLEND||this._transparencyMode===a.MATERIAL_ALPHATESTANDBLEND}get _transparencyModeIsTest(){return this._transparencyMode===a.MATERIAL_ALPHATEST||this._transparencyMode===a.MATERIAL_ALPHATESTANDBLEND}get _disableAlphaBlending(){return this._transparencyMode===a.MATERIAL_OPAQUE||this._transparencyMode===a.MATERIAL_ALPHATEST}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1}needAlphaBlendingForMesh(N){return this._hasTransparencyMode?this._transparencyModeIsBlend:N.visibility<1?!0:this._disableAlphaBlending?!1:N.hasVertexAlpha||this.needAlphaBlending()}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:!1}needAlphaTestingForMesh(N){return this._hasTransparencyMode?this._transparencyModeIsTest:!this.needAlphaBlendingForMesh(N)&&this.needAlphaTesting()}getAlphaTestTexture(){return null}markDirty(N=!1){const xe=this.getScene().meshes;for(const ht of xe)if(ht.subMeshes){for(const Ye of ht.subMeshes)if(Ye.getMaterial()===this)for(const nt of Ye._drawWrappers)nt&&this._materialContext===nt.materialContext&&(nt._wasPreviouslyReady=!1,nt._wasPreviouslyUsingInstances=null,nt._forceRebindOnNextCall=N)}N&&this.markAsDirty(a.AllDirtyFlag)}_preBind(N,xe=null){const ht=this._scene.getEngine(),nt=(xe??this.sideOrientation)===a.ClockWiseSideOrientation,Ht=N||this._getDrawWrapper();return jv(Ht)&&Ht.materialContext&&(Ht.materialContext.useVertexPulling=this.useVertexPulling),ht.enableEffect(Ht),ht.setState(this.backFaceCulling,this.zOffset,!1,nt,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),nt}bind(N,xe){}buildUniformLayout(){const N=this._uniformBuffer;this._eventInfo.ubo=N,this._callbackPluginEventGeneric(8,this._eventInfo),N.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(N,xe,ht){const Ye=ht._drawWrapper;this._eventInfo.subMesh=ht,this._callbackPluginEventBindForSubMesh(this._eventInfo),Ye._forceRebindOnNextCall=!1}bindOnlyWorldMatrix(N){}bindView(N){this._useUBO?this._needToBindSceneUbo=!0:N.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(N){this._useUBO?this._needToBindSceneUbo=!0:(N.setMatrix("viewProjection",this.getScene().getTransformMatrix()),N.setMatrix("projection",this.getScene().getProjectionMatrix()),N.setMatrix("inverseProjection",this.getScene().getInverseProjectionMatrix()))}bindEyePosition(N,xe){this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(N,xe)}_afterBind(N,xe=null,ht){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&xe&&(this._needToBindSceneUbo=!1,E1(xe,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),N?this._scene._cachedVisibility=N.visibility:this._scene._cachedVisibility=1,this._onBindObservable&&N&&this._onBindObservable.notifyObservers(N),this.disableDepthWrite){const Ye=this._scene.getEngine();this._cachedDepthWriteState=Ye.getDepthWrite(),Ye.setDepthWrite(!1)}if(this.disableColorWrite){const Ye=this._scene.getEngine();this._cachedColorWriteState=Ye.getColorWrite(),Ye.setColorWrite(!1)}if(this.depthFunction!==0){const Ye=this._scene.getEngine();this._cachedDepthFunctionState=Ye.getDepthFunction()||0,Ye.setDepthFunction(this.depthFunction)}}unbind(){this._scene.getSceneUniformBuffer().unbindEffect(),this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.depthFunction!==0&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)}getAnimatables(){return this._eventInfo.animatables=[],this._callbackPluginEventGeneric(256,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(512,this._eventInfo),this._eventInfo.activeTextures}hasTexture(N){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=N,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(N){return null}_clonePlugins(N,xe){const ht={};if(this._serializePlugins(ht),a._ParsePlugins(ht,N,this._scene,xe),this.pluginManager)for(const Ye of this.pluginManager._plugins){const nt=N.pluginManager.getPlugin(Ye.name);nt&&Ye.copyTo(nt)}}getBindedMeshes(){if(this.meshMap){const N=[];for(const xe in this.meshMap){const ht=this.meshMap[xe];ht&&N.push(ht)}return N}else return this._scene.meshes.filter(xe=>xe.material===this)}forceCompilation(N,xe,ht,Ye){const nt={clipPlane:!1,useInstances:!1,...ht},Ht=this.getScene(),Wt=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;const bi=()=>{if(!this._scene||!this._scene.getEngine())return;const Wn=Ht.clipPlane;if(nt.clipPlane&&(Ht.clipPlane=new an(0,0,0,1)),this._storeEffectOnSubMeshes){let ss=!0,Sr=null;if(N.subMeshes){const Ks=new Ss(0,0,0,0,0,N,void 0,!1,!1);Ks.materialDefines&&(Ks.materialDefines._renderId=-1),this.isReadyForSubMesh(N,Ks,nt.useInstances)||(Ks.effect&&Ks.effect.getCompilationError()&&Ks.effect.allFallbacksProcessed()?Sr=Ks.effect.getCompilationError():(ss=!1,setTimeout(bi,16)))}ss&&(this.allowShaderHotSwapping=Wt,Sr&&Ye&&Ye(Sr),xe&&xe(this))}else this.isReady()?(this.allowShaderHotSwapping=Wt,xe&&xe(this)):setTimeout(bi,16);nt.clipPlane&&(Ht.clipPlane=Wn)};bi()}async forceCompilationAsync(N,xe){return await new Promise((ht,Ye)=>{this.forceCompilation(N,()=>{ht()},xe,nt=>{Ye(nt)})})}markAsDirty(N){this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(a._DirtyCallbackArray.length=0,N&a.ImageProcessingDirtyFlag&&a._DirtyCallbackArray.push(a._ImageProcessingDirtyCallBack),N&a.TextureDirtyFlag&&a._DirtyCallbackArray.push(a._TextureDirtyCallBack),N&a.LightDirtyFlag&&a._DirtyCallbackArray.push(a._LightsDirtyCallBack),N&a.FresnelDirtyFlag&&a._DirtyCallbackArray.push(a._FresnelDirtyCallBack),N&a.AttributesDirtyFlag&&a._DirtyCallbackArray.push(a._AttributeDirtyCallBack),N&a.MiscDirtyFlag&&a._DirtyCallbackArray.push(a._MiscDirtyCallBack),N&a.PrePassDirtyFlag&&a._DirtyCallbackArray.push(a._PrePassDirtyCallBack),a._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(a._RunDirtyCallBacks),this.getScene().resetCachedMaterial())}resetDrawCache(){const N=this.getScene().meshes;for(const xe of N)if(xe.subMeshes)for(const ht of xe.subMeshes)ht.getMaterial()===this&&ht.resetDrawCache()}_markAllSubMeshesAsDirty(N){const xe=this.getScene();if(xe.blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const ht=xe.meshes;for(const Ye of ht)if(Ye.subMeshes){for(const nt of Ye.subMeshes)if((nt.getMaterial()||(xe._hasDefaultMaterial?xe.defaultMaterial:null))===this)for(const Wt of nt._drawWrappers)!Wt||!Wt.defines||!Wt.defines.markAllAsDirty||this._materialContext===Wt.materialContext&&N(Wt.defines)}}_markScenePrePassDirty(){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const N=this.getScene().enablePrePassRenderer();N&&N.markAsDirty()}_markAllSubMeshesAsAllDirty(){this._markAllSubMeshesAsDirty(a._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(a._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(a._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(a._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(a._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(a._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(a._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(a._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(a._PrePassDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(a._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(this._scene.performancePriority!==0){this.checkReadyOnlyOnce=!0;const N=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{this._scene.onScenePerformancePriorityChangedObservable.remove(N)})}}setPrePassRenderer(N){return!1}dispose(N,xe,ht){const Ye=this.getScene();if(Ye.stopAnimation(this),Ye.freeProcessedMaterials(),Ye.removeMaterial(this),this._eventInfo.forceDisposeTextures=xe,this._callbackPluginEventGeneric(2,this._eventInfo),this._parentContainer){const nt=this._parentContainer.materials.indexOf(this);nt>-1&&this._parentContainer.materials.splice(nt,1),this._parentContainer=null}if(ht!==!0)if(this.meshMap)for(const nt in this.meshMap){const Ht=this.meshMap[nt];this._disposeMeshResources(Ht)}else{const nt=Ye.meshes;for(const Ht of nt)this._disposeMeshResources(Ht)}this._uniformBuffer.dispose(),this._drawWrapper.effect&&(this._storeEffectOnSubMeshes||this._drawWrapper.effect.dispose(),this._drawWrapper.effect=null),this.metadata=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear(),this._eventInfo&&(this._eventInfo={})}_disposeMeshResources(N){if(!N)return;const xe=N.geometry,ht=N._internalAbstractMeshDataInfo._materialForRenderPass;if(this._storeEffectOnSubMeshes){if(N.subMeshes&&ht)for(const Ye of N.subMeshes){const nt=Ye._drawWrappers;for(let Ht=0;Ht<nt.length;Ht++){const Wt=nt[Ht]?.effect;if(!Wt)continue;ht[Ht]===this&&(xe?._releaseVertexArrayObject(Wt),Ye._removeDrawWrapper(Ht,!0,!0))}}}else xe?._releaseVertexArrayObject(this._drawWrapper.effect);N.material===this&&!N.sourceMesh&&(N.material=null)}serialize(){const N=Rt.Serialize(this);return N.stencil=this.stencil.serialize(),N.uniqueId=this.uniqueId,this._serializePlugins(N),N}_serializePlugins(N){if(N.plugins={},this.pluginManager)for(const xe of this.pluginManager._plugins)xe.doNotSerialize||(N.plugins[xe.getClassName()]=xe.serialize())}static ParseAlphaMode(N,xe){N._alphaMode!==void 0?xe._alphaMode=Array.isArray(N._alphaMode)?N._alphaMode:[N._alphaMode]:N.alphaMode!==void 0?xe._alphaMode=Array.isArray(N.alphaMode)?N.alphaMode:[N.alphaMode]:xe._alphaMode=[2]}static Parse(N,xe,ht){if(!N.customType)N.customType="BABYLON.StandardMaterial";else if(N.customType==="BABYLON.PBRMaterial"&&N.overloadedAlbedo&&(N.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return me.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null;const nt=_t.Instantiate(N.customType).Parse(N,xe,ht);return nt._loadedUniqueId=N.uniqueId,a.ParseAlphaMode(N,nt),nt}static _ParsePlugins(N,xe,ht,Ye){if(N.plugins)for(const nt in N.plugins){const Ht=N.plugins[nt];let Wt=xe.pluginManager?.getPlugin(Ht.name);if(!Wt){const bi=_t.Instantiate("BABYLON."+nt);
vendor: 9,056 bytes, line 154
154bi&&(Wt=new bi(xe))}Wt?.parse(Ht,ht,Ye)}}},(()=>{const ze=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[pe()],r=[pe()],h=[pe()],d=[pe()],x=[pe()],R=[pe()],I=[pe()],C=[pe("alpha")],L=[pe("backFaceCulling")],ae=[pe("textureRepetitionMode")],z=[pe("textureRepetitionHexTilingParams")],G=[pe("cullBackFaces")],O=[pe()],oe=[pe()],Ee=[pe()],ue=[pe()],qe=[pe()],Gt=[pe()],Nt=[pe()],ie=[pe()],Xt=[pe("fogEnabled")],Zt=[pe()],Dt=[pe()],mi=[pe()],zs=[pe()],ji=[pe()],Tt=[pe()],Q=[pe()],ot=[pe()],he(a,null,zs,{kind:"getter",name:"pointsCloud",static:!1,private:!1,access:{has:N=>"pointsCloud"in N,get:N=>N.pointsCloud},metadata:ze},null,e),he(a,null,ji,{kind:"getter",name:"fillMode",static:!1,private:!1,access:{has:N=>"fillMode"in N,get:N=>N.fillMode},metadata:ze},null,e),he(a,null,Tt,{kind:"getter",name:"useLogarithmicDepth",static:!1,private:!1,access:{has:N=>"useLogarithmicDepth"in N,get:N=>N.useLogarithmicDepth},metadata:ze},null,e),he(a,null,ot,{kind:"getter",name:"transparencyMode",static:!1,private:!1,access:{has:N=>"transparencyMode"in N,get:N=>N.transparencyMode},metadata:ze},null,e),he(null,null,t,{kind:"field",name:"id",static:!1,private:!1,access:{has:N=>"id"in N,get:N=>N.id,set:(N,xe)=>{N.id=xe}},metadata:ze},i,s),he(null,null,r,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:N=>"uniqueId"in N,get:N=>N.uniqueId,set:(N,xe)=>{N.uniqueId=xe}},metadata:ze},o,c),he(null,null,h,{kind:"field",name:"name",static:!1,private:!1,access:{has:N=>"name"in N,get:N=>N.name,set:(N,xe)=>{N.name=xe}},metadata:ze},f,_),he(null,null,d,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:N=>"metadata"in N,get:N=>N.metadata,set:(N,xe)=>{N.metadata=xe}},metadata:ze},g,p),he(null,null,x,{kind:"field",name:"checkReadyOnEveryCall",static:!1,private:!1,access:{has:N=>"checkReadyOnEveryCall"in N,get:N=>N.checkReadyOnEveryCall,set:(N,xe)=>{N.checkReadyOnEveryCall=xe}},metadata:ze},b,T),he(null,null,R,{kind:"field",name:"checkReadyOnlyOnce",static:!1,private:!1,access:{has:N=>"checkReadyOnlyOnce"in N,get:N=>N.checkReadyOnlyOnce,set:(N,xe)=>{N.checkReadyOnlyOnce=xe}},metadata:ze},S,M),he(null,null,I,{kind:"field",name:"state",static:!1,private:!1,access:{has:N=>"state"in N,get:N=>N.state,set:(N,xe)=>{N.state=xe}},metadata:ze},A,D),he(null,null,C,{kind:"field",name:"_alpha",static:!1,private:!1,access:{has:N=>"_alpha"in N,get:N=>N._alpha,set:(N,xe)=>{N._alpha=xe}},metadata:ze},k,H),he(null,null,L,{kind:"field",name:"_backFaceCulling",static:!1,private:!1,access:{has:N=>"_backFaceCulling"in N,get:N=>N._backFaceCulling,set:(N,xe)=>{N._backFaceCulling=xe}},metadata:ze},J,te),he(null,null,ae,{kind:"field",name:"_textureRepetitionMode",static:!1,private:!1,access:{has:N=>"_textureRepetitionMode"in N,get:N=>N._textureRepetitionMode,set:(N,xe)=>{N._textureRepetitionMode=xe}},metadata:ze},B,$),he(null,null,z,{kind:"field",name:"textureRepetitionHexTilingParams",static:!1,private:!1,access:{has:N=>"textureRepetitionHexTilingParams"in N,get:N=>N.textureRepetitionHexTilingParams,set:(N,xe)=>{N.textureRepetitionHexTilingParams=xe}},metadata:ze},X,q),he(null,null,G,{kind:"field",name:"_cullBackFaces",static:!1,private:!1,access:{has:N=>"_cullBackFaces"in N,get:N=>N._cullBackFaces,set:(N,xe)=>{N._cullBackFaces=xe}},metadata:ze},j,w),he(null,null,O,{kind:"field",name:"sideOrientation",static:!1,private:!1,access:{has:N=>"sideOrientation"in N,get:N=>N.sideOrientation,set:(N,xe)=>{N.sideOrientation=xe}},metadata:ze},U,W),he(null,null,oe,{kind:"field",name:"_alphaMode",static:!1,private:!1,access:{has:N=>"_alphaMode"in N,get:N=>N._alphaMode,set:(N,xe)=>{N._alphaMode=xe}},metadata:ze},le,be),he(null,null,Ee,{kind:"field",name:"_needDepthPrePass",static:!1,private:!1,access:{has:N=>"_needDepthPrePass"in N,get:N=>N._needDepthPrePass,set:(N,xe)=>{N._needDepthPrePass=xe}},metadata:ze},Fe,Y),he(null,null,ue,{kind:"field",name:"disableDepthWrite",static:!1,private:!1,access:{has:N=>"disableDepthWrite"in N,get:N=>N.disableDepthWrite,set:(N,xe)=>{N.disableDepthWrite=xe}},metadata:ze},de,we),he(null,null,qe,{kind:"field",name:"disableColorWrite",static:!1,private:!1,access:{has:N=>"disableColorWrite"in N,get:N=>N.disableColorWrite,set:(N,xe)=>{N.disableColorWrite=xe}},metadata:ze},ke,ut),he(null,null,Gt,{kind:"field",name:"forceDepthWrite",static:!1,private:!1,access:{has:N=>"forceDepthWrite"in N,get:N=>N.forceDepthWrite,set:(N,xe)=>{N.forceDepthWrite=xe}},metadata:ze},Ot,pt),he(null,null,Nt,{kind:"field",name:"depthFunction",static:!1,private:!1,access:{has:N=>"depthFunction"in N,get:N=>N.depthFunction,set:(N,xe)=>{N.depthFunction=xe}},metadata:ze},Ft,$e),he(null,null,ie,{kind:"field",name:"separateCullingPass",static:!1,private:!1,access:{has:N=>"separateCullingPass"in N,get:N=>N.separateCullingPass,set:(N,xe)=>{N.separateCullingPass=xe}},metadata:ze},Pe,ei),he(null,null,Xt,{kind:"field",name:"_fogEnabled",static:!1,private:!1,access:{has:N=>"_fogEnabled"in N,get:N=>N._fogEnabled,set:(N,xe)=>{N._fogEnabled=xe}},metadata:ze},ai,Kt),he(null,null,Zt,{kind:"field",name:"pointSize",static:!1,private:!1,access:{has:N=>"pointSize"in N,get:N=>N.pointSize,set:(N,xe)=>{N.pointSize=xe}},metadata:ze},At,ti),he(null,null,Dt,{kind:"field",name:"zOffset",static:!1,private:!1,access:{has:N=>"zOffset"in N,get:N=>N.zOffset,set:(N,xe)=>{N.zOffset=xe}},metadata:ze},zt,ii),he(null,null,mi,{kind:"field",name:"zOffsetUnits",static:!1,private:!1,access:{has:N=>"zOffsetUnits"in N,get:N=>N.zOffsetUnits,set:(N,xe)=>{N.zOffsetUnits=xe}},metadata:ze},gi,_n),he(null,null,Q,{kind:"field",name:"_isVertexOutputInvariant",static:!1,private:!1,access:{has:N=>"_isVertexOutputInvariant"in N,get:N=>N._isVertexOutputInvariant,set:(N,xe)=>{N._isVertexOutputInvariant=xe}},metadata:ze},Ze,Ri),ze&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ze})})(),a.TriangleFillMode=0,a.WireFrameFillMode=1,a.PointFillMode=2,a.PointListDrawMode=3,a.LineListDrawMode=4,a.LineLoopDrawMode=5,a.LineStripDrawMode=6,a.TriangleStripDrawMode=7,a.TriangleFanDrawMode=8,a.ClockWiseSideOrientation=0,a.CounterClockWiseSideOrientation=1,a.ImageProcessingDirtyFlag=64,a.TextureDirtyFlag=1,a.LightDirtyFlag=2,a.FresnelDirtyFlag=4,a.AttributesDirtyFlag=8,a.MiscDirtyFlag=16,a.PrePassDirtyFlag=32,a.AllDirtyFlag=127,a.MATERIAL_OPAQUE=0,a.MATERIAL_ALPHATEST=1,a.MATERIAL_ALPHABLEND=2,a.MATERIAL_ALPHATESTANDBLEND=3,a.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,a.MATERIAL_NORMALBLENDMETHOD_RNM=1,a.LIGHTFALLOFF_PHYSICAL=0,a.LIGHTFALLOFF_GLTF=1,a.LIGHTFALLOFF_STANDARD=2,a.OnEventObservable=new Ae,a.ForceVertexOutputInvariant=!1,a._AllDirtyCallBack=ze=>ze.markAllAsDirty(),a._ImageProcessingDirtyCallBack=ze=>ze.markAsImageProcessingDirty(),a._TextureDirtyCallBack=ze=>ze.markAsTexturesDirty(),a._FresnelDirtyCallBack=ze=>ze.markAsFresnelDirty(),a._MiscDirtyCallBack=ze=>ze.markAsMiscDirty(),a._PrePassDirtyCallBack=ze=>ze.markAsPrePassDirty(),a._LightsDirtyCallBack=ze=>ze.markAsLightDirty(),a._AttributeDirtyCallBack=ze=>ze.markAsAttributesDirty(),a._FresnelAndMiscDirtyCallBack=ze=>{a._FresnelDirtyCallBack(ze),a._MiscDirtyCallBack(ze)},a._TextureAndMiscDirtyCallBack=ze=>{a._TextureDirtyCallBack(ze),a._MiscDirtyCallBack(ze)},a._DirtyCallbackArray=[],a._RunDirtyCallBacks=ze=>{for(const N of a._DirtyCallbackArray)N(ze)},a})();Object.getOwnPropertyDescriptor(wi.prototype,"pluginManager")||Object.defineProperty(wi.prototype,"pluginManager",mt("Material","pluginManager"));class dh extends wi{get subMaterials(){return this._subMaterials}set subMaterials(e){this._subMaterials=e,this._hookArray(e)}getChildren(){return this.subMaterials}constructor(e,t){super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().addMultiMaterial(this),this.subMaterials=[],this._storeEffectOnSubMeshes=!0}_hookArray(e){const t=e.push;e.push=(...s)=>{const r=t.apply(e,s);return this._markAllSubMeshesAsTexturesDirty(),r};const i=e.splice;e.splice=(s,r)=>{const o=i.call(e,s,r??e.length);return this._markAllSubMeshesAsTexturesDirty(),o}}getSubMaterial(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){return super.getActiveTextures().concat(...this.subMaterials.map(e=>e?e.getActiveTextures():[]))}hasTexture(e){if(super.hasTexture(e))return!0;for(let t=0;t<this.subMaterials.length;t++)if(this.subMaterials[t]?.hasTexture(e))return!0;return!1}getClassName(){return"MultiMaterial"}isReadyForSubMesh(e,t,i){for(let s=0;s<this.subMaterials.length;s++){const r=this.subMaterials[s];if(r){if(r._storeEffectOnSubMeshes){if(!r.isReadyForSubMesh(e,t,i))return!1;continue}if(!r.isReady(e))return!1}}return!0}clone(e,t){const i=new dh(e,this.getScene());for(let s=0;s<this.subMaterials.length;s++){let r;const o=this.subMaterials[s];t&&o?r=o.clone(e+"-"+o.name):r=this.subMaterials[s],i.subMaterials.push(r)}return i}serialize(){const e={};e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,xt&&(e.tags=xt.GetTags(this)),e.materialsUniqueIds=[],e.materials=[];for(let t=0;t<this.subMaterials.length;t++){const i=this.subMaterials[t];
154i?(e.materialsUniqueIds.push(i.uniqueId),e.materials.push(i.id)):(e.materialsUniqueIds.push(null),e.materials.push(null))}return e}dispose(e,t,i){const s=this.getScene();if(!s)return;if(i)for(let o=0;o<this.subMaterials.length;o++){const c=this.subMaterials[o];c&&c.dispose(e,t)}const r=s.multiMaterials.indexOf(this);r>=0&&s.multiMaterials.splice(r,1),super.dispose(e,t)}}class Ke{}Ke.NAME_EFFECTLAYER="EffectLayer";Ke.NAME_LAYER="Layer";Ke.NAME_LENSFLARESYSTEM="LensFlareSystem";Ke.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer";Ke.NAME_PARTICLESYSTEM="ParticleSystem";Ke.NAME_GAMEPAD="Gamepad";Ke.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue";Ke.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer";Ke.NAME_PREPASSRENDERER="PrePassRenderer";Ke.NAME_DEPTHRENDERER="DepthRenderer";Ke.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer";Ke.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager";Ke.NAME_SPRITE="Sprite";Ke.NAME_SUBSURFACE="SubSurface";Ke.NAME_OUTLINERENDERER="Outline";Ke.NAME_PROCEDURALTEXTURE="ProceduralTexture";Ke.NAME_SHADOWGENERATOR="ShadowGenerator";Ke.NAME_OCTREE="Octree";Ke.NAME_PHYSICSENGINE="PhysicsEngine";Ke.NAME_AUDIO="Audio";Ke.NAME_FLUIDRENDERER="FluidRenderer";Ke.NAME_IBLCDFGENERATOR="iblCDFGenerator";Ke.NAME_CLUSTEREDLIGHTING="ClusteredLighting";Ke.STEP_ISREADYFORMESH_EFFECTLAYER=0;Ke.STEP_ISREADYFORMESH_DEPTHRENDERER=1;Ke.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0;Ke.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0;Ke.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0;Ke.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1;Ke.STEP_BEFORECAMERADRAW_PREPASS=0;Ke.STEP_BEFORECAMERADRAW_EFFECTLAYER=1;Ke.STEP_BEFORECAMERADRAW_LAYER=2;Ke.STEP_BEFORERENDERTARGETDRAW_PREPASS=0;Ke.STEP_BEFORERENDERTARGETDRAW_LAYER=1;Ke.STEP_BEFORERENDERINGMESH_PREPASS=0;Ke.STEP_BEFORERENDERINGMESH_OUTLINE=1;Ke.STEP_AFTERRENDERINGMESH_PREPASS=0;Ke.STEP_AFTERRENDERINGMESH_OUTLINE=1;Ke.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0;Ke.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1;Ke.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0;Ke.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0;Ke.STEP_BEFORECLEAR_PREPASS=1;Ke.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0;Ke.STEP_AFTERRENDERTARGETDRAW_PREPASS=0;Ke.STEP_AFTERRENDERTARGETDRAW_LAYER=1;Ke.STEP_AFTERCAMERADRAW_PREPASS=0;Ke.STEP_AFTERCAMERADRAW_EFFECTLAYER=1;Ke.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2;Ke.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3;Ke.STEP_AFTERCAMERADRAW_LAYER=4;Ke.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5;Ke.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0;Ke.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0;Ke.STEP_AFTERRENDER_AUDIO=0;Ke.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0;Ke.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1;Ke.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2;Ke.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3;Ke.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0;Ke.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1;Ke.STEP_GATHERACTIVECAMERARENDERTARGETS_CLUSTEREDLIGHTING=2;Ke.STEP_POINTERMOVE_SPRITE=0;Ke.STEP_POINTERDOWN_SPRITE=0;Ke.STEP_POINTERUP_SPRITE=0;class oi extends Array{constructor(e){super(...e)}static Create(){return Object.create(oi.prototype)}registerStep(e,t,i){let s=0,r;for(;s<this.length&&(r=this[s].index,!(e<r));s++);this.splice(s,0,{index:e,component:t,action:i.bind(t)})}clear(){this.length=0}}class _w{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}var Vb,Gb,Hb,Wb,Xb,qb,jb,Yb,Kb,Zb,Qb,$b,Jb,e0;class C1{}class t0{constructor(){this.batchCache=new i0(this),this.batchCacheReplacementModeInFrozenMode=new i0(this),this.instancesBufferSize=512*4}}class mw{constructor(){this.renderPasses={}}}class i0{constructor(e){this.parent=e,this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=[],this.hardwareInstancedRendering=[]}}class gw{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=512,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class pw{constructor(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}const tn={source:null,parent:null,doNotCloneChildren:!1,clonePhysicsImpostor:!0,cloneThinInstances:!1};class K extends Lt{static _GetDefaultSideOrientation(e){return e||K.FRONTSIDE}get useLODScreenCoverage(){return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(F.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(F.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new Ae),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new Ae),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new Ae),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new Ae),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new Ae),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){return this.instances.length>0}get hasThinInstances(){return(this.forcedInstanceCount||this._thinInstanceDataStorage.
vendor: 15,229 bytes, line 154
154instancesCount||0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&e===1||!this._scene.useRightHandedSystem&&e===0}get _effectiveSideOrientation(){return this._internalMeshDataInfo._effectiveSideOrientation}get overrideMaterialSideOrientation(){return this.sideOrientation}set overrideMaterialSideOrientation(e){this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){e&&(this.material&&this.material.sideOrientation===null||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(e)}get source(){return this._internalMeshDataInfo._source}get cloneMeshMap(){return this._internalMeshDataInfo.meshMap}get isUnIndexed(){return this._unIndexed}set isUnIndexed(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){const e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesData:void 0}get previousWorldMatrixInstancedBuffer(){const e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesPreviousData:void 0}get manualUpdateOfWorldMatrixInstancedBuffer(){return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){this._instanceDataStorage.forceMatrixUpdates=e}_copySource(e,t,i=!0,s=!1){const r=this.getScene();if(e._geometry&&e._geometry.applyToMesh(this),n_.DeepCopy(e,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo","physicsBody","physicsImpostor"],["_poseMatrix"]),this._internalMeshDataInfo._source=e,r.useClonedMeshMap&&(e._internalMeshDataInfo.meshMap||(e._internalMeshDataInfo.meshMap={}),e._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=e._originalBuilderSideOrientation,this._creationDataStorage=e._creationDataStorage,e._ranges){const o=e._ranges;for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&this.createAnimationRange(c,o[c].from,o[c].to)}if(e.metadata&&e.metadata.clone?this.metadata=e.metadata.clone():this.metadata=e.metadata,this._internalMetadata=e._internalMetadata,xt&&xt.HasTags(e)&&xt.AddTagsTo(this,xt.GetTags(e,!0)),this.setEnabled(e.isEnabled(!1)),this.parent=e.parent,this.setPivotMatrix(e.getPivotMatrix(),this._postMultiplyPivotMatrix),this.id=this.name+"."+e.id,this.material=e.material,!t){const o=e.getDescendants(!0);for(let c=0;c<o.length;c++){const h=o[c];h._isMesh?(tn.parent=this,tn.doNotCloneChildren=t,tn.clonePhysicsImpostor=i,tn.cloneThinInstances=s,h.clone(this.name+"."+h.name,tn)):h.clone&&h.clone(this.name+"."+h.name,this)}}if(e.morphTargetManager&&(this.morphTargetManager=e.morphTargetManager),jd(r.getPhysicsEngine)){const o=r.getPhysicsEngine();if(i&&o)if(o.getPluginVersion()===1){const c=o.getImpostorForPhysicsObject(e);c&&(this.physicsImpostor=c.clone(this))}else o.getPluginVersion()===2&&e.physicsBody&&e.physicsBody.clone(this)}for(let o=0;o<r.particleSystems.length;o++){const c=r.particleSystems[o];c.emitter===e&&c.clone(c.name,this)}if(this.skeleton=e.skeleton,s&&(e._thinInstanceDataStorage.matrixData?(this.thinInstanceSetBuffer("matrix",new Float32Array(e._thinInstanceDataStorage.matrixData),16,!e._thinInstanceDataStorage.matrixBuffer.isUpdatable()),this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,this._thinInstanceDataStorage.instancesCount=e._thinInstanceDataStorage.instancesCount):this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,e._userThinInstanceBuffersStorage)){const o=e._userThinInstanceBuffersStorage;for(const c in o.data)this.thinInstanceSetBuffer(c,new Float32Array(o.data[c]),o.strides[c],!o.vertexBuffers?.[c]?.isUpdatable()),this._userThinInstanceBuffersStorage.sizes[c]=o.sizes[c]}this.refreshBoundingInfo(!0,!0),this.computeWorldMatrix(!0)}constructor(e,t=null,i=null,s=null,r,o=!0){super(e,t),this._internalMeshDataInfo=new pw,this.delayLoadState=0,this.instances=[],this._creationDataStorage=null,this._geometry=null,this._thinInstanceDataStorage=new gw,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=K.DEFAULTSIDE,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._instanceDataStorage=new mw,this._instanceDataStorage.engine=t.getEngine(),this._instanceDataStorage.useMonoDataStorageRenderPass=!this._instanceDataStorage.engine.isWebGPU,this._instanceDataStorage.useMonoDataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass=new t0),this._scene.useRightHandedSystem?this.sideOrientation=0:this.sideOrientation=1,this._onBeforeDraw=(f,_,d)=>{f&&d&&(this._uniformBuffer?this.transferToEffect(_):d.bindOnlyWorldMatrix(_))};let c,h=!1;if(i&&i._addToSceneRootNodes===void 0){const f=i;c=f.parent??null,s=f.source??null,r=f.doNotCloneChildren??!1,o=f.clonePhysicsImpostor??!0,h=f.cloneThinInstances??!1}else c=i;s&&this._copySource(s,r,o,h),c!==null&&(this.parent=c),this._instanceDataStorage.hardwareInstancedRendering=this.getEngine().getCaps().instancedArrays,this._internalMeshDataInfo._onMeshReadyObserverAdded=f=>{f.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new Ae(this._internalMeshDataInfo._onMeshReadyObserverAdded),s&&s.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){const s=this.getTotalVertices()===0||t&&t.doNotInstantiate&&(t.doNotInstantiate===!0||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));s.parent=e||this.parent,s.position=this.position.clone(),s.scaling=this.scaling.clone(),this.rotationQuaternion?s.rotationQuaternion=this.rotationQuaternion.clone():s.rotation=this.rotation.clone(),i&&i(this,s);for(const r of this.getChildTransformNodes(!0))r.getClassName()==="InstancedMesh"&&s.getClassName()==="Mesh"&&r.sourceMesh===this?r.instantiateHierarchy(s,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:s},i):r.instantiateHierarchy(s,t,i);return s}getClassName(){return"Mesh"}get _isMesh(){return!0}toString(e){let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);if(e)if(this._geometry){const i=this.getIndices(),s=this.getVerticesData(F.PositionKind);s&&i&&(t+=", flat shading: "+(s.length/3===i.length?"YES":"NO"))}else t+=", flat shading: UNKNOWN";return t}_unBindEffect(){super._unBindEffect();for(const e of this.instances)e._unBindEffect()}get hasLODLevels(){return this._internalMeshDataInfo._LODLevels.length>0}getLODLevels(){return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){const e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=>t.distanceOrScreenCoverage<i.distanceOrScreenCoverage?e:t.distanceOrScreenCoverage>i.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){if(t&&t._masterMesh)return me.Warn("You cannot use a mesh as LOD level twice"),this;const i=new _w(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++){const s=t._LODLevels[i];if(s.distanceOrScreenCoverage===e)return s.mesh}return null}removeLODLevel(e){const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++)t._LODLevels[i].mesh===e&&(t._LODLevels.splice(i,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this}getLOD(e,t){const i=this._internalMeshDataInfo;if(!i._LODLevels||i._LODLevels.length===0)return this;const s=t||this.getBoundingInfo().boundingSphere,r=e.mode===vs.ORTHOGRAPHIC_CAMERA?e.minZ:s.centerWorld.subtract(e.globalPosition).length();let o=r,c=1;if(i._useLODScreenCoverage){const h=e.screenArea;let f=s.radiusWorld*e.minZ/r;f=f*f*Math.PI,o=f/h,c=-1}if(c*i._LODLevels[i._LODLevels.length-1].distanceOrScreenCoverage>c*o)return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,this),this;for(let h=0;h<i._LODLevels.length;h++){const f=i._LODLevels[h];if(c*f.distanceOrScreenCoverage<c*o){if(f.mesh){if(f.mesh.delayLoadState===4)return f.mesh._checkDelayState(),this;if(f.mesh.delayLoadState===2)return this;f.mesh._preActivate(),f.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)}return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,f.mesh),f.mesh}}return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,this),this}get geometry(){return this._geometry}getTotalVertices(){return this._geometry===null||this._geometry===void 0?0:this._geometry.getTotalVertices()}getVerticesData(e,t,i,s){if(!this._geometry)return null;let r=s?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e]?.getFloatData(this.instances.length+1,i||t&&this._geometry.meshes.length!==1);return r||(r=this._geometry.getVerticesData(e,t,i)),r}copyVerticesData(e,t){this._geometry&&this._geometry.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._geometry?(t?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e])??this._geometry.getVertexBuffer(e):null}isVerticesDataPresent(e,t){return this._geometry?!t&&this._userInstancedBuffersStorage?.vertexBuffers[e]!==void 0||this._geometry.isVerticesDataPresent(e):this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1}isVertexBufferUpdatable(e,t){if(!this._geometry)return this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1;if(!t){const i=this._userInstancedBuffersStorage?.vertexBuffers[e];if(i)return i.isUpdatable()}return this._geometry.isVertexBufferUpdatable(e)}getVerticesDataKinds(e){if(!this._geometry){const i=[];if(this._delayInfo)for(const s of this._delayInfo)i.push(s);return i}const t=this._geometry.getVerticesDataKinds();if(!e&&this._userInstancedBuffersStorage)for(const i in this._userInstancedBuffersStorage.vertexBuffers)t.indexOf(i)===-1&&t.push(i);return t}getTotalIndices(){return this._geometry?this._geometry.getTotalIndices():0}getIndices(e,t){return this._geometry?this._geometry.getIndices(e,t):[]}get isBlocked(){return this._masterMesh!==null&&this._masterMesh!==void 0}isReady(e=!1,t=!1){if(this.delayLoadState===2||!super.isReady(e))return!1;if(!this.subMeshes||this.subMeshes.length===0||!e)return!0;const i=this.getEngine(),s=this.getScene(),r=t||i.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();const o=this.material||s.defaultMaterial;if(o){if(o._storeEffectOnSubMeshes)for(const h of this.subMeshes){const f=h.getMaterial();if(f){if(f._storeEffectOnSubMeshes){if(!f.isReadyForSubMesh(this,h,r))return!1}else if(!f.isReady(this,r))return!1}}else if(!o.isReady(this,r))return!1}const c=i.currentRenderPassId;for(const h of this.lightSources){const f=h.getShadowGenerators();if(!f)continue;const _=f.values();for(let d=_.next();d.done!==!0;d=_.next()){const g=d.value;if(g&&(!g.getShadowMap()?.renderList||g.getShadowMap()?.renderList&&g.getShadowMap()?.renderList?.indexOf(this)!==-1)){const x=g.getShadowMap().renderPassIds??[i.currentRenderPassId];for(let b=0;b<x.length;++b){i.currentRenderPassId=x[b];for(const T of this.subMeshes)if(!g.isReady(T,r,T.getMaterial()?.needAlphaBlendingForMesh(this)??!1))return i.currentRenderPassId=c,!1}i.currentRenderPassId=c}}}for(const h of this._internalMeshDataInfo._LODLevels)if(h.mesh&&!h.mesh.isReady(r))return!1;return!0}get areNormalsFrozen(){return this._internalMeshDataInfo._areNormalsFrozen}freezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this}unfreezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this}set overridenInstanceCount(e){this._instanceDataStorage.overridenInstanceCount=e}_getInstanceDataStorage(){if(this._instanceDataStorage.useMonoDataStorageRenderPass)return this._instanceDataStorage.dataStorageRenderPass;const e=this._instanceDataStorage.engine.currentRenderPassId;let t=this._instanceDataStorage.renderPasses[e];return t||(t=new t0,this._instanceDataStorage.renderPasses[e]=t),t}_preActivate(){const e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t?this:(e._preActivateId=t,this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass.visibleInstances=null:this._getInstanceDataStorage().visibleInstances=null,this)}_preActivateForIntermediateRendering(e){const t=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return t.visibleInstances&&(t.visibleInstances.intermediateDefaultRenderId=e),this}_registerInstanceForRenderId(e,t){const i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return i.visibleInstances||(i.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId,intermediateDefaultRenderId:-1}),i.visibleInstances[t]||(i.previousRenderId!==void 0&&(!this._instanceDataStorage.useMonoDataStorageRenderPass||this._instanceDataStorage.
vendor: 5,868 bytes, line 154
154isFrozen)&&delete i.visibleInstances[i.previousRenderId],i.previousRenderId=t,i.visibleInstances[t]=new Array),i.visibleInstances[t].push(e),this}_afterComputeWorldMatrix(){super._afterComputeWorldMatrix(),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))}_postActivate(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getData(i,null,F.PositionKind),s),this}_createGlobalSubMesh(e){const t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){const i=this.getIndices();if(!i)return null;const s=i.length;let r=!1;if(e)r=!0;else for(const o of this.subMeshes){if(o.indexStart+o.indexCount>s){r=!0;break}if(o.verticesStart+o.verticesCount>t){r=!0;break}}if(!r)return this.subMeshes[0]}return this.releaseSubMeshes(),new Ss(0,0,t,0,this.getTotalIndices()||(this.isUnIndexed?t:0),this)}subdivide(e){if(e<1)return;const t=this.getTotalIndices();let i=t/e|0,s=0;for(;i%3!==0;)i++;this.releaseSubMeshes();for(let r=0;r<e&&!(s>=t);r++)Ss.CreateFromIndices(0,s,s+i>=t?t-s:i,this,void 0,!1),s+=i;this.refreshBoundingInfo(),this.synchronizeInstances()}setVerticesData(e,t,i=!1,s){if(this._geometry)this._geometry.setVerticesData(e,t,i,s);else{const r=new Be;r.set(t,e);const o=this.getScene();new Zi(Zi.RandomId(),o,r,i,this)}return this}removeVerticesData(e){this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){const i=this.getVertexBuffer(e);!i||i.isUpdatable()===t||this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0,i=null){return this._geometry||(this._geometry=Zi.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,i,t),this}updateVerticesData(e,t,i,s){return this._geometry?(s?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this}updateMeshPositions(e,t=!0){const i=this.getVerticesData(F.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(F.PositionKind,i,!1,!1),t){const s=this.getIndices(),r=this.getVerticesData(F.NormalKind);if(!r)return this;Be.ComputeNormals(i,s,r),this.updateVerticesData(F.NormalKind,r,!1,!1)}return this}makeGeometryUnique(){if(!this._geometry)return this;if(this._geometry.meshes.length===1)return this;const e=this._geometry,t=this._geometry.copy(Zi.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i,s=null){let r=this._geometry;r||(r=new Zi(Zi.RandomId(),this.getScene(),void 0,void 0,this)),r.setIndexBuffer(e,t,i,s)}setIndices(e,t=null,i=!1,s=!1){if(this._geometry)this._geometry.setIndices(e,t,i,s);else{const r=new Be;r.indices=e;const o=this.getScene();new Zi(Zi.RandomId(),o,r,i,this,t)}return this}updateIndices(e,t,i=!1){return this._geometry?(this._geometry.updateIndices(e,t,i),this):this}toLeftHanded(){return this._geometry?(this._geometry.toLeftHanded(),this):this}_bind(e,t,i,s=!0){if(!this._geometry)return this;const r=this.getScene().getEngine();let o;if(this._unIndexed)switch(this._getRenderingFillMode(i)){case wi.WireFrameFillMode:o=e._getLinesIndexBuffer(this.getIndices(),r);break;default:o=null;break}else switch(this._getRenderingFillMode(i)){case wi.PointFillMode:o=null;break;case wi.WireFrameFillMode:o=e._getLinesIndexBuffer(this.getIndices(),r);break;default:case wi.TriangleFillMode:o=this._geometry.getIndexBuffer();break}return this._bindDirect(t,o,s)}_bindDirect(e,t,i=!0){if(!this._geometry)return this;if(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),!i||!this._userInstancedBuffersStorage||this.hasThinInstances)this._geometry._bind(e,t);else{if(!this._instanceDataStorage.useMonoDataStorageRenderPass&&this._userInstancedBuffersStorage.renderPasses&&this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId]){const s=this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];for(const r in s)this._userInstancedBuffersStorage.vertexBuffers[r]=s[r]}this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);const r=this.getScene().getEngine(),o=r._currentMaterialContext,c=o&&o.useVertexPulling;return this._unIndexed&&t!==wi.WireFrameFillMode||t==wi.PointFillMode?r.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==wi.WireFrameFillMode?r.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):c?r.drawArraysType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i):r.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){const i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();
154if(this._instanceDataStorage.isFrozen){if(t)return i.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,i.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,i.batchCacheReplacementModeInFrozenMode;if(i.previousBatch)return i.previousBatch}const s=this.getScene(),r=s._isInIntermediateRendering(),o=r?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,c=i.batchCache;if(c.mustReturn=!1,c.renderSelf[e]=t||!o&&this.isEnabled()&&this.isVisible,c.visibleInstances[e]=null,i.visibleInstances&&!t){const h=i.visibleInstances,f=s.getRenderId(),_=r?h.intermediateDefaultRenderId:h.defaultRenderId;c.visibleInstances[e]=h[f],!c.visibleInstances[e]&&_&&(c.visibleInstances[e]=h[_])}return c.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&c.visibleInstances[e]!==null&&c.visibleInstances[e]!==void 0,i.previousBatch=c,c}_updateInstancedBuffers(e,t,i,s,r,o){const c=t.visibleInstances[e._id],h=c?c.length:0,f=t.parent,_=this._instanceDataStorage;let d=f.instancesBuffer,g=f.instancesPreviousBuffer,p=0,x=0;const b=t.renderSelf[e._id],T=this._scene.floatingOriginOffset,R=!d||i!==f.instancesBufferSize||this._scene.needsPreviousWorldMatrices&&!f.instancesPreviousBuffer;if(!this._instanceDataStorage.manualUpdate&&(!_.isFrozen||R)){const S=this.getWorldMatrix();if(b){this._scene.needsPreviousWorldMatrices&&(_.masterMeshPreviousWorldMatrix?(_.masterMeshPreviousWorldMatrix.copyToArray(f.instancesPreviousData,p),_.masterMeshPreviousWorldMatrix.copyFrom(S)):(_.masterMeshPreviousWorldMatrix=S.clone(),_.masterMeshPreviousWorldMatrix.copyToArray(f.instancesPreviousData,p))),S.copyToArray(f.instancesData,p);const M=S.asArray();f.instancesData[p+12]=M[12]-T.x,f.instancesData[p+13]=M[13]-T.y,f.instancesData[p+14]=M[14]-T.z,p+=16,x++}if(c){if(K.INSTANCEDMESH_SORT_TRANSPARENT&&this._scene.activeCamera&&e.getMaterial()?.needAlphaBlendingForMesh(e.getRenderingMesh())){const M=this._scene.activeCamera.globalPosition;for(let I=0;I<c.length;I++){const A=c[I];A._distanceToCamera=E.Distance(A.getBoundingInfo().boundingSphere.centerWorld,M)}c.sort((I,A)=>I._distanceToCamera>A._distanceToCamera?-1:I._distanceToCamera<A._distanceToCamera?1:0)}for(let M=0;M<c.length;M++){const I=c[M],A=I.getWorldMatrix();A.copyToArray(f.instancesData,p),this._scene.needsPreviousWorldMatrices&&(I._previousWorldMatrix?(I._previousWorldMatrix.copyToArray(f.instancesPreviousData,p),I._previousWorldMatrix.copyFrom(A)):(I._previousWorldMatrix=A.clone(),I._previousWorldMatrix.copyToArray(f.instancesPreviousData,p)));const D=A.asArray();f.instancesData[p+12]=D[12]-T.x,f.instancesData[p+13]=D[13]-T.y,f.instancesData[p+14]=D[14]-T.z,p+=16,x++}}}else x=(b?1:0)+h;if(R){d&&d.dispose(),g&&g.dispose(),d=new uh(s,f.instancesData,!0,16,!1,!0),f.instancesBuffer=d,this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0});let S;if(this._instanceDataStorage.useMonoDataStorageRenderPass)S=this._userInstancedBuffersStorage.vertexBuffers;else{this._userInstancedBuffersStorage.renderPasses||(this._userInstancedBuffersStorage.renderPasses={});const M=this._instanceDataStorage.engine.currentRenderPassId;S=this._userInstancedBuffersStorage.renderPasses[M],S||(this._userInstancedBuffersStorage.renderPasses[M]=S={})}S.world0=d.createVertexBuffer("world0",0,4),S.world1=d.createVertexBuffer("world1",4,4),S.world2=d.createVertexBuffer("world2",8,4),S.world3=d.createVertexBuffer("world3",12,4),this._scene.needsPreviousWorldMatrices&&(g=new uh(s,f.instancesPreviousData,!0,16,!1,!0),f.instancesPreviousBuffer=g,S.previousWorld0=g.createVertexBuffer("previousWorld0",0,4),S.previousWorld1=g.createVertexBuffer("previousWorld1",4,4),S.previousWorld2=g.createVertexBuffer("previousWorld2",8,4),S.previousWorld3=g.createVertexBuffer("previousWorld3",12,4)),this._invalidateInstanceVertexArrayObject()}else(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&(d.updateDirectly(f.instancesData,0,x),this._scene.needsPreviousWorldMatrices&&(!this._instanceDataStorage.manualUpdate||this._instanceDataStorage.previousManualUpdate)&&g.updateDirectly(f.instancesPreviousData,0,x));this._processInstancedBuffers(c,b),o&&r!==void 0&&(this.getScene()._activeIndices.addCount(e.indexCount*x,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,o,r),this._draw(e,r,x)),this._scene.needsPreviousWorldMatrices&&!R&&this._instanceDataStorage.manualUpdate&&(!this._instanceDataStorage.
vendor: 4,252 bytes, line 154
154isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&!this._instanceDataStorage.previousManualUpdate&&g.updateDirectly(f.instancesData,0,x)}_renderWithInstances(e,t,i,s,r){const o=i.visibleInstances[e._id],c=o?o.length:0,h=i.parent,f=h.instancesBufferSize,d=(c+1)*16*4;for(;h.instancesBufferSize<d;)h.instancesBufferSize*=2;return(!h.instancesData||f!=h.instancesBufferSize)&&(h.instancesData=new Float32Array(h.instancesBufferSize/4)),(this._scene.needsPreviousWorldMatrices&&!h.instancesPreviousData||f!=h.instancesBufferSize)&&(h.instancesPreviousData=new Float32Array(h.instancesBufferSize/4)),this._updateInstancedBuffers(e,i,f,r,t,s),r.unbindInstanceAttributes(),this}_renderWithThinInstances(e,t,i,s){const r=this._thinInstanceDataStorage?.instancesCount??0;this.getScene()._activeIndices.addCount(e.indexCount*r,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,i,t),this._draw(e,t,r),this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&this._thinInstanceDataStorage.matrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,r):this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.matrixData,!1)),s.unbindInstanceAttributes()}_processInstancedBuffers(e,t){}_processRendering(e,t,i,s,r,o,c,h){const f=this.getScene(),_=f.getEngine();if(s=this._getRenderingFillMode(s),o&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,s,i,_),this;if(o)this._renderWithInstances(t,s,r,i,_);else{_._currentDrawContext&&(_._currentDrawContext.useInstancing=!1);let d=0;r.renderSelf[t._id]&&(c&&c(!1,e.getWorldMatrix(),h),d++,this._draw(t,s,this._instanceDataStorage.overridenInstanceCount));const g=r.visibleInstances[t._id];if(g){const p=g.length;d+=p;for(let x=0;x<p;x++){const T=g[x].getWorldMatrix();c&&c(!0,T,h),this._draw(t,s)}}f._activeIndices.addCount(t.indexCount*d,!1)}return this}_disposeInstanceDataStorageRenderPass(e,t=!1){e?.instancesBuffer&&(t&&e.instancesBuffer.dispose(),e.instancesBuffer=null),e?.instancesPreviousBuffer&&(t&&e.instancesPreviousBuffer.dispose(),e.instancesPreviousBuffer=null)}_rebuild(e=!1){for(const t in this._instanceDataStorage.renderPasses){const i=this._instanceDataStorage.renderPasses[t];this._disposeInstanceDataStorageRenderPass(i,e)}if(this._disposeInstanceDataStorageRenderPass(this._instanceDataStorage.dataStorageRenderPass,e),this._userInstancedBuffersStorage){for(const t in this._userInstancedBuffersStorage.vertexBuffers){const i=this._userInstancedBuffersStorage.vertexBuffers[t];i&&(e&&i.dispose(),this._userInstancedBuffersStorage.vertexBuffers[t]=null)}this._userInstancedBuffersStorage.vertexArrayObjects&&(this._userInstancedBuffersStorage.vertexArrayObjects={})}this._internalMeshDataInfo._effectiveMaterial=null,super._rebuild(e)}_releaseRenderPassId(e){const t=this._instanceDataStorage.renderPasses[e];if(t&&(this._disposeInstanceDataStorageRenderPass(t,!0),delete this._instanceDataStorage.renderPasses[e]),this._userInstancedBuffersStorage?.renderPasses){const i=this._userInstancedBuffersStorage.renderPasses[e];if(i)for(const s in i)i[s]?.dispose();delete this._userInstancedBuffersStorage.renderPasses[e]}}_freeze(){if(this.subMeshes){for(let e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._internalMeshDataInfo._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}}_unFreeze(){this._instanceDataStorage.isFrozen=!1;for(const e in this._instanceDataStorage.renderPasses){const t=this._instanceDataStorage.renderPasses[e];t.previousBatch=null}this._instanceDataStorage.dataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass.previousBatch=null)}renderWithRenderPassId(e,t,i,s,r=!0){const o=this._scene.getEngine(),c=o.currentRenderPassId;if(e!==void 0&&(o.currentRenderPassId=e),s)(!r||r&&s.isInFrustum(this._scene._frustumPlanes))&&this.render(s,!!t,i);else for(let h=0;h<this.subMeshes.length;h++){const f=this.subMeshes[h];(!r||r&&f.isInFrustum(this._scene._frustumPlanes))&&this.render(f,!!t,i)}return e!==void 0&&(o.currentRenderPassId=c),this}
vendor: 30,451 bytes, lines 154-161
154directRender(){if(!this.subMeshes)return this;for(const e of this.subMeshes)this.render(e,!1);return this}render(e,t,i){const s=this.getScene(),r=s.getEngine();this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1;const o=s.activeCameras?.length??0,c=o>1&&s.activeCamera===s.activeCameras[0]||o<=1,h=this._occlusionDataStorage&&this._occlusionDataStorage.occlusionForRenderPassId!==-1&&this._occlusionDataStorage.occlusionForRenderPassId!==r.currentRenderPassId;if(c&&this._checkOcclusionQuery(h)&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;const f=this._getInstancesRenderList(e._id,!!i);if(f.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let _=0,d=null;this.ignoreCameraMaxZ&&s.activeCamera&&!s._isInIntermediateRendering()&&(_=s.activeCamera.maxZ,d=s.activeCamera,s.activeCamera.maxZ=0,s.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);const g=e.getRenderingMesh(),p=f.hardwareInstancedRendering[e._id]||g.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,x=this._instanceDataStorage,b=e.getMaterial();if(!b)return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;if(!x.isFrozen||!this._internalMeshDataInfo._effectiveMaterial||this._internalMeshDataInfo._effectiveMaterial!==b){if(b._storeEffectOnSubMeshes){if(!b.isReadyForSubMesh(this,e,p))return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this}else if(!b.isReady(this,p))return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=b}else if(b._storeEffectOnSubMeshes&&!e._drawWrapper?._wasPreviouslyReady||!b._storeEffectOnSubMeshes&&!b._getDrawWrapper()._wasPreviouslyReady)return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;if(t){const k=this._internalMeshDataInfo._effectiveMaterial;if(k.alphaModes.length===1)r.setAlphaMode(k.alphaMode);else for(let H=0;H<k.alphaModes.length;H++){const L=k.alphaModes[H];r.setAlphaMode(L!==void 0?L:2,!1,H)}}let T;this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?T=e._drawWrapper:T=this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();const R=T?.effect??null;for(const k of s._beforeRenderingMeshStage)k.action(this,e,f,R);if(!T||!R)return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;const S=i||this;let M;if(!x.isFrozen&&(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling||this._internalMeshDataInfo._effectiveMaterial.sideOrientation!==null||this._internalMeshDataInfo._effectiveMaterial._twoSidedLighting)){const k=S._getWorldMatrixDeterminant();M=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),k<0&&(M=M===wi.ClockWiseSideOrientation?wi.CounterClockWiseSideOrientation:wi.ClockWiseSideOrientation),this._internalMeshDataInfo._effectiveSideOrientation=M}const I=this._internalMeshDataInfo._effectiveMaterial._preBind(T,this._internalMeshDataInfo._effectiveSideOrientation);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&r.setDepthWrite(!0);const A=this._internalMeshDataInfo._effectiveMaterial,D=A.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),p||this._bind(e,R,D,!1);const C=S.getWorldMatrix();A._storeEffectOnSubMeshes?A.bindForSubMesh(C,this,e):A.bind(C,this),!A.backFaceCulling&&A.separateCullingPass&&(r.setState(!0,A.zOffset,!1,!I,A.cullBackFaces,A.stencil,A.zOffsetUnits),this._processRendering(this,e,R,D,f,p,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),r.setState(!0,A.zOffset,!1,I,A.cullBackFaces,A.stencil,A.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,R,D,f,p,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind();for(const k of s._afterRenderingMeshStage)k.action(this,e,f,R);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),d&&(d.maxZ=_,s.updateTransformMatrix(!0)),s.performancePriority===2&&!x.isFrozen&&this._freeze(),this}cleanMatrixWeights(){this.isVerticesDataPresent(F.MatricesWeightsKind)&&(this.isVerticesDataPresent(F.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){const e=this.getVerticesData(F.MatricesWeightsKind),t=e.length;for(let i=0;i<t;i+=4){const s=e[i]+e[i+1]+e[i+2]+e[i+3];if(s===0)e[i]=1;else{const r=1/s;e[i]*=r,e[i+1]*=r,e[i+2]*=r,e[i+3]*=r}}this.setVerticesData(F.MatricesWeightsKind,e)}_normalizeSkinWeightsAndExtra(){const e=this.getVerticesData(F.MatricesWeightsExtraKind),t=this.getVerticesData(F.MatricesWeightsKind),i=t.length;for(let s=0;s<i;s+=4){let r=t[s]+t[s+1]+t[s+2]+t[s+3];if(r+=e[s]+e[s+1]+e[s+2]+e[s+3],r===0)t[s]=1;else{const o=1/r;t[s]*=o,t[s+1]*=o,t[s+2]*=o,t[s+3]*=o,e[s]*=o,e[s+1]*=o,e[s+2]*=o,e[s+3]*=o}}this.setVerticesData(F.MatricesWeightsKind,t),this.setVerticesData(F.MatricesWeightsKind,e)}validateSkinning(){const e=this.getVerticesData(F.MatricesWeightsExtraKind),t=this.getVerticesData(F.MatricesWeightsKind);if(t===null||this.skeleton==null)return{skinned:!1,valid:!0,report:"not skinned"};const i=t.length;let s=0,r=0,o=0,c=0;const h=e===null?4:8,f=[];for(let T=0;T<=h;T++)f[T]=0;const _=.001;for(let T=0;T<i;T+=4){let R=t[T],S=R,M=S===0?0:1;for(let I=1;I<h;I++){const A=I<4?t[T+I]:e[T+I-4];A>R&&s++,A!==0&&M++,S+=A,R=A}if(f[M]++,M>o&&(o=M),S===0)r++;else{const I=1/S;let A=0;for(let D=0;D<h;D++)D<4?A+=Math.abs(t[T+D]-t[T+D]*I):A+=Math.abs(e[T+D-4]-e[T+D-4]*I);A>_&&c++}}const d=this.skeleton.bones.length,g=this.getVerticesData(F.MatricesIndicesKind),p=this.getVerticesData(F.MatricesIndicesExtraKind);let x=0;for(let T=0;T<i;T+=4)for(let R=0;R<h;R++){const S=R<4?g[T+R]:p[T+R-4];(S>=d||S<0)&&x++}const b="Number of Weights = "+i/4+`
155Maximum influences = `+o+`
156Missing Weights = `+r+`
157Not Sorted = `+s+`
158Not Normalized = `+c+`
159WeightCounts = [`+f+`]
160Number of bones = `+d+`
161Bad Bone Indices = `+x;return{skinned:!0,valid:r===0&&c===0&&x===0,report:b}}_checkDelayState(){const e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===4&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){e.addPendingData(this);const t=this.delayLoadingFile.indexOf(".babylonbinarymeshdata")!==-1;return(async()=>{try{const i=await e._loadDelayedFileAsync(this.delayLoadingFile,t,!0);i instanceof ArrayBuffer?this._delayLoadingFunction(i,this):this._delayLoadingFunction(JSON.parse(i),this);for(const s of this.instances)s.refreshBoundingInfo(),s._syncSubMeshes();this.delayLoadState=1,e.removePendingData(this)}catch(i){e.removePendingData(this),e.isDisposed||me.Error(`Unable to delay load geometry data for mesh "${this.name}" from "${this.delayLoadingFile}": ${i}`)}})(),this}isInFrustum(e){return this.delayLoadState===2||!super.isInFrustum(e)?!1:(this._checkDelayState(),!0)}setMaterialById(e){const t=this.getScene().materials;let i;for(i=t.length-1;i>-1;i--)if(t[i].id===e)return this.material=t[i],this;const s=this.getScene().multiMaterials;for(i=s.length-1;i>-1;i--)if(s[i].id===e)return this.material=s[i],this;return this}getAnimatables(){const e=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){if(!this.isVerticesDataPresent(F.PositionKind))return this;const t=this.subMeshes.splice(0);this._resetPointsArrayCache();let i=this.getVerticesData(F.PositionKind);const s=E.Zero();let r;for(r=0;r<i.length;r+=3)E.TransformCoordinatesFromFloatsToRef(i[r],i[r+1],i[r+2],e,s).toArray(i,r);if(this.setVerticesData(F.PositionKind,i,this.getVertexBuffer(F.PositionKind).isUpdatable()),this.isVerticesDataPresent(F.NormalKind)){for(i=this.getVerticesData(F.NormalKind),r=0;r<i.length;r+=3)E.TransformNormalFromFloatsToRef(i[r],i[r+1],i[r+2],e,s).normalize().toArray(i,r);this.setVerticesData(F.NormalKind,i,this.getVertexBuffer(F.NormalKind).isUpdatable())}if(this.isVerticesDataPresent(F.TangentKind)){for(i=this.getVerticesData(F.TangentKind),r=0;r<i.length;r+=4)E.TransformNormalFromFloatsToRef(i[r],i[r+1],i[r+2],e,s).normalize().toArray(i,r);this.setVerticesData(F.TangentKind,i,this.getVertexBuffer(F.TangentKind).isUpdatable())}return e.determinant()<0&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=t,this}bakeCurrentTransformIntoVertices(e=!0,t=!1){return t&&this.makeGeometryUnique(),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this}get _positions(){return this._internalAbstractMeshDataInfo._positions||this._geometry&&this._geometry._positions||null}_resetPointsArrayCache(){return this._geometry&&this._geometry._resetPointsArrayCache(),this}_generatePointsArray(){return this._geometry?this._geometry._generatePointsArray():!1}clone(e="",t=null,i,s=!0){if(t&&t._addToSceneRootNodes===void 0){const r=t;return tn.source=this,tn.doNotCloneChildren=r.doNotCloneChildren,tn.clonePhysicsImpostor=r.clonePhysicsImpostor,tn.cloneThinInstances=r.cloneThinInstances,new K(e,this.getScene(),tn)}return new K(e,this.getScene(),t,this,i,s)}dispose(e,t=!1){this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);const i=this._internalMeshDataInfo;if(i._onBeforeDrawObservable&&i._onBeforeDrawObservable.clear(),i._onBeforeBindObservable&&i._onBeforeBindObservable.clear(),i._onBeforeRenderObservable&&i._onBeforeRenderObservable.clear(),i._onAfterRenderObservable&&i._onAfterRenderObservable.clear(),i._onBetweenPassObservable&&i._onBetweenPassObservable.clear(),this._scene.useClonedMeshMap){if(i.meshMap)for(const s in i.meshMap){const r=i.meshMap[s];r&&(r._internalMeshDataInfo._source=null,i.meshMap[s]=void 0)}i._source&&i._source._internalMeshDataInfo.meshMap&&(i._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else{const s=this.getScene().meshes;for(const r of s){const o=r;o._internalMeshDataInfo&&o._internalMeshDataInfo._source&&o._internalMeshDataInfo._source===this&&(o._internalMeshDataInfo._source=null)}}i._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),this._internalMeshDataInfo._checkReadinessObserver&&this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),super.dispose(e,t)}_disposeInstanceSpecificData(){}_disposeThinInstanceSpecificData(){}_invalidateInstanceVertexArrayObject(){}applyDisplacementMap(e,t,i,s,r,o,c=!1,h){const f=this.getScene();return lh(e,d=>{const g=d.width,p=d.height,b=this.getEngine().createCanvas(g,p).getContext("2d");b.drawImage(d,0,0);const T=b.getImageData(0,0,g,p).data;this.applyDisplacementMapFromBuffer(T,g,p,t,i,r,o,c),s&&s(this)},h||(()=>{}),f.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,r,o,c,h=!1){if(!this.isVerticesDataPresent(F.PositionKind)||!this.isVerticesDataPresent(F.NormalKind)||!this.isVerticesDataPresent(F.UVKind))return me.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;const f=this.getVerticesData(F.PositionKind,!0,!0),_=this.getVerticesData(F.NormalKind),d=this.getVerticesData(F.UVKind);let g=E.Zero();const p=E.Zero(),x=Ue.Zero();o=o||Ue.Zero(),c=c||new Ue(1,1);for(let b=0;b<f.length;b+=3){E.FromArrayToRef(f,b,g),E.FromArrayToRef(_,b,p),Ue.FromArrayToRef(d,b/3*2,x);const T=Math.abs(x.x*c.x+o.x%1)*(t-1)%t|0,R=Math.abs(x.y*c.y+o.y%1)*(i-1)%i|0,S=(T+R*t)*4,M=e[S]/255,I=e[S+1]/255,A=e[S+2]/255,D=M*.3+I*.59+A*.11;p.normalize(),p.scaleInPlace(s+(r-s)*D),g=g.add(p),g.toArray(f,b)}return Be.ComputeNormals(f,this.getIndices(),_),h?(this.setVerticesData(F.PositionKind,f),this.setVerticesData(F.NormalKind,_),this.setVerticesData(F.UVKind,d)):(this.updateVerticesData(F.PositionKind,f),this.updateVerticesData(F.NormalKind,_)),this}_getFlattenedNormals(e,t){const i=new Float32Array(e.length*3);let s=0;const r=this.sideOrientation===(this._scene.useRightHandedSystem?1:0);for(let o=0;o<e.length;o+=3){const c=E.FromArray(t,e[o]*3),h=E.FromArray(t,e[o+1]*3),f=E.FromArray(t,e[o+2]*3),_=c.subtract(h),d=f.subtract(h),g=E.Normalize(E.Cross(_,d));r&&g.scaleInPlace(-1);for(let p=0;p<3;p++)i[s++]=g.x,i[s++]=g.y,i[s++]=g.z}return i}_convertToUnIndexedMesh(e=!1){const t=this.getVerticesDataKinds().filter(h=>!this.getVertexBuffer(h)?.getIsInstanced()),i=this.getIndices(!1,!0),s={},r=(h,f)=>{const _=new Float32Array(i.length*f);let d=0;for(let g=0;g<i.length;g++)for(let p=0;p<f;p++)_[d++]=h[i[g]*f+p];return _},o=this.getBoundingInfo(),c=this.geometry?this.subMeshes.slice(0):[];for(const h of t)s[h]=this.getVerticesData(h);for(const h of t){const f=this.getVertexBuffer(h),_=f.getSize();if(e&&h===F.NormalKind){const d=this._getFlattenedNormals(i,s[F.PositionKind]);this.setVerticesData(F.NormalKind,d,f.isUpdatable(),_)}else this.setVerticesData(h,r(s[h],_),f.isUpdatable(),_)}if(this.morphTargetManager){for(let h=0;h<this.morphTargetManager.numTargets;h++){const f=this.morphTargetManager.getTarget(h),_=f.getPositions();f.setPositions(r(_,3));const d=f.getNormals();d&&f.setNormals(e?this._getFlattenedNormals(i,_):r(d,3));const g=f.getTangents();g&&f.setTangents(r(g,3));const p=f.getUVs();p&&f.setUVs(r(p,2));const x=f.getColors();x&&f.setColors(r(x,4))}this.morphTargetManager.synchronize()}for(let h=0;h<i.length;h++)i[h]=h;this.setIndices(i),this._unIndexed=!0,this.releaseSubMeshes();for(const h of c){const f=h.getBoundingInfo();Ss.AddToMesh(h.materialIndex,h.indexStart,h.indexCount,h.indexStart,h.indexCount,this).setBoundingInfo(f)}return this.setBoundingInfo(o),this.synchronizeInstances(),this}convertToFlatShadedMesh(){return this._convertToUnIndexedMesh(!0)}convertToUnIndexedMesh(){return this._convertToUnIndexedMesh()}flipFaces(e=!1){const t=Be.ExtractFromMesh(this);let i;if(e&&this.isVerticesDataPresent(F.NormalKind)&&t.normals){for(i=0;i<t.normals.length;i++)t.normals[i]*=-1;this.setVerticesData(F.NormalKind,t.normals,this.isVertexBufferUpdatable(F.NormalKind))}if(t.indices){let s;for(i=0;i<t.indices.length;i+=3)s=t.indices[i+1],t.indices[i+1]=t.indices[i+2],t.indices[i+2]=s;this.setIndices(t.indices,null,this.isVertexBufferUpdatable(F.PositionKind),!0)}return this}increaseVertices(e=1){const t=Be.ExtractFromMesh(this),i=t.indices&&!Array.isArray(t.indices)&&Array.from?Array.from(t.indices):t.indices,s=t.positions&&!Array.isArray(t.positions)&&Array.from?Array.from(t.positions):t.positions,r=t.uvs&&!Array.isArray(t.uvs)&&Array.from?Array.from(t.uvs):t.uvs,o=t.normals&&!Array.isArray(t.normals)&&Array.from?Array.from(t.normals):t.normals;if(!i||!s)me.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions");else{t.indices=i,t.positions=s,r&&(t.uvs=r),o&&(t.normals=o);const c=e+1,h=[];for(let A=0;A<c+1;A++)h[A]=[];let f,_;const d=new E(0,0,0),g=new E(0,0,0),p=new Ue(0,0),x=[],b=[],T=[];let R,S=s.length,M;r&&(M=r.length);let I;o&&(I=o.length);for(let A=0;A<i.length;A+=3){b[0]=i[A],b[1]=i[A+1],b[2]=i[A+2];for(let D=0;D<3;D++)if(f=b[D],_=b[(D+1)%3],T[f]===void 0&&T[_]===void 0?(T[f]=[],T[_]=[]):(T[f]===void 0&&(T[f]=[]),T[_]===void 0&&(T[_]=[])),T[f][_]===void 0&&T[_][f]===void 0){T[f][_]=[],d.x=(s[3*_]-s[3*f])/c,d.y=(s[3*_+1]-s[3*f+1])/c,d.z=(s[3*_+2]-s[3*f+2])/c,o&&(g.x=(o[3*_]-o[3*f])/c,g.y=(o[3*_+1]-o[3*f+1])/c,g.z=(o[3*_+2]-o[3*f+2])/c),r&&(p.x=(r[2*_]-r[2*f])/c,p.y=(r[2*_+1]-r[2*f+1])/c),T[f][_].push(f);for(let C=1;C<c;C++)T[f][_].push(s.length/3),s[S++]=s[3*f]+C*d.x,s[S++]=s[3*f+1]+C*d.y,s[S++]=s[3*f+2]+C*d.z,o&&(o[I++]=o[3*f]+C*g.x,o[I++]=o[3*f+1]+C*g.y,o[I++]=o[3*f+2]+C*g.z),r&&(r[M++]=r[2*f]+C*p.x,r[M++]=r[2*f+1]+C*p.y);T[f][_].push(_),T[_][f]=[],R=T[f][_].length;for(let C=0;C<R;C++)T[_][f][C]=T[f][_][R-1-C]}h[0][0]=i[A],h[1][0]=T[i[A]][i[A+1]][1],h[1][1]=T[i[A]][i[A+2]][1];for(let D=2;D<c;D++){h[D][0]=T[i[A]][i[A+1]][D],h[D][D]=T[i[A]][i[A+2]][D],d.x=(s[3*h[D][D]]-s[3*h[D][0]])/D,d.y=(s[3*h[D][D]+1]-s[3*h[D][0]+1])/D,d.z=(s[3*h[D][D]+2]-s[3*h[D][0]+2])/D,o&&(g.x=(o[3*h[D][D]]-o[3*h[D][0]])/D,g.y=(o[3*h[D][D]+1]-o[3*h[D][0]+1])/D,g.z=(o[3*h[D][D]+2]-o[3*h[D][0]+2])/D),r&&(p.x=(r[2*h[D][D]]-r[2*h[D][0]])/D,p.y=(r[2*h[D][D]+1]-r[2*h[D][0]+1])/D);for(let C=1;C<D;C++)h[D][C]=s.length/3,s[S++]=s[3*h[D][0]]+C*d.x,s[S++]=s[3*h[D][0]+1]+C*d.y,s[S++]=s[3*h[D][0]+2]+C*d.z,o&&(o[I++]=o[3*h[D][0]]+C*g.x,o[I++]=o[3*h[D][0]+1]+C*g.y,o[I++]=o[3*h[D][0]+2]+C*g.z),r&&(r[M++]=r[2*h[D][0]]+C*p.x,r[M++]=r[2*h[D][0]+1]+C*p.y)}h[c]=T[i[A+1]][i[A+2]],x.push(h[0][0],h[1][0],h[1][1]);for(let D=1;D<c;D++){let C;for(C=0;C<D;C++)x.push(h[D][C],h[D+1][C],h[D+1][C+1]),x.push(h[D][C],h[D+1][C+1],h[D][C+1]);x.push(h[D][C],h[D+1][C],h[D+1][C+1])}}t.indices=x,t.applyToMesh(this,this.isVertexBufferUpdatable(F.PositionKind))}}forceSharedVertices(){const e=Be.ExtractFromMesh(this),t=e.uvs,i=e.indices,s=e.positions,r=e.colors,o=e.matricesIndices,c=e.matricesWeights,h=e.matricesIndicesExtra,f=e.matricesWeightsExtra;if(i===void 0||s===void 0||i===null||s===null)me.Warn("VertexData contains empty entries");else{const _=[],d=[],g=[],p=[],x=[],b=[],T=[],R=[];let S,M=0;const I={};let A,D;for(let k=0;k<i.length;k+=3){D=[i[k],i[k+1],i[k+2]],S=[];for(let H=0;H<3;H++){S[H]="";for(let L=0;L<3;L++)Math.abs(s[3*D[H]+L])<1e-8&&(s[3*D[H]+L]=0),S[H]+=s[3*D[H]+L]+"|"}if(!(S[0]==S[1]||S[0]==S[2]||S[1]==S[2]))for(let H=0;H<3;H++){if(A=I[S[H]],A===void 0){I[S[H]]=M,A=M++;for(let L=0;L<3;L++)_.push(s[3*D[H]+L]);if(r!=null)for(let L=0;L<4;L++)p.push(r[4*D[H]+L]);if(t!=null)for(let L=0;L<2;L++)g.push(t[2*D[H]+L]);if(o!=null)for(let L=0;L<4;L++)x.push(o[4*D[H]+L]);if(c!=null)for(let L=0;L<4;L++)b.push(c[4*D[H]+L]);if(h!=null)for(let L=0;L<4;L++)T.push(h[4*D[H]+L]);if(f!=null)for(let L=0;L<4;L++)R.push(f[4*D[H]+L])}d.push(A)}}const C=[];Be.ComputeNormals(_,d,C),e.positions=_,e.indices=d,e.normals=C,t!=null&&(e.uvs=g),r!=null&&(e.colors=p),o!=null&&(e.matricesIndices=x),c!=null&&(e.matricesWeights=b),h!=null&&(e.matricesIndicesExtra=T),c!=null&&(e.matricesWeightsExtra=R),e.applyToMesh(this,this.isVertexBufferUpdatable(F.PositionKind))}}static _instancedMeshFactory(e,t){throw je("InstancedMesh")}static _PhysicsImpostorParser(e,t,i){throw je("PhysicsImpostor")}createInstance(e){const t=K._instancedMeshFactory(e,this);return t.parent=this.parent,t}synchronizeInstances(){for(let e=0;e<this.instances.length;e++)this.instances[e]._syncSubMeshes();return this}optimizeIndices(e){const t=this.getIndices(),i=this.getVerticesData(F.PositionKind);if(!i||!t)return this;const s=[];for(let o=0;o<i.length;o=o+3)s.push(E.FromArray(i,o));const r=[];return hh.SyncAsyncForLoop(s.length,40,o=>{const c=s.length-1-o,h=s[c];for(let f=0;f<c;++f){const _=s[f];if(h.equals(_)){r[c]=f;break}}},()=>{for(let c=0;c<t.length;++c)t[c]=r[t[c]]||t[c];const o=this.subMeshes.slice(0);this.setIndices(t),this.subMeshes=o,e&&e(this)}),this}serialize(e={}){e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),xt&&xt.HasTags(this)&&(e.tags=xt.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.alwaysSelectAsActiveMesh=this.alwaysSelectAsActiveMesh,e.checkCollisions=this.checkCollisions,e.ellipsoid=this.ellipsoid.asArray(),e.ellipsoidOffset=this.ellipsoidOffset.asArray(),e.doNotSyncBoundingInfo=this.doNotSyncBoundingInfo,e.isBlocker=this.isBlocker,e.sideOrientation=this.sideOrientation,this._isWorldMatrixFrozen&&(e.freezeWorldMatrix=!0),this.parent&&this.parent._serializeAsParent(e),e.isUnIndexed=this.isUnIndexed;const t=this._geometry;if(t&&this.subMeshes){e.geometryUniqueId=t.uniqueId,e.geometryId=t.id,e.subMeshes=[];for(let i=0;i<this.subMeshes.length;i++){const s=this.subMeshes[i];e.subMeshes.push({materialIndex:s.materialIndex,verticesStart:s.verticesStart,verticesCount:s.verticesCount,indexStart:s.indexStart,indexCount:s.indexCount})}}if(this.material?this.material.doNotSerialize||(e.materialUniqueId=this.material.uniqueId,e.materialId=this.material.id):(this.material=null,e.materialUniqueId=this._scene.defaultMaterial.uniqueId,e.materialId=this._scene.defaultMaterial.id),this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id,e.skeletonUniqueId=this.skeleton.uniqueId,e.numBoneInfluencers=this.numBoneInfluencers),this.getScene()._getComponent(Ke.NAME_PHYSICSENGINE)){const i=this.getPhysicsImpostor?.();i&&(e.physicsMass=i.getParam("mass"),e.physicsFriction=i.getParam("friction"),e.physicsRestitution=i.getParam("mass"),e.physicsImpostor=i.type)}this.metadata&&(e.metadata=this.metadata),e.instances=[];for(let i=0;i<this.instances.length;i++){const s=this.instances[i];if(s.doNotSerialize)continue;const r={name:s.name,id:s.id,isEnabled:s.isEnabled(!1),isVisible:s.isVisible,isPickable:s.isPickable,checkCollisions:s.checkCollisions,position:s.position.asArray(),scaling:s.scaling.asArray()};if(s.parent&&s.parent._serializeAsParent(r),s.rotationQuaternion?r.rotationQuaternion=s.rotationQuaternion.asArray():s.rotation&&(r.rotation=s.rotation.asArray()),this.getScene()._getComponent(Ke.NAME_PHYSICSENGINE)){const o=s.getPhysicsImpostor?.();o&&(r.physicsMass=o.getParam("mass"),r.physicsFriction=o.getParam("friction"),r.physicsRestitution=o.getParam("mass"),r.physicsImpostor=o.type)}s.metadata&&(r.metadata=s.metadata),s.actionManager&&(r.actions=s.actionManager.serialize(s.name)),e.instances.push(r),Rt.AppendSerializedAnimations(s,r),r.ranges=s.serializeAnimationRanges()}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:Array.from(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize,enablePicking:this.thinInstanceEnablePicking},this._userThinInstanceBuffersStorage)){const i={data:{},sizes:{},strides:{}};for(const s in this._userThinInstanceBuffersStorage.data)i.data[s]=Array.from(this._userThinInstanceBuffersStorage.data[s]),i.sizes[s]=this._userThinInstanceBuffersStorage.sizes[s],i.strides[s]=this._userThinInstanceBuffersStorage.strides[s];e.thinInstances.userThinInstance=i}return Rt.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name)),e}_syncGeometryWithMorphTargetManager(){if(!this.geometry)return;this._markSubMeshesAsAttributesDirty();const e=this._internalAbstractMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices()){me.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),this.morphTargetManager=null;return}if(e.isUsingTextureForTargets)return;for(let t=0;t<e.numInfluencers;t++){const i=e.getActiveTarget(t),s=i.getPositions();if(!s){me.Error("Invalid morph target. Target must have positions.");return}this.geometry.setVerticesData(F.PositionKind+t,s,!1,3);const r=i.getNormals();r&&this.geometry.setVerticesData(F.NormalKind+t,r,!1,3);const o=i.getTangents();o&&this.geometry.setVerticesData(F.TangentKind+t,o,!1,3);const c=i.getUVs();c&&this.geometry.setVerticesData(F.UVKind+"_"+t,c,!1,2);const h=i.getUV2s();h&&this.geometry.setVerticesData(F.UV2Kind+"_"+t,h,!1,2);const f=i.getColors();f&&this.geometry.setVerticesData(F.ColorKind+t,f,!1,4)}}else{let t=0;for(;this.geometry.isVerticesDataPresent(F.PositionKind+t);)this.geometry.removeVerticesData(F.PositionKind+t),this.geometry.isVerticesDataPresent(F.NormalKind+t)&&this.geometry.removeVerticesData(F.NormalKind+t),this.geometry.isVerticesDataPresent(F.TangentKind+t)&&this.geometry.removeVerticesData(F.TangentKind+t),this.geometry.isVerticesDataPresent(F.UVKind+t)&&this.geometry.removeVerticesData(F.UVKind+"_"+t),this.geometry.isVerticesDataPresent(F.UV2Kind+t)&&this.geometry.removeVerticesData(F.UV2Kind+"_"+t),this.geometry.isVerticesDataPresent(F.ColorKind+t)&&this.geometry.removeVerticesData(F.ColorKind+t),t++}}static Parse(e,t,i){let s,r=!1;if(e.type&&e.type==="LinesMesh"?s=K._LinesMeshParser(e,t):e.type&&e.type==="GroundMesh"?s=K._GroundMeshParser(e,t):e.type&&e.type==="GoldbergMesh"?s=K._GoldbergMeshParser(e,t):e.type&&e.type==="GreasedLineMesh"?s=K._GreasedLineMeshParser(e,t):e.type&&e.type==="TrailMesh"?s=K._TrailMeshParser(e,t):e.type&&e.type==="GaussianSplattingMesh"?(e._isCompound?s=K._GaussianSplattingCompoundMeshParser(e,t):s=K._GaussianSplattingMeshParser(e,t),r=!0):e.type&&e.type==="GaussianSplattingPartProxyMesh"?(s=K._GaussianSplattingPartProxyMeshParser(e,t),r=!0):s=new K(e.name,t),s.id=e.id,s._waitingParsedUniqueId=e.uniqueId,xt&&xt.AddTagsTo(s,e.tags),s.position=E.FromArray(e.position),e.metadata!==void 0&&(s.metadata=e.metadata),e.rotationQuaternion?s.rotationQuaternion=Oe.FromArray(e.rotationQuaternion):e.rotation&&(s.rotation=E.FromArray(e.rotation)),s.scaling=E.FromArray(e.scaling),e.localMatrix?s.setPreTransformMatrix(se.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(se.FromArray(e.pivotMatrix)),s.setEnabled(e.isEnabled),s.isVisible=e.isVisible,s.infiniteDistance=e.infiniteDistance,s.alwaysSelectAsActiveMesh=!!e.alwaysSelectAsActiveMesh,s.showBoundingBox=e.showBoundingBox,s.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,e.applyFog!==void 0&&(s.applyFog=e.applyFog),e.pickable!==void 0&&(s.isPickable=e.pickable),e.alphaIndex!==void 0&&(s.alphaIndex=e.alphaIndex),s.receiveShadows=e.receiveShadows,e.billboardMode!==void 0&&(s.billboardMode=e.billboardMode),e.visibility!==void 0&&(s.visibility=e.visibility),s.checkCollisions=e.checkCollisions,s.doNotSyncBoundingInfo=!!e.doNotSyncBoundingInfo,e.ellipsoid&&(s.ellipsoid=E.FromArray(e.ellipsoid)),e.ellipsoidOffset&&(s.ellipsoidOffset=E.FromArray(e.ellipsoidOffset)),e.overrideMaterialSideOrientation!=null&&(s.sideOrientation=e.overrideMaterialSideOrientation),e.sideOrientation!==void 0&&(s.sideOrientation=e.sideOrientation),e.isBlocker!==void 0&&(s.isBlocker=e.isBlocker),s._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(s._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),e.parentId!==void 0&&(s._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),e.actions!==void 0&&(s._waitingData.actions=e.actions),e.overlayAlpha!==void 0&&(s.overlayAlpha=e.overlayAlpha),e.overlayColor!==void 0&&(s.overlayColor=lt.FromArray(e.overlayColor)),e.renderOverlay!==void 0&&(s.renderOverlay=e.renderOverlay),s.isUnIndexed=!!e.isUnIndexed,s.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s.buildBoundingInfo(E.FromArray(e.boundingBoxMinimum),E.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(s._binaryInfo=e._binaryInfo),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(F.UVKind),e.hasUVs2&&s._delayInfo.push(F.UV2Kind),e.hasUVs3&&s._delayInfo.push(F.UV3Kind),e.hasUVs4&&s._delayInfo.push(F.UV4Kind),e.hasUVs5&&s._delayInfo.push(F.UV5Kind),e.hasUVs6&&s._delayInfo.push(F.UV6Kind),e.hasColors&&s._delayInfo.push(F.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(F.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(F.MatricesWeightsKind),s._delayLoadingFunction=Zi._ImportGeometry,es.ForceFullSceneLoadingForIncremental&&s._checkDelayState()):r||Zi._ImportGeometry(e,s),e.materialUniqueId?s._waitingMaterialId=e.materialUniqueId:e.materialId&&(s._waitingMaterialId=e.materialId),e.morphTargetManagerId>-1&&(s._waitingMorphTargetManagerId=e.morphTargetManagerId),e.skeletonId!==void 0&&e.skeletonId!==null&&(s.skeleton=t.getLastSkeletonById(e.skeletonId),s._waitingSkeletonId=e.skeletonId,e.numBoneInfluencers&&(s.numBoneInfluencers=e.numBoneInfluencers)),e.skeletonUniqueId!==void 0&&e.skeletonUniqueId!==null&&(s._waitingSkeletonUniqueId=e.skeletonUniqueId),e.animations){for(let o=0;o<e.animations.length;o++){const c=e.animations[o],h=Ed("BABYLON.Animation");h&&s.animations.push(h.Parse(c))}fl.ParseAnimationRanges(s,e,t)}if(e.autoAnimate&&t.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?s.layerMask=Math.abs(parseInt(e.layerMask)):s.layerMask=268435455,e.physicsImpostor&&(s.physicsImpostor=K._PhysicsImpostorParser(t,s,e)),e.lodMeshIds&&(s._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(let o=0;o<e.instances.length;o++){const c=e.instances[o],h=s.createInstance(c.name);if(c.id&&(h.id=c.id),xt&&(c.tags?xt.AddTagsTo(h,c.tags):xt.AddTagsTo(h,e.tags)),h.position=E.FromArray(c.position),c.metadata!==void 0&&(h.metadata=c.metadata),c.parentId!==void 0&&(h._waitingParentId=c.parentId),c.parentInstanceIndex!==void 0&&(h._waitingParentInstanceIndex=c.parentInstanceIndex),c.isEnabled!==void 0&&c.isEnabled!==null&&h.setEnabled(c.isEnabled),c.isVisible!==void 0&&c.isVisible!==null&&(h.isVisible=c.isVisible),c.isPickable!==void 0&&c.isPickable!==null&&(h.isPickable=c.isPickable),c.rotationQuaternion?h.rotationQuaternion=Oe.FromArray(c.rotationQuaternion):c.rotation&&(h.rotation=E.FromArray(c.rotation)),h.scaling=E.FromArray(c.scaling),c.checkCollisions!=null&&c.checkCollisions!=null&&(h.checkCollisions=c.checkCollisions),c.pickable!=null&&c.pickable!=null&&(h.isPickable=c.pickable),c.showBoundingBox!=null&&c.showBoundingBox!=null&&(h.showBoundingBox=c.showBoundingBox),c.showSubMeshesBoundingBox!=null&&c.showSubMeshesBoundingBox!=null&&(h.showSubMeshesBoundingBox=c.showSubMeshesBoundingBox),c.alph
vendor: 6,664 bytes, line 161
161aIndex!=null&&c.showSubMeshesBoundingBox!=null&&(h.alphaIndex=c.alphaIndex),c.physicsImpostor&&(h.physicsImpostor=K._PhysicsImpostorParser(t,h,c)),c.actions!==void 0&&(h._waitingData.actions=c.actions),c.animations){for(let f=0;f<c.animations.length;f++){const _=c.animations[f],d=Ed("BABYLON.Animation");d&&h.animations.push(d.Parse(_))}fl.ParseAnimationRanges(h,c,t),c.autoAnimate&&t.beginAnimation(h,c.autoAnimateFrom,c.autoAnimateTo,c.autoAnimateLoop,c.autoAnimateSpeed||1)}}if(e.thinInstances){const o=e.thinInstances;if(s.thinInstanceEnablePicking=!!o.enablePicking,o.matrixData?(s.thinInstanceSetBuffer("matrix",new Float32Array(o.matrixData),16,!1),s._thinInstanceDataStorage.matrixBufferSize=o.matrixBufferSize,s._thinInstanceDataStorage.instancesCount=o.instancesCount):s._thinInstanceDataStorage.matrixBufferSize=o.matrixBufferSize,e.thinInstances.userThinInstance){const c=e.thinInstances.userThinInstance;for(const h in c.data)s.thinInstanceSetBuffer(h,new Float32Array(c.data[h]),c.strides[h],!1),s._userThinInstanceBuffersStorage.sizes[h]=c.sizes[h]}}return s}setPositionsForCPUSkinning(){const e=this._internalMeshDataInfo;if(!e._sourcePositions){const t=this.getVerticesData(F.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(F.PositionKind)||this.setVerticesData(F.PositionKind,t,!0)}return e._sourcePositions}setNormalsForCPUSkinning(){const e=this._internalMeshDataInfo;if(!e._sourceNormals){const t=this.getVerticesData(F.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(F.NormalKind)||this.setVerticesData(F.NormalKind,t,!0)}return e._sourceNormals}applySkeleton(e){if(!this.geometry)return this;if(this.geometry._softwareSkinningFrameId==this.getScene().getFrameId())return this;if(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(F.PositionKind))return this;if(!this.isVerticesDataPresent(F.MatricesIndicesKind))return this;if(!this.isVerticesDataPresent(F.MatricesWeightsKind))return this;const t=this.isVerticesDataPresent(F.NormalKind),i=this._internalMeshDataInfo;if(!i._sourcePositions){const R=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=R}t&&!i._sourceNormals&&this.setNormalsForCPUSkinning();let s=this.getVerticesData(F.PositionKind);if(!s)return this;s instanceof Float32Array||(s=new Float32Array(s));let r=this.getVerticesData(F.NormalKind);if(t){if(!r)return this;r instanceof Float32Array||(r=new Float32Array(r))}const o=this.getVerticesData(F.MatricesIndicesKind),c=this.getVerticesData(F.MatricesWeightsKind);if(!c||!o)return this;const h=this.numBoneInfluencers>4,f=h?this.getVerticesData(F.MatricesIndicesExtraKind):null,_=h?this.getVerticesData(F.MatricesWeightsExtraKind):null,d=e.getTransformMatrices(this),g=E.Zero(),p=new se,x=new se;let b=0,T;for(let R=0;R<s.length;R+=3,b+=4){let S;for(T=0;T<4;T++)S=c[b+T],S>0&&(se.FromFloat32ArrayToRefScaled(d,Math.floor(o[b+T]*16),S,x),p.addToSelf(x));if(h)for(T=0;T<4;T++)S=_[b+T],S>0&&(se.FromFloat32ArrayToRefScaled(d,Math.floor(f[b+T]*16),S,x),p.addToSelf(x));E.TransformCoordinatesFromFloatsToRef(i._sourcePositions[R],i._sourcePositions[R+1],i._sourcePositions[R+2],p,g),g.toArray(s,R),t&&(E.TransformNormalFromFloatsToRef(i._sourceNormals[R],i._sourceNormals[R+1],i._sourceNormals[R+2],p,g),g.toArray(r,R)),p.reset()}return this.updateVerticesData(F.PositionKind,s),t&&this.updateVerticesData(F.NormalKind,r),this}static MinMax(e){let t=null,i=null;for(const s of e){const o=s.getBoundingInfo().boundingBox;!t||!i?(t=o.minimumWorld.clone(),i=o.maximumWorld.clone()):(t.minimizeInPlace(o.minimumWorld),i.maximizeInPlace(o.maximumWorld))}return!t||!i?{min:E.Zero(),max:E.Zero()}:{min:t,max:i}}static Center(e){const t=e instanceof Array?K.MinMax(e):e;return E.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,r,o){return r_(K._MergeMeshesCoroutine(e,t,i,s,r,o,!1))}static async MergeMeshesAsync(e,t=!0,i,s,r,o){return await HI(K._MergeMeshesCoroutine(e,t,i,s,r,o,!0),GI())}static*_MergeMeshesCoroutine(e,t=!0,i,s,r,o,c){if(e=e.filter(Boolean),e.length===0)return null;let h;if(!i){let C=0;for(h=0;h<e.length;h++)if(C+=e[h].getTotalVertices(),C>=65536)return me.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}const f=e[0];o&&(r=!1,e.sort((C,k)=>(C.material?.uniqueId??-1)-(k.material?.uniqueId??-1)));const _=new Array,d=new Array,g=new Array,p=e[0].sideOrientation;for(h=0;h<e.length;h++){const C=e[h];if(C.isAnInstance)return me.Warn("Cannot merge instance meshes."),null;if(p!==C.sideOrientation)return me.Warn("Cannot merge meshes with different sideOrientation values."),null;if(r||o){const k=g.reduce((H,L)=>Math.max(H,L.start+L.count),0);if(o)if(C.material){const H=C.material;if(H instanceof dh){for(let L=0;L<H.subMaterials.length;L++)_.indexOf(H.subMaterials[L])<0&&_.push(H.subMaterials[L]);for(let L=0;L<C.subMeshes.length;L++)d.push(_.indexOf(H.subMaterials[C.subMeshes[L].materialIndex])),g.push({start:k+C.subMeshes[L].indexStart,count:C.subMeshes[L].indexCount})}else{_.indexOf(H)<0&&_.push(H);for(let L=0;L<C.subMeshes.length;L++)d.push(_.indexOf(H)),g.push({start:k+C.subMeshes[L].indexStart,count:C.subMeshes[L].indexCount})}}else for(let H=0;H<C.subMeshes.length;H++)d.push(0),g.push({start:k+C.subMeshes[H].indexStart,count:C.subMeshes[H].indexCount});else g.push({start:k,count:C.getTotalIndices()})}}if(o&&g.length>1){let C=0;for(let k=1;k<g.length;k++){const H=g[C],L=g[k];d[k]===d[C]&&H.start+H.count===L.start?H.count+=L.count:(C++,g[C]=L,d[C]=d[k])}g.length=C+1,d.length=C+1}const x=C=>{const k=C.computeWorldMatrix(!0);return{vertexData:Be.ExtractFromMesh(C,!1,!1),transform:k}},{vertexData:b,transform:T}=x(e[0]);c&&(yield);const R=new Array(e.length-1);for(let C=1;C<e.length;C++)R[C-1]=x(e[C]),c&&(yield);const S=b._mergeCoroutine(T,R,i,c,!t);let M=S.next();for(;!M.done;)c&&(yield),M=S.next();const I=M.value;s||(s=new K(f.name+"_merged",f.getScene()));const A=I._applyToCoroutine(s,void 0,c);let D=A.next();for(;!D.done;)c&&(yield),D=A.next();if(s.checkCollisions=f.checkCollisions,s.sideOrientation=f.sideOrientation,t)for(h=0;h<e.length;h++)e[h].dispose();if(r||o){for(s.releaseSubMeshes(),h=0;h<g.length;)Ss.CreateFromIndices(0,g[h].start,g[h].count,s,void 0,!1),h++;for(const C of s.subMeshes)C.refreshBoundingInfo();s.computeWorldMatrix(!0)}if(o){const C=new dh(f.name+"_merged",f.getScene());C.subMaterials=_;for(let k=0;k<s.subMeshes.length;k++)s.subMeshes[k].materialIndex=d[k];s.material=C}else s.material=f.material;return s}
vendor: 4,629 bytes, line 161
161addInstance(e){e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)}removeInstance(e){const t=e._indexInSourceMeshInstanceArray;if(t!=-1){if(t!==this.instances.length-1){const i=this.instances[this.instances.length-1];this.instances[t]=i,i._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}}_shouldConvertRHS(){return this._scene.useRightHandedSystem&&this.sideOrientation===wi.CounterClockWiseSideOrientation}_getRenderingFillMode(e){const t=this.getScene();return t.forcePointsCloud?wi.PointFillMode:t.forceWireframe?wi.WireFrameFillMode:this.overrideRenderingFillMode??e}setMaterialByID(e){return this.setMaterialById(e)}static CreateRibbon(e,t,i,s,r,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateDisc(e,t,i,s,r,o){throw new Error("Import MeshBuilder to populate this function")}static CreateBox(e,t,i,s,r){throw new Error("Import MeshBuilder to populate this function")}static CreateSphere(e,t,i,s,r,o){throw new Error("Import MeshBuilder to populate this function")}static CreateHemisphere(e,t,i,s){throw new Error("Import MeshBuilder to populate this function")}static CreateCylinder(e,t,i,s,r,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateTorus(e,t,i,s,r,o,c){throw new Error("Import MeshBuilder to populate this function")}static CreateTorusKnot(e,t,i,s,r,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static CreateLines(e,t,i,s,r){throw new Error("Import MeshBuilder to populate this function")}static CreateDashedLines(e,t,i,s,r,o,c,h){throw new Error("Import MeshBuilder to populate this function")}static CreatePolygon(e,t,i,s,r,o,c){throw new Error("Import MeshBuilder to populate this function")}static ExtrudePolygon(e,t,i,s,r,o,c,h){throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShape(e,t,i,s,r,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShapeCustom(e,t,i,s,r,o,c,h,f,_,d,g){throw new Error("Import MeshBuilder to populate this function")}static CreateLathe(e,t,i,s,r,o,c){throw new Error("Import MeshBuilder to populate this function")}static CreatePlane(e,t,i,s,r){throw new Error("Import MeshBuilder to populate this function")}static CreateGround(e,t,i,s,r,o){throw new Error("Import MeshBuilder to populate this function")}static CreateTiledGround(e,t,i,s,r,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateGroundFromHeightMap(e,t,i,s,r,o,c,h,f,_,d){throw new Error("Import MeshBuilder to populate this function")}static CreateTube(e,t,i,s,r,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static CreatePolyhedron(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static CreateIcoSphere(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static CreateDecal(e,t,i,s,r,o){throw new Error("Import MeshBuilder to populate this function")}static CreateCapsule(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static ExtendToGoldberg(e){throw new Error("Import MeshBuilder to populate this function")}}K.FRONTSIDE=Be.FRONTSIDE;K.BACKSIDE=Be.BACKSIDE;K.DOUBLESIDE=Be.DOUBLESIDE;K.DEFAULTSIDE=Be.DEFAULTSIDE;K.NO_CAP=0;K.CAP_START=1;K.CAP_END=2;K.CAP_ALL=3;K.NO_FLIP=0;K.FLIP_TILE=1;K.ROTATE_TILE=2;K.FLIP_ROW=3;K.ROTATE_ROW=4;K.FLIP_N_ROTATE_TILE=5;K.FLIP_N_ROTATE_ROW=6;K.CENTER=0;K.LEFT=1;K.RIGHT=2;K.TOP=3;K.BOTTOM=4;K.INSTANCEDMESH_SORT_TRANSPARENT=!1;K._GroundMeshParser=(a,e)=>{throw je("GroundMesh")};K._GoldbergMeshParser=(a,e)=>{throw je("GoldbergMesh")};K._LinesMeshParser=(a,e)=>{throw je("LinesMesh")};K._GreasedLineMeshParser=(a,e)=>{throw je("GreasedLineMesh")};K._GreasedLineRibbonMeshParser=(a,e)=>{throw je("GreasedLineRibbonMesh")};K._TrailMeshParser=(a,e)=>{throw je("TrailMesh")};K._GaussianSplattingMeshParser=(a,e)=>{throw je("GaussianSplattingMesh")};K._GaussianSplattingPartProxyMeshParser=(a,e)=>{throw je("GaussianSplattingPartProxyMesh")};K._GaussianSplattingCompoundMeshParser=(a,e)=>{throw je("GaussianSplattingCompoundMesh")};(Vb=K.prototype).registerInstancedBuffer??(Vb.registerInstancedBuffer=He("Mesh","registerInstancedBuffer"));(Gb=K.prototype).simplify??(Gb.simplify=He("Mesh","simplify"));(Hb=K.prototype).thinInstanceAdd??(Hb.thinInstanceAdd=He("Mesh","thinInstanceAdd"));(Wb=K.prototype).thinInstanceAddSelf??(Wb.thinInstanceAddSelf=He("Mesh","thinInstanceAddSelf"));(Xb=K.prototype).thinInstanceRegisterAttribute??(Xb.thinInstanceRegisterAttribute=He("Mesh","thinInstanceRegisterAttribute"));
161(qb=K.prototype).thinInstanceSetMatrixAt??(qb.thinInstanceSetMatrixAt=He("Mesh","thinInstanceSetMatrixAt"));(jb=K.prototype).thinInstanceSetAttributeAt??(jb.thinInstanceSetAttributeAt=He("Mesh","thinInstanceSetAttributeAt"));(Yb=K.prototype).thinInstanceSetBuffer??(Yb.thinInstanceSetBuffer=He("Mesh","thinInstanceSetBuffer"));(Kb=K.prototype).thinInstanceGetWorldMatrices??(Kb.thinInstanceGetWorldMatrices=He("Mesh","thinInstanceGetWorldMatrices"));(Zb=K.prototype).thinInstanceBufferUpdated??(Zb.thinInstanceBufferUpdated=He("Mesh","thinInstanceBufferUpdated"));(Qb=K.prototype).thinInstancePartialBufferUpdate??(Qb.thinInstancePartialBufferUpdate=He("Mesh","thinInstancePartialBufferUpdate"));($b=K.prototype).thinInstanceRefreshBoundingInfo??($b.thinInstanceRefreshBoundingInfo=He("Mesh","thinInstanceRefreshBoundingInfo"));(Jb=K.prototype).getEmittedParticleSystems??(Jb.getEmittedParticleSystems=He("Mesh","getEmittedParticleSystems"));(e0=K.prototype).getHierarchyEmittedParticleSystems??(e0.getHierarchyEmittedParticleSystems=He("Mesh","getHierarchyEmittedParticleSystems"));Object.getOwnPropertyDescriptor(K.prototype,"edgesShareWithInstances")||Object.defineProperty(K.prototype,"edgesShareWithInstances",mt("Mesh","edgesShareWithInstances"));Object.getOwnPropertyDescriptor(K.prototype,"thinInstanceEnablePicking")||Object.defineProperty(K.prototype,"thinInstanceEnablePicking",mt("Mesh","thinInstanceEnablePicking"));Object.getOwnPropertyDescriptor(K.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation")||Object.defineProperty(K.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation",mt("Mesh","thinInstanceAllowAutomaticStaticBufferRecreation"));Object.getOwnPropertyDescriptor(K.prototype,"thinInstanceCount")||Object.defineProperty(K.prototype,"thinInstanceCount",mt("Mesh","thinInstanceCount"));function D1(a){let e=a.pathArray;const t=a.closeArray||!1,i=a.closePath||!1,s=a.invertUV||!1,r=Math.floor(e[0].length/2);let o=a.offset||r;o=o>r?r:Math.floor(o);const c=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,h=a.uvs,f=a.colors,_=[],d=[],g=[],p=[],x=[],b=[],T=[],R=[];let S;const M=[],I=[];let A,D,C;if(e.length<2){const de=[],we=[];for(D=0;D<e[0].length-o;D++)de.push(e[0][D]),we.push(e[0][D+o]);e=[de,we]}let k=0;const H=i?1:0,L=t?1:0;let J,te;S=e[0].length;let ae,B;for(A=0;A<e.length+L;A++){for(T[A]=0,x[A]=[0],J=A===e.length?e[0]:e[A],te=J.length,S=S<te?S:te,C=0;C<te;)_.push(J[C].x,J[C].y,J[C].z),C>0&&(ae=J[C].subtract(J[C-1]).length(),B=ae+T[A],x[A].push(B),T[A]=B),C++;i&&(C--,_.push(J[0].x,J[0].y,J[0].z),ae=J[C].subtract(J[0]).length(),B=ae+T[A],x[A].push(B),T[A]=B),M[A]=te+H,I[A]=k,k+=te+H}let $,z,X,q;for(D=0;D<S+H;D++)for(R[D]=0,b[D]=[0],A=0;A<e.length-1+L;A++)$=e[A],z=A===e.length-1?e[0]:e[A+1],D===S?(X=$[0],q=z[0]):(X=$[D],q=z[D]),ae=q.subtract(X).length(),B=ae+R[D],b[D].push(B),R[D]=B;let G,j;if(h)for(A=0;A<h.length;A++)p.push(h[A].x,h[A].y);else for(A=0;A<e.length+L;A++)for(D=0;D<S+H;D++)G=T[A]!=0?x[A][D]/T[A]:0,j=R[D]!=0?b[D][A]/R[D]:0,s?p.push(j,G):p.push(G,j);A=0;let w=0,O=M[A]-1,U=M[A+1]-1,W=O<U?O:U,oe=I[1]-I[0];const le=M.length-1;for(;w<=W&&A<le;)d.push(w,w+oe,w+1),d.push(w+oe+1,w+1,w+oe),w+=1,w===W&&(A++,oe=I[A+1]-I[A],O=M[A]-1,U=M[A+1]-1,w=I[A],W=O<U?O+w:U+w);if(Be.ComputeNormals(_,d,g),i){let de,we;for(A=0;A<e.length;A++){de=I[A]*3,A+1<e.length?we=(I[A+1]-1)*3:we=g.length-3,g[de]=(g[de]+g[we])*.5,g[de+1]=(g[de+1]+g[we+1])*.5,g[de+2]=(g[de+2]+g[we+2])*.5;const qe=Math.sqrt(g[de]*g[de]+g[de+1]*g[de+1]+g[de+2]*g[de+2]);g[de]/=qe,g[de+1]/=qe,g[de+2]/=qe,g[we]=g[de],g[we+1]=g[de+1],g[we+2]=g[de+2]}}if(t){let de=I[0]*3,we=I[e.length]*3;for(D=0;D<S+H;D++){g[de]=(g[de]+g[we])*.5,g[de+1]=(g[de+1]+g[we+1])*.5,g[de+2]=(g[de+2]+g[we+2])*.5;const qe=Math.sqrt(g[de]*g[de]+g[de+1]*g[de+1]+g[de+2]*g[de+2]);g[de]/=qe,g[de+1]/=qe,g[de+2]/=qe,g[we]=g[de],g[we+1]=g[de+1],g[we+2]=g[de+2],de+=3,we+=3}}Be._ComputeSides(c,_,d,g,p,a.frontUVs,a.backUVs);let be=null;if(f){be=new Float32Array(f.length*4);for(let de=0;de<f.length;de++)be[de*4]=f[de].r,be[de*4+1]=f[de].g,be[de*4+2]=f[de].b,be[de*4+3]=f[de].a}const Ee=new Be,Fe=new Float32Array(_),Y=new Float32Array(g),ue=new Float32Array(p);return Ee.indices=d,Ee.positions=Fe,Ee.normals=Y,Ee.uvs=ue,be&&Ee.set(be,F.ColorKind),i&&(Ee._idx=I),Ee}function ta(a,e,t=null){const i=e.pathArray,s=e.closeArray,r=e.closePath,o=K._GetDefaultSideOrientation(e.sideOrientation),c=e.instance,h=e.updatable;if(c){const f=fe.Vector3[0].setAll(Number.MAX_VALUE),_=fe.Vector3[1].setAll(-Number.MAX_VALUE),d=p=>{let x=i[0].length;const b=c;let T=0;
161const R=b._originalBuilderSideOrientation===K.DOUBLESIDE?2:1;for(let S=1;S<=R;++S)for(let M=0;M<i.length;++M){const I=i[M],A=I.length;x=x<A?x:A;for(let D=0;D<x;++D){const C=I[D];p[T]=C.x,p[T+1]=C.y,p[T+2]=C.z,f.minimizeInPlaceFromFloats(C.x,C.y,C.z),_.maximizeInPlaceFromFloats(C.x,C.y,C.z),T+=3}if(b._creationDataStorage&&b._creationDataStorage.closePath){const D=I[0];p[T]=D.x,p[T+1]=D.y,p[T+2]=D.z,T+=3}}},g=c.getVerticesData(F.PositionKind);if(d(g),c.hasBoundingInfo?c.getBoundingInfo().reConstruct(f,_,c._worldMatrix):c.buildBoundingInfo(f,_,c._worldMatrix),c.updateVerticesData(F.PositionKind,g,!1,!1),e.colors){const p=c.getVerticesData(F.ColorKind);for(let x=0,b=0;x<e.colors.length;x++,b+=4){const T=e.colors[x];p[b]=T.r,p[b+1]=T.g,p[b+2]=T.b,p[b+3]=T.a}c.updateVerticesData(F.ColorKind,p,!1,!1)}if(e.uvs){const p=c.getVerticesData(F.UVKind);for(let x=0;x<e.uvs.length;x++)p[x*2]=e.uvs[x].x,p[x*2+1]=e.uvs[x].y;c.updateVerticesData(F.UVKind,p,!1,!1)}if(!c.areNormalsFrozen||c.isFacetDataEnabled){const p=c.getIndices(),x=c.getVerticesData(F.NormalKind),b=c.isFacetDataEnabled?c.getFacetDataParameters():null;if(Be.ComputeNormals(g,p,x,b),c._creationDataStorage&&c._creationDataStorage.closePath){let T,R;for(let S=0;S<i.length;S++)T=c._creationDataStorage.idx[S]*3,S+1<i.length?R=(c._creationDataStorage.idx[S+1]-1)*3:R=x.length-3,x[T]=(x[T]+x[R])*.5,x[T+1]=(x[T+1]+x[R+1])*.5,x[T+2]=(x[T+2]+x[R+2])*.5,x[R]=x[T],x[R+1]=x[T+1],x[R+2]=x[T+2]}c.areNormalsFrozen||c.updateVerticesData(F.NormalKind,x,!1,!1)}return c}else{const f=new K(a,t);f._originalBuilderSideOrientation=o,f._creationDataStorage=new C1;const _=D1(e);return r&&(f._creationDataStorage.idx=_._idx),f._creationDataStorage.closePath=r,f._creationDataStorage.closeArray=s,_.applyToMesh(f,h),f}}let s0=!1;function yw(){s0||(s0=!0,Be.CreateRibbon=D1,K.CreateRibbon=(a,e,t=!1,i,s,r,o=!1,c,h)=>ta(a,{pathArray:e,closeArray:t,closePath:i,offset:s,updatable:o,sideOrientation:c,instance:h},r))}function I1(a){const e=[],t=[],i=[],s=[],r=a.radius||.5,o=a.tessellation||64,c=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,h=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE;e.push(0,0,0),s.push(.5,.5);const f=Math.PI*2*c,_=c===1?f/o:f/(o-1);let d=0;for(let x=0;x<o;x++){const b=Math.cos(d),T=Math.sin(d),R=(b+1)/2,S=(1-T)/2;e.push(r*b,r*T,0),s.push(R,S),d+=_}c===1&&(e.push(e[3],e[4],e[5]),s.push(s[2],s[3]));const g=e.length/3;for(let x=1;x<g-1;x++)t.push(x+1,0,x);Be.ComputeNormals(e,t,i),Be._ComputeSides(h,e,t,i,s,a.frontUVs,a.backUVs);const p=new Be;return p.indices=t,p.positions=e,p.normals=i,p.uvs=s,p}function w1(a,e={},t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,I1(e).applyToMesh(i,e.updatable),i}let n0=!1;function bw(){n0||(n0=!0,Be.CreateDisc=I1,K.CreateDisc=(a,e,t,i=null,s,r)=>w1(a,{radius:e,tessellation:t,sideOrientation:r,updatable:s},i))}class Sh extends K{constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e);const i=this;jd(i.createOrUpdateSubmeshesOctree)&&i.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){const i=this.getWorldMatrix(),s=fe.Matrix[5];i.invertToRef(s);const r=fe.Vector3[8];if(E.TransformCoordinatesFromFloatsToRef(e,0,t,s,r),e=r.x,t=r.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const o=this._getFacetAt(e,t),c=-(o.x*e+o.z*t+o.w)/o.y;return E.TransformCoordinatesFromFloatsToRef(0,c,0,i,r),r.y}getNormalAtCoordinates(e,t){const i=new E(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i}getNormalAtCoordinatesToRef(e,t,i){const s=this.getWorldMatrix(),r=fe.Matrix[5];s.invertToRef(r);const o=fe.Vector3[8];if(E.TransformCoordinatesFromFloatsToRef(e,0,t,r,o),e=o.x,t=o.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const c=this._getFacetAt(e,t);return E.TransformNormalFromFloatsToRef(c.x,c.y,c.z,s,i),this}updateCoordinateHeights(){return(!this._heightQuads||this._heightQuads.length==0)&&this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){const i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),s=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),r=this._heightQuads[s*this._subdivisionsX+i];let o;return t<r.slope.x*e+r.slope.y?o=r.facet1:o=r.facet2,o}_initHeightQuads(){const e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=[];for(let i=0;i<t;i++)for(let s=0;s<e;s++){const r={slope:Ue.Zero(),facet1:new it(0,0,0,0),facet2:new it(0,0,0,0)};this._heightQuads[i*e+s]=r}return this}_computeHeightQuads(){const e=this.getVerticesData(F.PositionKind);if(!e)return this;const t=fe.Vector3[3],i=fe.Vector3[2],s=fe.Vector3[1],r=fe.Vector3[0],o=fe.Vector3[4],c=fe.Vector3[5],h=fe.Vector3[6],f=fe.Vector3[7],_=fe.Vector3[8];let d,g,p,x,b,T,R;const S=this._subdivisionsX,M=this._subdivisionsY;for(let I=0;I<M;I++)for(let A=0;A<S;A++){d=A*3,g=I*(S+1)*3,p=(I+1)*(S+1)*3,t.x=e[g+d],t.y=e[g+d+1],t.z=e[g+d+2],i.x=e[g+d+3],i.y=e[g+d+4],i.z=e[g+d+5],s.x=e[p+d],s.y=e[p+d+1],s.z=e[p+d+2],r.x=e[p+d+3],r.y=e[p+d+4],r.z=e[p+d+5],x=(r.z-t.z)/(r.x-t.x),b=t.z-x*t.x,i.subtractToRef(t,o),s.subtractToRef(t,c),r.subtractToRef(t,h),E.CrossToRef(h,c,f),E.CrossToRef(o,h,_),f.normalize(),_.normalize(),T=-(f.x*t.x+f.y*t.y+f.z*t.z),R=-(_.x*i.x+_.y*i.y+_.z*i.z);const D=this._heightQuads[I*S+A];D.slope.copyFromFloats(x,b),D.facet1.copyFromFloats(f.x,f.y,f.z,T),D.facet2.copyFromFloats(_.x,_.y,_.z,R)}return this}serialize(e){super.serialize(e),e.subdivisionsX=this._subdivisionsX,e.subdivisionsY=this._subdivisionsY,e.minX=this._minX,e.maxX=this._maxX,e.minZ=this._minZ,e.maxZ=this._maxZ,e.width=this._width,e.height=this._height}static Parse(e,t){const i=new Sh(e.name,t);return i._subdivisionsX=e.subdivisionsX||1,i._subdivisionsY=e.subdivisionsY||1,i._minX=e.minX,i._maxX=e.maxX,i._minZ=e.minZ,i._maxZ=e.maxZ,i._width=e.width,i._height=e.height,i}}function P1(a){const e=[],t=[],i=[],s=[];let r,o;const c=a.width||a.size||1,h=a.height||a.size||1,f=(a.subdivisionsX||a.subdivisions||1)|0,_=(a.subdivisionsY||a.subdivisions||1)|0;for(r=0;r<=_;r++)for(o=0;o<=f;o++){const g=new E(o*c/f-c/2,0,(_-r)*h/_-h/2),p=new E(0,1,0);t.push(g.x,g.y,g.z),i.push(p.x,p.y,p.z),s.push(o/f,1-r/_)}for(r=0;r<_;r++)for(o=0;o<f;
vendor: 5,204 bytes, line 161
161o++)e.push(o+1+(r+1)*(f+1)),e.push(o+1+r*(f+1)),e.push(o+r*(f+1)),e.push(o+(r+1)*(f+1)),e.push(o+1+(r+1)*(f+1)),e.push(o+r*(f+1));const d=new Be;return d.indices=e,d.positions=t,d.normals=i,d.uvs=s,d}function O1(a){const e=a.xmin!==void 0&&a.xmin!==null?a.xmin:-1,t=a.zmin!==void 0&&a.zmin!==null?a.zmin:-1,i=a.xmax!==void 0&&a.xmax!==null?a.xmax:1,s=a.zmax!==void 0&&a.zmax!==null?a.zmax:1,r=a.subdivisions||{w:1,h:1},o=a.precision||{w:1,h:1},c=[],h=[],f=[],_=[];let d,g,p,x;r.h=r.h<1?1:r.h,r.w=r.w<1?1:r.w,o.w=o.w<1?1:o.w,o.h=o.h<1?1:o.h;const b={w:(i-e)/r.w,h:(s-t)/r.h};function T(S,M,I,A){const D=h.length/3,C=o.w+1;for(d=0;d<o.h;d++)for(g=0;g<o.w;g++){const L=[D+g+d*C,D+(g+1)+d*C,D+(g+1)+(d+1)*C,D+g+(d+1)*C];c.push(L[1]),c.push(L[2]),c.push(L[3]),c.push(L[0]),c.push(L[1]),c.push(L[3])}const k=E.Zero(),H=new E(0,1,0);for(d=0;d<=o.h;d++)for(k.z=d*(A-M)/o.h+M,g=0;g<=o.w;g++)k.x=g*(I-S)/o.w+S,k.y=0,h.push(k.x,k.y,k.z),f.push(H.x,H.y,H.z),_.push(g/o.w,d/o.h)}for(p=0;p<r.h;p++)for(x=0;x<r.w;x++)T(e+x*b.w,t+p*b.h,e+(x+1)*b.w,t+(p+1)*b.h);const R=new Be;return R.indices=c,R.positions=h,R.normals=f,R.uvs=_,R}function F1(a){const e=[],t=[],i=[],s=[];let r,o;const c=a.colorFilter||new lt(.3,.59,.11),h=a.alphaFilter||0;let f=!1;if(a.minHeight>a.maxHeight){f=!0;const d=a.maxHeight;a.maxHeight=a.minHeight,a.minHeight=d}for(r=0;r<=a.subdivisions;r++)for(o=0;o<=a.subdivisions;o++){const d=new E(o*a.width/a.subdivisions-a.width/2,0,(a.subdivisions-r)*a.height/a.subdivisions-a.height/2),g=(d.x+a.width/2)/a.width*(a.bufferWidth-1)|0,p=(1-(d.z+a.height/2)/a.height)*(a.bufferHeight-1)|0,x=(g+p*a.bufferWidth)*4;let b=a.buffer[x]/255,T=a.buffer[x+1]/255,R=a.buffer[x+2]/255;const S=a.buffer[x+3]/255;f&&(b=1-b,T=1-T,R=1-R);const M=b*c.r+T*c.g+R*c.b;S>=h?d.y=a.minHeight+(a.maxHeight-a.minHeight)*M:d.y=a.minHeight-Bt,a.heightBuffer&&(a.heightBuffer[r*(a.subdivisions+1)+o]=d.y),t.push(d.x,d.y,d.z),i.push(0,0,0),s.push(o/a.subdivisions,1-r/a.subdivisions)}for(r=0;r<a.subdivisions;r++)for(o=0;o<a.subdivisions;o++){const d=o+1+(r+1)*(a.subdivisions+1),g=o+1+r*(a.subdivisions+1),p=o+r*(a.subdivisions+1),x=o+(r+1)*(a.subdivisions+1),b=t[d*3+1]>=a.minHeight,T=t[g*3+1]>=a.minHeight,R=t[p*3+1]>=a.minHeight;b&&T&&R&&(e.push(d),e.push(g),e.push(p)),t[x*3+1]>=a.minHeight&&b&&R&&(e.push(x),e.push(d),e.push(p))}Be.ComputeNormals(t,e,i);const _=new Be;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function B1(a,e={},t){const i=new Sh(a,t);return i._setReady(!1),i._subdivisionsX=e.subdivisionsX||e.subdivisions||1,i._subdivisionsY=e.subdivisionsY||e.subdivisions||1,i._width=e.width||1,i._height=e.height||1,i._maxX=i._width/2,i._maxZ=i._height/2,i._minX=-i._maxX,i._minZ=-i._maxZ,P1(e).applyToMesh(i,e.updatable),i._setReady(!0),i}function L1(a,e,t=null){const i=new K(a,t);return O1(e).applyToMesh(i,e.updatable),i}function U1(a,e,t={},i=null){const s=t.width||10,r=t.height||10,o=t.subdivisions||1,c=t.minHeight||0,h=t.maxHeight||1,f=t.colorFilter||new lt(.3,.59,.11),_=t.alphaFilter||0,d=t.updatable,g=t.onReady;i=i||ft.LastCreatedScene;const p=new Sh(a,i);p._subdivisionsX=o,p._subdivisionsY=o,p._width=s,p._height=r,p._maxX=p._width/2,p._maxZ=p._height/2,p._minX=-p._maxX,p._minZ=-p._maxZ,p._setReady(!1);let x;t.passHeightBufferInCallback&&(x=new Float32Array((o+1)*(o+1)));const b=(T,R,S)=>{F1({width:s,height:r,subdivisions:o,minHeight:c,maxHeight:h,colorFilter:f,buffer:T,bufferWidth:R,bufferHeight:S,alphaFilter:_,heightBuffer:x}).applyToMesh(p,d),g&&g(p,x),p._setReady(!0)};if(typeof e=="string"){i.addPendingData(p);const T=S=>{const M=S.width,I=S.height;if(i.isDisposed){i.removePendingData(p);return}const A=i?.getEngine().resizeImageBitmap(S,M,I);b(A,M,I),i.removePendingData(p)},R=(S,M)=>{i.removePendingData(p),t.onError&&t.onError(S,M)};_t.LoadImage(e,T,R,i.offlineProvider)}else b(e.data,e.width,e.height);return p}let r0=!1;function xw(){r0||(r0=!0,Be.CreateGround=P1,Be.CreateTiledGround=O1,Be.CreateGroundFromHeightMap=F1,K.CreateGround=(a,e,t,i,s,r)=>B1(a,{width:e,height:t,subdivisions:i,updatable:r},s),K.CreateTiledGround=(a,e,t,i,s,r,o,c,h)=>L1(a,{xmin:e,zmin:t,xmax:i,zmax:s,subdivisions:r,precision:o,updatable:h},c),K.CreateGroundFromHeightMap=(a,e,t,i,s,r,o,c,h,f,_)=>U1(a,e,{width:t,height:i,subdivisions:s,minHeight:r,maxHeight:o,updatable:h,onReady:f,alphaFilter:_},c))}function k1(a){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23];const i=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],s=[],r=a.width||a.size||1,o=a.height||a.size||1,c=a.depth||a.size||1,h=a.wrap||!1;let f=a.topBaseAt===void 0?1:a.topBaseAt,_=a.bottomBaseAt===void 0?0:a.bottomBaseAt;f=(f+4)%4,_=(_+4)%4;const d=[2,0,3,1],g=[2,0,1,3];let p=d[f],x=g[_],b=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(h){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],b=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];
161let C=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],k=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]];const H=[17,18,19,16],L=[22,23,20,21];for(;p>0;)C.unshift(C.pop()),H.unshift(H.pop()),p--;for(;x>0;)k.unshift(k.pop()),L.unshift(L.pop()),x--;C=C.flat(),k=k.flat(),b=b.concat(C).concat(k),t.push(H[0],H[2],H[3],H[0],H[1],H[2]),t.push(L[0],L[2],L[3],L[0],L[1],L[2])}const T=[r/2,o/2,c/2],R=b.reduce((C,k,H)=>C.concat(k*T[H%3]),[]),S=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,M=a.faceUV||new Array(6),I=a.faceColors,A=[];for(let C=0;C<6;C++)M[C]===void 0&&(M[C]=new it(0,0,1,1)),I&&I[C]===void 0&&(I[C]=new dt(1,1,1,1));for(let C=0;C<6;C++)if(s.push(M[C].z,M[C].w),s.push(M[C].x,M[C].w),s.push(M[C].x,M[C].y),s.push(M[C].z,M[C].y),I)for(let k=0;k<4;k++)A.push(I[C].r,I[C].g,I[C].b,I[C].a);Be._ComputeSides(S,R,t,i,s,a.frontUVs,a.backUVs);const D=new Be;if(D.indices=t,D.positions=R,D.normals=i,D.uvs=s,I){const C=S===Be.DOUBLESIDE?A.concat(A):A;D.colors=C}return D}function N1(a,e={},t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,k1(e).applyToMesh(i,e.updatable),i}let a0=!1;function vw(){a0||(a0=!0,Be.CreateBox=k1,K.CreateBox=(a,e,t=null,i,s)=>N1(a,{size:e,sideOrientation:s,updatable:i},t))}function sl(a){const e=a.pattern||K.NO_FLIP,t=a.tileWidth||a.tileSize||1,i=a.tileHeight||a.tileSize||1,s=a.alignHorizontal||0,r=a.alignVertical||0,o=a.width||a.size||1,c=Math.floor(o/t);let h=o-c*t;const f=a.height||a.size||1,_=Math.floor(f/i);let d=f-_*i;const g=t*c/2,p=i*_/2;let x=0,b=0,T=0,R=0,S=0,M=0;if(h>0||d>0){switch(T=-g,R=-p,S=g,M=p,s){case K.CENTER:h/=2,T-=h,S+=h;break;case K.LEFT:S+=h,x=-h/2;break;case K.RIGHT:T-=h,x=h/2;break}switch(r){case K.CENTER:d/=2,R-=d,M+=d;break;case K.BOTTOM:M+=d,b=-d/2;break;case K.TOP:R-=d,b=d/2;break}}const I=[],A=[],D=[];D[0]=[0,0,1,0,1,1,0,1],D[1]=[0,0,1,0,1,1,0,1],(e===K.ROTATE_TILE||e===K.ROTATE_ROW)&&(D[1]=[1,1,0,1,0,0,1,0]),(e===K.FLIP_TILE||e===K.FLIP_ROW)&&(D[1]=[1,0,0,0,0,1,1,1]),(e===K.FLIP_N_ROTATE_TILE||e===K.FLIP_N_ROTATE_ROW)&&(D[1]=[0,1,1,1,1,0,0,0]);let C=[];const k=[],H=[];let L=0;for(let B=0;B<_;B++)for(let $=0;$<c;$++)I.push(-g+$*t+x,-p+B*i+b,0),I.push(-g+($+1)*t+x,-p+B*i+b,0),I.push(-g+($+1)*t+x,-p+(B+1)*i+b,0),I.push(-g+$*t+x,-p+(B+1)*i+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),e===K.FLIP_TILE||e===K.ROTATE_TILE||e===K.FLIP_N_ROTATE_TILE?C=C.concat(D[($%2+B%2)%2]):e===K.FLIP_ROW||e===K.ROTATE_ROW||e===K.FLIP_N_ROTATE_ROW?C=C.concat(D[B%2]):C=C.concat(D[0]),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),L+=4;if(h>0||d>0){const B=d>0&&(r===K.CENTER||r===K.TOP),$=d>0&&(r===K.CENTER||r===K.BOTTOM),z=h>0&&(s===K.CENTER||s===K.RIGHT),X=h>0&&(s===K.CENTER||s===K.LEFT);let q,G,j,w,O;if(B&&z&&(I.push(T+x,R+b,0),I.push(-g+x,R+b,0),I.push(-g+x,R+d+b,0),I.push(T+x,R+d+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,G=1-h/t,j=1-d/i,w=1,O=1,q=[G,j,w,j,w,O,G,O],e===K.ROTATE_ROW&&(q=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),e===K.FLIP_ROW&&(q=[1-G,j,1-w,j,1-w,O,1-G,O]),e===K.FLIP_N_ROTATE_ROW&&(q=[G,1-j,w,1-j,w,1-O,G,1-O]),C=C.concat(q),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),B&&X&&(I.push(g+x,R+b,0),I.push(S+x,R+b,0),I.push(S+x,R+d+b,0),I.push(g+x,R+d+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,G=0,j=1-d/i,w=h/t,O=1,q=[G,j,w,j,w,O,G,O],(e===K.ROTATE_ROW||e===K.ROTATE_TILE&&c%2===0)&&(q=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),(e===K.FLIP_ROW||e===K.FLIP_TILE&&c%2===0)&&(q=[1-G,j,1-w,j,1-w,O,1-G,O]),(e===K.FLIP_N_ROTATE_ROW||e===K.FLIP_N_ROTATE_TILE&&c%2===0)&&(q=[G,1-j,w,1-j,w,1-O,G,1-O]),C=C.concat(q),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),$&&z&&(I.push(T+x,p+b,0),I.push(-g+x,p+b,0),I.push(-g+x,M+b,0),I.push(T+x,M+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,G=1-h/t,j=0,w=1,O=d/i,q=[G,j,w,j,w,O,G,O],(e===K.ROTATE_ROW&&_%2===1||e===K.ROTATE_TILE&&_%1===0)&&(q=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),(e===K.FLIP_ROW&&_%2===1||e===K.FLIP_TILE&&_%2===0)&&(q=[1-G,j,1-w,j,1-w,O,1-G,O]),(e===K.FLIP_N_ROTATE_ROW&&_%2===1||e===K.FLIP_N_ROTATE_TILE&&_%2===0)&&(q=[G,1-j,w,1-j,w,1-O,G,1-O]),C=C.concat(q),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),$&&X&&(I.push(g+x,p+b,0),I.push(S+x,p+b,0),I.push(S+x,M+b,0),I.push(g+x,M+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,G=0,j=0,w=h/t,O=d/i,q=[G,j,w,j,w,O,G,O],(e===K.ROTATE_ROW&&_%2===1||e===K.ROTATE_TILE&&(_+c)%2===1)&&(q=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),(e===K.FLIP_ROW&&_%2===1||e===K.FLIP_TILE&&(_+c)%2===1)&&(q=[1-G,j,1-w,j,1-w,O,1-G,O]),(e===K.FLIP_N_ROTATE_ROW&&_%2===1||e===K.FLIP_N_ROTATE_TILE&&(_+c)%2===1)&&(q=[G,1-j,w,1-j,w,1-O,G,1-O]),C=C.concat(q),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),B){const U=[];G=0,j=1-d/i,w=1,O=1,U[0]=[G,j,w,j,w,O,G,O],U[1]=[G,j,w,j,w,O,G,O],(e===K.ROTATE_TILE||e===K.ROTATE_ROW)&&(U[1]=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),(e===K.FLIP_TILE||e===K.FLIP_ROW)&&(U[1]=[1-G,j,1-w,j,1-w,O,1-G,O]),(e===K.FLIP_N_ROTATE_TILE||e===K.FLIP_N_ROTATE_ROW)&&(U[1]=[G,1-j,w,1-j,w,1-O,G,1-O]);for(let W=0;W<c;W++)I.push(-g+W*t+x,R+b,0),I.push(-g+(W+1)*t+x,R+b,0),I.push(-g+(W+1)*t+x,R+d+b,0),I.push(-g+W*t+x,R+d+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,e===K.FLIP_TILE||e===K.ROTATE_TILE||e===K.FLIP_N_ROTATE_TILE?C=C.concat(U[(W+1)%2]):e===K.FLIP_ROW||e===K.ROTATE_ROW||e===K.FLIP_N_ROTATE_ROW?C=C.concat(U[1]):C=C.concat(U[0]),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if($){const U=[];G=0,j=0,w=1,O=d/i,U[0]=[G,j,w,j,w,O,G,O],U[1]=[G,j,w,j,w,O,G,O],(e===K.ROTATE_TILE||e===K.ROTATE_ROW)&&(U[1]=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),(e===K.FLIP_TILE||e===K.FLIP_ROW)&&(U[1]=[1-G,j,1-w,j,1-w,O,1-G,O]),(e===K.FLIP_N_ROTATE_TILE||e===K.FLIP_N_ROTATE_ROW)&&(U[1]=[G,1-j,w,1-j,w,1-O,G,1-O]);for(let W=0;W<c;W++)I.push(-g+W*t+x,M-d+b,0),I.push(-g+(W+1)*t+x,M-d+b,0),I.push(-g+(W+1)*t+x,M+b,0),I.push(-g+W*t+x,M+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,e===K.FLIP_TILE||e===K.ROTATE_TILE||e===K.FLIP_N_ROTATE_TILE?C=C.concat(U[(W+_)%2]):e===K.FLIP_ROW||e===K.ROTATE_ROW||e===K.FLIP_N_ROTATE_ROW?C=C.concat(U[_%2]):C=C.concat(U[0]),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(z){const U=[];G=1-h/t,j=0,w=1,O=1,U[0]=[G,j,w,j,w,O,G,O],U[1]=[G,j,w,j,w,O,G,O],(e===K.ROTATE_TILE||e===K.ROTATE_ROW)&&(U[1]=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),(e===K.FLIP_TILE||e===K.FLIP_ROW)&&(U[1]=[1-G,j,1-w,j,1-w,O,1-G,O]),(e===K.FLIP_N_ROTATE_TILE||e===K.FLIP_N_ROTATE_ROW)&&(U[1]=[G,1-j,w,1-j,w,1-O,G,1-O]);for(let W=0;W<_;W++)I.push(T+x,-p+W*i+b,0),I.push(T+h+x,-p+W*i+b,0),I.push(T+h+x,-p+(W+1)*i+b,0),I.push(T+x,-p+(W+1)*i+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,e===K.FLIP_TILE||e===K.ROTATE_TILE||e===K.FLIP_N_ROTATE_TILE?C=C.concat(U[(W+1)%2]):e===K.FLIP_ROW||e===K.ROTATE_ROW||e===K.FLIP_N_ROTATE_ROW?C=C.concat(U[W%2]):C=C.concat(U[0]),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(X){const U=[];G=0,j=0,w=h/i,O=1,U[0]=[G,j,w,j,w,O,G,O],U[1]=[G,j,w,j,w,O,G,O],(e===K.ROTATE_TILE||e===K.ROTATE_ROW)&&(U[1]=[1-G,1-j,1-w,1-j,1-w,1-O,1-G,1-O]),(e===K.FLIP_TILE||e===K.FLIP_ROW)&&(U[1]=[1-G,j,1-w,j,1-w,O,1-G,O]),(e===K.FLIP_N_ROTATE_TILE||e===K.FLIP_N_ROTATE_ROW)&&(U[1]=[G,1-j,w,1-j,w,1-O,G,1-O]);for(let W=0;W<_;W++)I.push(S-h+x,-p+W*i+b,0),I.push(S+x,-p+W*i+b,0),I.push(S+x,-p+(W+1)*i+b,0),I.push(S-h+x,-p+(W+1)*i+b,0),H.push(L,L+1,L+3,L+1,L+2,L+3),L+=4,e===K.FLIP_TILE||e===K.ROTATE_TILE||e===K.FLIP_N_ROTATE_TILE?C=C.concat(U[(W+c)%2]):e===K.FLIP_ROW||e===K.ROTATE_ROW||e===K.FLIP_N_ROTATE_ROW?C=C.concat(U[W%2]):C=C.concat(U[0]),k.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),A.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}const J=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE;Be._ComputeSides(J,I,H,A,C,a.frontUVs,a.backUVs);const te=new Be;te.indices=H,te.positions=I,te.normals=A,te.uvs=C;const ae=J===Be.DOUBLESIDE?k.concat(k):k;return te.colors=ae,te}function Tw(a,e,t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,sl(e).applyToMesh(i,e.updatable),i}let o0=!1;function z1(){o0||(o0=!0,Be.CreateTiledPlane=sl)}const Wc=1,ad=-1;function V1(a){const t=a.faceUV||new Array(6),i=a.faceColors,s=a.pattern||K.NO_FLIP,r=a.width||a.size||1,o=a.height||a.size||1,c=a.depth||a.size||1,h=a.tileWidth||a.tileSize||1,f=a.tileHeight||a.tileSize||1,_=a.alignHorizontal||0,d=a.alignVertical||0,g=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE;for(let B=0;B<6;B++)t[B]===void 0&&(t[B]=new it(0,0,1,1)),i&&i[B]===void 0&&(i[B]=new dt(1,1,1,1));const p=r/2,x=o/2,b=c/2,T=[];for(let B=0;B<2;B++)T[B]=sl({pattern:s,tileWidth:h,tileHeight:f,width:r,height:o,alignVertical:d,alignHorizontal:_,sideOrientation:g});for(let B=2;B<4;B++)T[B]=sl({pattern:s,tileWidth:h,tileHeight:f,width:c,height:o,alignVertical:d,alignHorizontal:_,sideOrientation:g});let R=d;d===K.BOTTOM?R=K.TOP:d===K.TOP&&(R=K.BOTTOM);for(let B=4;B<6;B++)T[B]=sl({pattern:s,tileWidth:h,tileHeight:f,width:r,height:c,alignVertical:R,alignHorizontal:_,sideOrientation:g});const S=[],M=[];let I=[],A=[];const D=[],C=[],k=[],H=[];let L,J=0;for(let B=0;B<6;B++){const $=T[B].positions.length;C[B]=[],k[B]=[];for(let z=0;z<$/3;z++)C[B].push(new E(T[B].positions[3*z],T[B].positions[3*z+1],T[B].positions[3*z+2])),k[B].push(new E(T[B].normals[3*z],T[B].normals[3*z+1],T[B].normals[3*z+2]));L=T[B].uvs.length,H[B]=[];for(let z=0;z<L;z+=2)H[B][z]=t[B].x+(t[B].z-t[B].x)*T[B].uvs[z],H[B][z+1]=t[B].y+(t[B].w-t[B].y)*T[B].uvs[z+1];if(I=I.concat(H[B]),A=A.concat(T[B].indices.map(z=>z+J)),J+=C[B].length,i){const z=i[B];for(let X=0;X<C[B].length;X++)D.push(z.r,z.g,z.b,z.a)}}const te=[{m:se.RotationY(Math.PI),t:new E(0,0,b),op:Wc},{m:se.Identity(),t:new E(0,0,b),op:ad},{m:se.RotationY(-Math.PI/2),t:new E(p,0,0),op:Wc},{m:se.RotationY(Math.PI/2),t:new E(p,0,0),op:ad},{m:se.RotationX(Math.PI/2),t:new E(0,x,0),op:Wc},{m:se.RotationX(-Math.PI/2),t:new E(0,x,0),op:ad}];for(let B=0;B<6;B++){const{m:$,t:z,op:X}=te[B];for(const q of C[B]){const G=E.TransformCoordinates(q,$),j=X===Wc?G.add(z):G.subtract(z);S.push(j.x,j.y,j.z)}for(const q of k[B]){const G=E.TransformNormal(q,$);M.push(G.x,G.y,G.z)}}const ae=new Be;if(ae.indices=A,ae.positions=S,ae.normals=M,ae.uvs=I,i){const B=g===Be.DOUBLESIDE?D.concat(D):D;ae.colors=B}return ae}function Rw(a,e,t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,V1(e).applyToMesh(i,e.updatable),i}let l0=!1;function Aw(){l0||(l0=!0,z1(),Be.CreateTiledBox=V1)}function G1(a){const e=(a.segments||32)|0,t=a.diameterX||a.diameter||1,i=a.diameterY||a.diameter||1,s=a.diameterZ||a.diameter||1,r=a.arc&&(a.arc<=0||a.arc>
1611)?1:a.arc||1,o=a.slice&&a.slice<=0?1:a.slice||1,c=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,h=!!a.dedupTopBottomIndices,f=new E(t/2,i/2,s/2),_=2+e,d=2*_,g=[],p=[],x=[],b=[];for(let R=0;R<=_;R++){const S=R/_,M=S*Math.PI*o;for(let I=0;I<=d;I++){const A=I/d,D=A*Math.PI*2*r,C=se.RotationZ(-M),k=se.RotationY(D),H=E.TransformCoordinates(E.Up(),C),L=E.TransformCoordinates(H,k),J=L.multiply(f),te=L.divide(f).normalize();p.push(J.x,J.y,J.z),x.push(te.x,te.y,te.z),b.push(A,S)}if(R>0){const I=p.length/3;for(let A=I-2*(d+1);A+d+2<I;A++)h?(R>1&&(g.push(A),g.push(A+1),g.push(A+d+1)),(R<_||o<1)&&(g.push(A+d+1),g.push(A+1),g.push(A+d+2))):(g.push(A),g.push(A+1),g.push(A+d+1),g.push(A+d+1),g.push(A+1),g.push(A+d+2))}}Be._ComputeSides(c,p,g,x,b,a.frontUVs,a.backUVs);const T=new Be;return T.indices=g,T.positions=p,T.normals=x,T.uvs=b,T}function H1(a,e={},t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,G1(e).applyToMesh(i,e.updatable),i}let c0=!1;function Mw(){c0||(c0=!0,Be.CreateSphere=G1,K.CreateSphere=(a,e,t,i,s,r)=>H1(a,{segments:e,diameterX:t,diameterY:t,diameterZ:t,sideOrientation:r,updatable:s},i))}class h0{constructor(){this._count=0,this._data={}}copyFrom(e){this.clear(),e.forEach((t,i)=>this.add(t,i))}get(e){const t=this._data[e];if(t!==void 0)return t}getOrAddWithFactory(e,t){let i=this.get(e);return i!==void 0||(i=t(e),i&&this.add(e,i)),i}getOrAdd(e,t){const i=this.get(e);return i!==void 0?i:(this.add(e,t),t)}contains(e){return this._data[e]!==void 0}add(e,t){return this._data[e]!==void 0?!1:(this._data[e]=t,++this._count,!0)}set(e,t){return this._data[e]===void 0?!1:(this._data[e]=t,!0)}getAndRemove(e){const t=this.get(e);return t!==void 0?(delete this._data[e],--this._count,t):null}remove(e){return this.contains(e)?(delete this._data[e],--this._count,!0):!1}clear(){this._data={},this._count=0}get count(){return this._count}forEach(e){for(const t in this._data){const i=this._data[t];e(t,i)}}first(e){for(const t in this._data){const i=this._data[t],s=e(t,i);if(s)return s}return null}}function W1(a){a.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}let Sw=(()=>{var a;let e,t=[],i=[],s,r=[],o=[],c,h=[],f=[],_,d=[],g=[],p,x=[],b=[],T,R=[],S=[],M,I=[],A=[],D,C=[],k=[],H,L=[],J=[],te,ae=[],B=[],$,z=[],X=[],q,G=[],j=[];return a=class{constructor(){this._dirty=!0,this._tempColor=new dt(0,0,0,0),this._globalCurve=new dt(0,0,0,0),this._highlightsCurve=new dt(0,0,0,0),this._midtonesCurve=new dt(0,0,0,0),this._shadowsCurve=new dt(0,0,0,0),this._positiveCurve=new dt(0,0,0,0),this._negativeCurve=new dt(0,0,0,0),this._globalHue=Z(this,t,30),this._globalDensity=(Z(this,i),Z(this,r,0)),this._globalSaturation=(Z(this,o),Z(this,h,0)),this._globalExposure=(Z(this,f),Z(this,d,0)),this._highlightsHue=(Z(this,g),Z(this,x,30)),this._highlightsDensity=(Z(this,b),Z(this,R,0)),this._highlightsSaturation=(Z(this,S),Z(this,I,0)),this._highlightsExposure=(Z(this,A),Z(this,C,0)),this._midtonesHue=(Z(this,k),Z(this,L,30)),this._midtonesDensity=(Z(this,J),Z(this,ae,0)),this._midtonesSaturation=(Z(this,B),Z(this,z,0)),this._midtonesExposure=(Z(this,X),Z(this,G,0)),this._shadowsHue=(Z(this,j),30),this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}get globalHue(){return this._globalHue}set globalHue(O){this._globalHue=O,this._dirty=!0}get globalDensity(){return this._globalDensity}set globalDensity(O){this._globalDensity=O,this._dirty=!0}get globalSaturation(){return this._globalSaturation}set globalSaturation(O){this._globalSaturation=O,this._dirty=!0}get globalExposure(){return this._globalExposure}set globalExposure(O){this._globalExposure=O,this._dirty=!0}get highlightsHue(){return this._highlightsHue}set highlightsHue(O){this._highlightsHue=O,this._dirty=!0}get highlightsDensity(){return this._highlightsDensity}set highlightsDensity(O){this._highlightsDensity=O,this._dirty=!0}get highlightsSaturation(){return this._highlightsSaturation}set highlightsSaturation(O){this._highlightsSaturation=O,this._dirty=!0}get highlightsExposure(){return this._highlightsExposure}set highlightsExposure(O){this._highlightsExposure=O,this._dirty=!0}get midtonesHue(){return this._midtonesHue}set midtonesHue(O){this._midtonesHue=O,this._dirty=!0}get midtonesDensity(){return this._midtonesDensity}set midtonesDensity(O){this._midtonesDensity=O,this._dirty=!0}get midtonesSaturation(){return this._midtonesSaturation}set midtonesSaturation(O){this._midtonesSaturation=O,this._dirty=!0}get midtonesExposure(){return this._midtonesExposure}set midtonesExposure(O){this._midtonesExposure=O,this._dirty=!0}
vendor: 19,912 bytes, line 161
161get shadowsHue(){return this._shadowsHue}set shadowsHue(O){this._shadowsHue=O,this._dirty=!0}get shadowsDensity(){return this._shadowsDensity}set shadowsDensity(O){this._shadowsDensity=O,this._dirty=!0}get shadowsSaturation(){return this._shadowsSaturation}set shadowsSaturation(O){this._shadowsSaturation=O,this._dirty=!0}get shadowsExposure(){return this._shadowsExposure}set shadowsExposure(O){this._shadowsExposure=O,this._dirty=!0}getClassName(){return"ColorCurves"}_getColorGradingDataToRef(O,U,W,oe,le){O!=null&&(O=a._Clamp(O,0,360),U=a._Clamp(U,-100,100),W=a._Clamp(W,-100,100),oe=a._Clamp(oe,-100,100),U=a._ApplyColorGradingSliderNonlinear(U),U*=.5,oe=a._ApplyColorGradingSliderNonlinear(oe),U<0&&(U*=-1,O=(O+180)%360),a._FromHSBToRef(O,U,50+.25*oe,le),le.scaleToRef(2,le),le.a=1+.01*W)}static _ApplyColorGradingSliderNonlinear(O){O/=100;let U=Math.abs(O);return U=Math.pow(U,2),O<0&&(U*=-1),U*=100,U}static _FromHSBToRef(O,U,W,oe){let le=a._Clamp(O,0,360);const be=a._Clamp(U/100,0,1),Ee=a._Clamp(W/100,0,1);if(be===0)oe.r=Ee,oe.g=Ee,oe.b=Ee;else{le/=60;const Fe=Math.floor(le),Y=le-Fe,ue=Ee*(1-be),de=Ee*(1-be*Y),we=Ee*(1-be*(1-Y));switch(Fe){case 0:oe.r=Ee,oe.g=we,oe.b=ue;break;case 1:oe.r=de,oe.g=Ee,oe.b=ue;break;case 2:oe.r=ue,oe.g=Ee,oe.b=we;break;case 3:oe.r=ue,oe.g=de,oe.b=Ee;break;case 4:oe.r=we,oe.g=ue,oe.b=Ee;break;default:oe.r=Ee,oe.g=ue,oe.b=de;break}}oe.a=1}static _Clamp(O,U,W){return Math.min(Math.max(O,U),W)}clone(){return Rt.Clone(()=>new a,this)}serialize(){return Rt.Serialize(this)}_bind(O,U="vCameraColorCurvePositive",W="vCameraColorCurveNeutral",oe="vCameraColorCurveNegative"){this._dirty&&(this._dirty=!1,this._getColorGradingDataToRef(this._globalHue,this._globalDensity,this._globalSaturation,this._globalExposure,this._globalCurve),this._getColorGradingDataToRef(this._highlightsHue,this._highlightsDensity,this._highlightsSaturation,this._highlightsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._highlightsCurve),this._getColorGradingDataToRef(this._midtonesHue,this._midtonesDensity,this._midtonesSaturation,this._midtonesExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._midtonesCurve),this._getColorGradingDataToRef(this._shadowsHue,this._shadowsDensity,this._shadowsSaturation,this._shadowsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._shadowsCurve),this._highlightsCurve.subtractToRef(this._midtonesCurve,this._positiveCurve),this._midtonesCurve.subtractToRef(this._shadowsCurve,this._negativeCurve)),O&&(O.setFloat4(U,this._positiveCurve.r,this._positiveCurve.g,this._positiveCurve.b,this._positiveCurve.a),O.setFloat4(W,this._midtonesCurve.r,this._midtonesCurve.g,this._midtonesCurve.b,this._midtonesCurve.a),O.setFloat4(oe,this._negativeCurve.r,this._negativeCurve.g,this._negativeCurve.b,this._negativeCurve.a))}},(()=>{const w=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[pe()],s=[pe()],c=[pe()],_=[pe()],p=[pe()],T=[pe()],M=[pe()],D=[pe()],H=[pe()],te=[pe()],$=[pe()],q=[pe()],he(null,null,e,{kind:"field",name:"_globalHue",static:!1,private:!1,access:{has:O=>"_globalHue"in O,get:O=>O._globalHue,set:(O,U)=>{O._globalHue=U}},metadata:w},t,i),he(null,null,s,{kind:"field",name:"_globalDensity",static:!1,private:!1,access:{has:O=>"_globalDensity"in O,get:O=>O._globalDensity,set:(O,U)=>{O._globalDensity=U}},metadata:w},r,o),he(null,null,c,{kind:"field",name:"_globalSaturation",static:!1,private:!1,access:{has:O=>"_globalSaturation"in O,get:O=>O._globalSaturation,set:(O,U)=>{O._globalSaturation=U}},metadata:w},h,f),he(null,null,_,{kind:"field",name:"_globalExposure",static:!1,private:!1,access:{has:O=>"_globalExposure"in O,get:O=>O._globalExposure,set:(O,U)=>{O._globalExposure=U}},metadata:w},d,g),he(null,null,p,{kind:"field",name:"_highlightsHue",static:!1,private:!1,access:{has:O=>"_highlightsHue"in O,get:O=>O._highlightsHue,set:(O,U)=>{O._highlightsHue=U}},metadata:w},x,b),he(null,null,T,{kind:"field",name:"_highlightsDensity",static:!1,private:!1,access:{has:O=>"_highlightsDensity"in O,get:O=>O._highlightsDensity,set:(O,U)=>{O._highlightsDensity=U}},metadata:w},R,S),he(null,null,M,{kind:"field",name:"_highlightsSaturation",static:!1,private:!1,access:{has:O=>"_highlightsSaturation"in O,get:O=>O._highlightsSaturation,set:(O,U)=>{O._highlightsSaturation=U}},metadata:w},I,A),he(null,null,D,{kind:"field",name:"_highlightsExposure",static:!1,private:!1,access:{has:O=>"_highlightsExposure"in O,get:O=>O._highlightsExposure,set:(O,U)=>{O._highlightsExposure=U}},metadata:w},C,k),he(null,null,H,{kind:"field",name:"_midtonesHue",static:!1,private:!1,access:{has:O=>"_midtonesHue"in O,get:O=>O._midtonesHue,set:(O,U)=>{O._midtonesHue=U}},metadata:w},L,J),he(null,null,te,{kind:"field",name:"_midtonesDensity",static:!1,private:!1,access:{has:O=>"_midtonesDensity"in O,get:O=>O._midtonesDensity,set:(O,U)=>{O._midtonesDensity=U}},metadata:w},ae,B),he(null,null,$,{kind:"field",name:"_midtonesSaturation",static:!1,private:!1,access:{has:O=>"_midtonesSaturation"in O,get:O=>O._midtonesSaturation,set:(O,U)=>{O._midtonesSaturation=U}},metadata:w},z,X),he(null,null,q,{kind:"field",name:"_midtonesExposure",static:!1,private:!1,access:{has:O=>"_midtonesExposure"in O,get:O=>O._midtonesExposure,set:(O,U)=>{O._midtonesExposure=U}},metadata:w},G,j),w&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w})})(),a.PrepareUniforms=W1,a})();function Ew(a,e,t="vCameraColorCurvePositive",i="vCameraColorCurveNeutral",s="vCameraColorCurveNegative"){a._bind(e,t,i,s)}function Cw(a,e){e.EXPOSURE&&a.push("exposureLinear"),e.CONTRAST&&a.push("contrast"),e.COLORGRADING&&a.push("colorTransformSettings"),(e.VIGNETTE||e.DITHER)&&a.push("vInverseScreenSize"),e.VIGNETTE&&(a.push("vignetteSettings1"),a.push("vignetteSettings2")),e.COLORCURVES&&W1(a),e.DITHER&&a.push("ditherIntensity")}function Dw(a,e){e.COLORGRADING&&a.push("txColorTransform")}let u0=(()=>{var a;let e,t=[],i=[],s,r=[],o=[],c,h=[],f=[],_,d=[],g=[],p,x=[],b=[],T,R=[],S=[],M,I=[],A=[],D,C=[],k=[],H,L=[],J=[],te,ae=[],B=[],$,z=[],X=[],q,G=[],j=[],w,O=[],U=[],W,oe=[],le=[],be,Ee=[],Fe=[],Y,ue=[],de=[],we,qe=[],ke=[],ut,Gt=[],Ot=[],pt,Nt=[],Ft=[],$e,ie=[],Pe=[],ei,Xt=[],ai=[],Kt,Zt=[],At=[],ti,Dt=[],zt=[],ii,mi=[],gi=[],_n,zs=[],ji=[];return a=class{constructor(){this.colorCurves=Z(this,t,new Sw),this._colorCurvesEnabled=(Z(this,i),Z(this,r,!1)),this._colorGradingTexture=(Z(this,o),Z(this,h,void 0)),this._colorGradingEnabled=(Z(this,f),Z(this,d,!1)),this._colorGradingWithGreenDepth=(Z(this,g),Z(this,x,!0)),this._colorGradingBGR=(Z(this,b),Z(this,R,!0)),this._exposure=(Z(this,S),Z(this,I,1)),this._toneMappingEnabled=(Z(this,A),Z(this,C,!1)),this._toneMappingType=(Z(this,k),Z(this,L,a.TONEMAPPING_STANDARD)),this._contrast=(Z(this,J),Z(this,ae,1)),this.vignetteStretch=(Z(this,B),Z(this,z,0)),this.vignetteCenterX=(Z(this,X),Z(this,G,0)),this.vignetteCenterY=(Z(this,j),Z(this,O,0)),this.vignetteWeight=(Z(this,U),Z(this,oe,1.5)),this.vignetteColor=(Z(this,le),Z(this,Ee,new dt(0,0,0,0))),this.vignetteCameraFov=(Z(this,Fe),Z(this,ue,.5)),this._vignetteBlendMode=(Z(this,de),Z(this,qe,a.VIGNETTEMODE_MULTIPLY)),this._vignetteEnabled=(Z(this,ke),Z(this,Gt,!1)),this._ditheringEnabled=(Z(this,Ot),Z(this,Nt,!1)),this._ditheringIntensity=(Z(this,Ft),Z(this,ie,1/255)),this._skipFinalColorClamp=(Z(this,Pe),Z(this,Xt,!1)),this._applyByPostProcess=(Z(this,ai),Z(this,Zt,!1)),this._isEnabled=(Z(this,At),Z(this,Dt,!0)),this.outputTextureWidth=(Z(this,zt),Z(this,mi,0)),this.outputTextureHeight=(Z(this,gi),Z(this,zs,0)),this.onUpdateParameters=(Z(this,ji),new Ae)}get colorCurvesEnabled(){return this._colorCurvesEnabled}set colorCurvesEnabled(Q){this._colorCurvesEnabled!==Q&&(this._colorCurvesEnabled=Q,this._updateParameters())}get colorGradingTexture(){return this._colorGradingTexture}set colorGradingTexture(Q){this._colorGradingTexture!==Q&&(this._colorGradingTexture=Q,this._updateParameters())}get colorGradingEnabled(){return this._colorGradingEnabled}set colorGradingEnabled(Q){this._colorGradingEnabled!==Q&&(this._colorGradingEnabled=Q,this._updateParameters())}get colorGradingWithGreenDepth(){return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(Q){this._colorGradingWithGreenDepth!==Q&&(this._colorGradingWithGreenDepth=Q,this._updateParameters())}get colorGradingBGR(){return this._colorGradingBGR}set colorGradingBGR(Q){this._colorGradingBGR!==Q&&(this._colorGradingBGR=Q,this._updateParameters())}get exposure(){return this._exposure}set exposure(Q){this._exposure!==Q&&(this._exposure=Q,this._updateParameters())}get toneMappingEnabled(){return this._toneMappingEnabled}set toneMappingEnabled(Q){this._toneMappingEnabled!==Q&&(this._toneMappingEnabled=Q,this._updateParameters())}get toneMappingType(){return this._toneMappingType}set toneMappingType(Q){this._toneMappingType!==Q&&(this._toneMappingType=Q,this._updateParameters())}get contrast(){return this._contrast}set contrast(Q){this._contrast!==Q&&(this._contrast=Q,this._updateParameters())}get vignetteCentreY(){return this.vignetteCenterY}set vignetteCentreY(Q){this.vignetteCenterY=Q}get vignetteCentreX(){return this.vignetteCenterX}set vignetteCentreX(Q){this.vignetteCenterX=Q}get vignetteBlendMode(){return this._vignetteBlendMode}set vignetteBlendMode(Q){this._vignetteBlendMode!==Q&&(this._vignetteBlendMode=Q,this._updateParameters())}get vignetteEnabled(){return this._vignetteEnabled}set vignetteEnabled(Q){this._vignetteEnabled!==Q&&(this._vignetteEnabled=Q,this._updateParameters())}get ditheringEnabled(){return this._ditheringEnabled}set ditheringEnabled(Q){this._ditheringEnabled!==Q&&(this._ditheringEnabled=Q,this._updateParameters())}get ditheringIntensity(){return this._ditheringIntensity}set ditheringIntensity(Q){this._ditheringIntensity!==Q&&(this._ditheringIntensity=Q,this._updateParameters())}get skipFinalColorClamp(){return this._skipFinalColorClamp}set skipFinalColorClamp(Q){this._skipFinalColorClamp!==Q&&(this._skipFinalColorClamp=Q,this._updateParameters())}get applyByPostProcess(){return this._applyByPostProcess}set applyByPostProcess(Q){this._applyByPostProcess!==Q&&(this._applyByPostProcess=Q,this._updateParameters())}get isEnabled(){return this._isEnabled}set isEnabled(Q){this._isEnabled!==Q&&(this._isEnabled=Q,this._updateParameters())}_updateParameters(){this.onUpdateParameters.notifyObservers(this)}getClassName(){return"ImageProcessingConfiguration"}prepareDefines(Q,Ze=!1){if(Ze!==this.applyByPostProcess||!this._isEnabled){Q.VIGNETTE=!1,Q.TONEMAPPING=0,Q.CONTRAST=!1,Q.EXPOSURE=!1,Q.COLORCURVES=!1,Q.COLORGRADING=!1,Q.COLORGRADING3D=!1,Q.DITHER=!1,Q.IMAGEPROCESSING=!1,Q.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,Q.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled;return}if(Q.VIGNETTE=this.vignetteEnabled,Q.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===a._VIGNETTEMODE_MULTIPLY,Q.VIGNETTEBLENDMODEOPAQUE=!Q.VIGNETTEBLENDMODEMULTIPLY,!this._toneMappingEnabled)Q.TONEMAPPING=0;else switch(this._toneMappingType){case a.TONEMAPPING_KHR_PBR_NEUTRAL:Q.TONEMAPPING=3;break;case a.TONEMAPPING_ACES:Q.TONEMAPPING=2;break;default:Q.TONEMAPPING=1;break}Q.CONTRAST=this.contrast!==1,Q.EXPOSURE=this.exposure!==1,Q.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,Q.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,Q.COLORGRADING?Q.COLORGRADING3D=this.colorGradingTexture.is3D:Q.COLORGRADING3D=!1,Q.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,Q.SAMPLER3DBGRMAP=this.colorGradingBGR,Q.DITHER=this._ditheringEnabled,Q.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,Q.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,Q.IMAGEPROCESSING=Q.VIGNETTE||!!Q.TONEMAPPING||Q.CONTRAST||Q.EXPOSURE||Q.COLORCURVES||Q.COLORGRADING||Q.DITHER}isReady(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(Q,Ze){if(this._colorCurvesEnabled&&this.colorCurves&&Ew(this.colorCurves,Q),this._vignetteEnabled||this._ditheringEnabled){const Ri=1/(this.outputTextureWidth||Q.getEngine().getRenderWidth()),ot=1/(this.outputTextureHeight||Q.getEngine().getRenderHeight());if(Q.setFloat2("vInverseScreenSize",Ri,ot),this._ditheringEnabled&&Q.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){const ze=Ze??ot/Ri;let N=Math.tan(this.vignetteCameraFov*.5),xe=N*ze;const ht=Math.sqrt(xe*N);xe=Vy(xe,ht,this.vignetteStretch),N=Vy(N,ht,this.vignetteStretch),Q.setFloat4("vignetteSettings1",xe,N,-xe*this.vignetteCenterX,-N*this.vignetteCenterY);const Ye=-2*this.vignetteWeight;Q.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,Ye)}}if(Q.setFloat("exposureLinear",this.exposure),Q.setFloat("contrast",this.contrast),this.colorGradingTexture){Q.setTexture("txColorTransform",this.colorGradingTexture);const Ri=this.colorGradingTexture.getSize().height;Q.setFloat4("colorTransformSettings",(Ri-1)/Ri,.5/Ri,Ri,this.colorGradingTexture.level)}}clone(){return Rt.Clone(()=>new a,this)}serialize(){return Rt.Serialize(this)}static get VIGNETTEMODE_MULTIPLY(){return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){return this._VIGNETTEMODE_OPAQUE}},(()=>{const Tt=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[eI()],s=[pe()],c=[a1("colorGradingTexture")],_=[pe()],p=[pe()],T=[pe()],M=[pe()],D=[pe()],H=[pe()],te=[pe()],$=[pe()],q=[pe()],w=[pe()],W=[pe()],be=[tI()],Y=[pe()],we=[pe()],ut=[pe()],pt=[pe()],$e=[pe()],ei=[pe()],Kt=[pe()],ti=[pe()],ii=[pe()],_n=[pe()],he(null,null,e,{kind:"field",name:"colorCurves",static:!1,private:!1,access:{has:Q=>"colorCurves"in Q,get:Q=>Q.colorCurves,set:(Q,Ze)=>{Q.colorCurves=Ze}},metadata:Tt},t,i),he(null,null,s,{kind:"field",name:"_colorCurvesEnabled",static:!1,private:!1,access:{has:Q=>"_colorCurvesEnabled"in Q,get:Q=>Q._colorCurvesEnabled,set:(Q,Ze)=>{Q._colorCurvesEnabled=Ze}},metadata:Tt},r,o),he(null,null,c,{kind:"field",name:"_colorGradingTexture",static:!1,private:!1,access:{has:Q=>"_colorGradingTexture"in Q,get:Q=>Q._colorGradingTexture,set:(Q,Ze)=>{Q._colorGradingTexture=Ze}},metadata:Tt},h,f),he(null,null,_,{kind:"field",name:"_colorGradingEnabled",static:!1,private:!1,access:{has:Q=>"_colorGradingEnabled"in Q,get:Q=>Q._colorGradingEnabled,set:(Q,Ze)=>{Q._colorGradingEnabled=Ze}},metadata:Tt},d,g),he(null,null,p,{kind:"field",name:"_colorGradingWithGreenDepth",static:!1,private:!1,access:{has:Q=>"_colorGradingWithGreenDepth"in Q,get:Q=>Q._colorGradingWithGreenDepth,set:(Q,Ze)=>{Q._colorGradingWithGreenDepth=Ze}},metadata:Tt},x,b),he(null,null,T,{kind:"field",name:"_colorGradingBGR",static:!1,private:!1,access:{has:Q=>"_colorGradingBGR"in Q,get:Q=>Q._colorGradingBGR,set:(Q,Ze)=>{Q._colorGradingBGR=Ze}},metadata:Tt},R,S),he(null,null,M,{kind:"field",name:"_exposure",static:!1,private:!1,access:{has:Q=>"_exposure"in Q,get:Q=>Q._exposure,set:(Q,Ze)=>{Q._exposure=Ze}},metadata:Tt},I,A),he(null,null,D,{kind:"field",name:"_toneMappingEnabled",static:!1,private:!1,access:{has:Q=>"_toneMappingEnabled"in Q,get:Q=>Q._toneMappingEnabled,set:(Q,Ze)=>{Q._toneMappingEnabled=Ze}},metadata:Tt},C,k),he(null,null,H,{kind:"field",name:"_toneMappingType",static:!1,private:!1,access:{has:Q=>"_toneMappingType"in Q,get:Q=>Q._toneMappingType,set:(Q,Ze)=>{Q._toneMappingType=Ze}},metadata:Tt},L,J),he(null,null,te,{kind:"field",name:"_contrast",static:!1,private:!1,access:{has:Q=>"_contrast"in Q,get:Q=>Q._contrast,set:(Q,Ze)=>{Q._contrast=Ze}},metadata:Tt},ae,B),he(null,null,$,{kind:"field",name:"vignetteStretch",static:!1,private:!1,access:{has:Q=>"vignetteStretch"in Q,get:Q=>Q.vignetteStretch,set:(Q,Ze)=>{Q.vignetteStretch=Ze}},metadata:Tt},z,X),he(null,null,q,{kind:"field",name:"vignetteCenterX",static:!1,private:!1,access:{has:Q=>"vignetteCenterX"in Q,get:Q=>Q.vignetteCenterX,set:(Q,Ze)=>{Q.vignetteCenterX=Ze}},metadata:Tt},G,j),he(null,null,w,{kind:"field",name:"vignetteCenterY",static:!1,private:!1,access:{has:Q=>"vignetteCenterY"in Q,get:Q=>Q.vignetteCenterY,set:(Q,Ze)=>{Q.vignetteCenterY=Ze}},metadata:Tt},O,U),he(null,null,W,{kind:"field",name:"vignetteWeight",static:!1,private:!1,access:{has:Q=>"vignetteWeight"in Q,get:Q=>Q.vignetteWeight,set:(Q,Ze)=>{Q.vignetteWeight=Ze}},metadata:Tt},oe,le),he(null,null,be,{kind:"field",name:"vignetteColor",static:!1,private:!1,access:{has:Q=>"vignetteColor"in Q,get:Q=>Q.vignetteColor,set:(Q,Ze)=>{Q.vignetteColor=Ze}},metadata:Tt},Ee,Fe),he(null,null,Y,{kind:"field",name:"vignetteCameraFov",static:!1,private:!1,access:{has:Q=>"vignetteCameraFov"in Q,get:Q=>Q.vignetteCameraFov,set:(Q,Ze)=>{Q.vignetteCameraFov=Ze}},metadata:Tt},ue,de),he(null,null,we,{kind:"field",name:"_vignetteBlendMode",static:!1,private:!1,access:{has:Q=>"_vignetteBlendMode"in Q,get:Q=>Q._vignetteBlendMode,set:(Q,Ze)=>{Q._vignetteBlendMode=Ze}},metadata:Tt},qe,ke),he(null,null,ut,{kind:"field",name:"_vignetteEnabled",static:!1,private:!1,access:{has:Q=>"_vignetteEnabled"in Q,get:Q=>Q._vignetteEnabled,set:(Q,Ze)=>{Q._vignetteEnabled=Ze}},metadata:Tt},Gt,Ot),he(null,null,pt,{kind:"field",name:"_ditheringEnabled",static:!1,private:!1,access:{has:Q=>"_ditheringEnabled"in Q,get:Q=>Q._ditheringEnabled,set:(Q,Ze)=>{Q._ditheringEnabled=Ze}},metadata:Tt},Nt,Ft),he(null,null,$e,{kind:"field",name:"_ditheringIntensity",static:!1,private:!1,access:{has:Q=>"_ditheringIntensity"in Q,get:Q=>Q._ditheringIntensity,set:(Q,Ze)=>{Q._ditheringIntensity=Ze}},metadata:Tt},ie,Pe),he(null,null,ei,{kind:"field",name:"_skipFinalColorClamp",static:!1,private:!1,access:{has:Q=>"_skipFinalColorClamp"in Q,get:Q=>Q._skipFinalColorClamp,set:(Q,Ze)=>{Q._skipFinalColorClamp=Ze}},metadata:Tt},Xt,ai),he(null,null,Kt,{kind:"field",name:"_applyByPostProcess",static:!1,private:!1,access:{has:Q=>"_applyByPostProcess"in Q,get:Q=>Q._applyByPostProcess,set:(Q,Ze)=>{Q._applyByPostProcess=Ze}},metadata:Tt},Zt,At),he(null,null,ti,{kind:"field",name:"_isEnabled",static:!1,private:!1,access:{has:Q=>"_isEnabled"in Q,get:Q=>Q._isEnabled,set:(Q,Ze)=>{Q._isEnabled=Ze}},metadata:Tt},Dt,zt),he(null,null,ii,{kind:"field",name:"outputTextureWidth",static:!1,private:!1,access:{has:Q=>"outputTextureWidth"in Q,get:Q=>Q.outputTextureWidth,set:(Q,Ze)=>{Q.outputTextureWidth=Ze}},metadata:Tt},mi,gi),he(null,null,_n,{kind:"field",name:"outputTextureHeight",static:!1,private:!1,access:{has:Q=>"outputTextureHeight"in Q,get:Q=>Q.outputTextureHeight,set:(Q,Ze)=>{Q.outputTextureHeight=Ze}},metadata:Tt},zs,ji),Tt&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Tt})})(),a.TONEMAPPING_STANDARD=0,a.TONEMAPPING_ACES=1,a.TONEMAPPING_KHR_PBR_NEUTRAL=2,a.PrepareUniforms=Cw,a.PrepareSamplers=Dw,a._VIGNETTEMODE_MULTIPLY=0,a._VIGNETTEMODE_OPAQUE=1,a})();class Pi{constructor(e,t,i,s,r,o){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=s,this.sourceEvent=r,this.additionalData=o}static CreateNew(e,t,i){const s=e.getScene();return new Pi(e,s.pointerX,s.pointerY,s.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,s){return new Pi(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,s)}static CreateNewFromScene(e,t){return new Pi(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,s){return new Pi(e,t.x,t.y,null,i,s)}}class f0{constructor(e){this._vertexBuffers={},this._activePostProcesses=[],this.onBeforeRenderObservable=new Ae,this._scene=e}_prepareBuffers(){if(this._vertexBuffers[F.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[F.PositionKind]=new F(this._scene.getEngine(),e,F.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_getActivePostProcesses(e){const t=this._activePostProcesses;t.length=0;for(let i=0;i<e.length;i++){const s=e[i];
161s&&t.push(s)}return t}_rebuild(){const e=this._vertexBuffers[F.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){const i=this._scene.activeCamera;return!i||(t=t||this._getActivePostProcesses(i._postProcesses),!t||t.length===0||!this._scene.postProcessesEnabled)?!1:(t[0].activate(i,e,t!=null),!0)}directRender(e,t=null,i=!1,s=0,r=0,o=!1,c=e.length){const h=this._scene.getEngine();for(let f=0;f<c;f++){f<e.length-1?e[f+1].activate(this._scene.activeCamera||this._scene,t?.texture):(t?h.bindFramebuffer(t,s,void 0,void 0,i,r):o||h.restoreDefaultFramebuffer(),h._debugInsertMarker?.(`post process ${e[f].name} output`));const _=e[f],d=_.apply();d&&(_.onBeforeRenderObservable.notifyObservers(d),this._prepareBuffers(),h.bindBuffers(this._vertexBuffers,this._indexBuffer,d),h.drawElementsType(0,0,6),_.onAfterRenderObservable.notifyObservers(d))}h.setDepthBuffer(!0),h.setDepthWrite(!0)}_finalizeFrame(e,t,i,s,r=!1){const o=this._scene.activeCamera;if(!o||(this.onBeforeRenderObservable.notifyObservers(this),s=s||this._getActivePostProcesses(o._postProcesses),s.length===0||!this._scene.postProcessesEnabled))return;const c=this._scene.getEngine();for(let h=0,f=s.length;h<f;h++){const _=s[h];if(h<f-1?_._outputTexture=s[h+1].activate(o,t?.texture):(t?(c.bindFramebuffer(t,i,void 0,void 0,r),_._outputTexture=t):(c.restoreDefaultFramebuffer(),_._outputTexture=null),c._debugInsertMarker?.(`post process ${s[h].name} output`)),e)break;const d=_.apply();d&&(_.onBeforeRenderObservable.notifyObservers(d),this._prepareBuffers(),c.bindBuffers(this._vertexBuffers,this._indexBuffer,d),c.drawElementsType(0,0,6),_.onAfterRenderObservable.notifyObservers(d))}c.setDepthBuffer(!0),c.setDepthWrite(!0),c.setAlphaMode(0)}dispose(){const e=this._vertexBuffers[F.PositionKind];e&&(e.dispose(),this._vertexBuffers[F.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)}}class Ws{set opaqueSortCompareFn(e){e?this._opaqueSortCompareFn=e:this._opaqueSortCompareFn=Ws.PainterSortCompare,this._renderOpaque=this._renderOpaqueSorted}set alphaTestSortCompareFn(e){e?this._alphaTestSortCompareFn=e:this._alphaTestSortCompareFn=Ws.PainterSortCompare,this._renderAlphaTest=this._renderAlphaTestSorted}set transparentSortCompareFn(e){e?this._transparentSortCompareFn=e:this._transparentSortCompareFn=Ws.defaultTransparentSortCompare,this._renderTransparent=this._renderTransparentSorted}constructor(e,t,i=null,s=null,r=null){this.index=e,this._opaqueSubMeshes=new ds(256),this._transparentSubMeshes=new ds(256),this._alphaTestSubMeshes=new ds(256),this._depthOnlySubMeshes=new ds(256),this._particleSystems=new ds(256),this._spriteManagers=new ds(256),this._empty=!0,this._edgesRenderers=new qr(16),this.disableDepthPrePass=!1,this._scene=t,this.opaqueSortCompareFn=i,this.alphaTestSortCompareFn=s,this.transparentSortCompareFn=r}render(e,t,i,s,r=!0,o=!0,c=!0,h=!0,f){if(e){e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);return}const _=this._scene.getEngine();r&&this._depthOnlySubMeshes.length!==0&&(_.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),_.setColorWrite(!0)),o&&this._opaqueSubMeshes.length!==0&&this._renderOpaque(this._opaqueSubMeshes),c&&this._alphaTestSubMeshes.length!==0&&this._renderAlphaTest(this._alphaTestSubMeshes);const d=_.getStencilBuffer();if(_.setStencilBuffer(!1),t&&this._renderSprites(),i&&this._renderParticles(s),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),h&&(f||this._transparentSubMeshes.length!==0||this._scene.useOrderIndependentTransparency)){if(_.setStencilBuffer(d),f)f(this._transparentSubMeshes,this);else if(this._scene.useOrderIndependentTransparency){const g=this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);
vendor: 50,965 bytes, line 161
161g.length&&this._renderTransparent(g)}else this._renderTransparent(this._transparentSubMeshes);_.setAlphaMode(0)}if(_.setStencilBuffer(!1),o&&this._edgesRenderers.length){for(let g=0;g<this._edgesRenderers.length;g++)this._edgesRenderers.data[g].render();_.setAlphaMode(0)}_.setStencilBuffer(d)}_renderOpaqueSorted(e){Ws._RenderSorted(e,this._opaqueSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderAlphaTestSorted(e){Ws._RenderSorted(e,this._alphaTestSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderTransparentSorted(e){Ws._RenderSorted(e,this._transparentSortCompareFn,this._scene.activeCamera,!0,this.disableDepthPrePass)}static _RenderSorted(e,t,i,s,r){let o=0,c;const h=i?i.globalPosition:Ws._ZeroVector;if(s)for(;o<e.length;o++)c=e.data[o],c._alphaIndex=c.getMesh().alphaIndex,c._distanceToCamera=E.Distance(c.getBoundingInfo().boundingSphere.centerWorld,h);const f=e.length===e.data.length?e.data:e.data.slice(0,e.length);t&&f.sort(t);const _=f[0].getMesh().getScene();for(o=0;o<f.length;o++)if(c=f[o],!(_._activeMeshesFrozenButKeepClipping&&!c.isInFrustum(_._frustumPlanes))){if(s){const d=c.getMaterial();if(d&&d.needDepthPrePass&&!r){const g=d.getScene().getEngine();g.setColorWrite(!1),g.setAlphaMode(0),c.render(!1),g.setColorWrite(!0)}}c.render(s)}}static defaultTransparentSortCompare(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:Ws.backToFrontSortCompare(e,t)}static backToFrontSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?-1:e._distanceToCamera>t._distanceToCamera?1:0}static PainterSortCompare(e,t){const i=e.getMesh(),s=t.getMesh();return i.material&&s.material?i.material.uniqueId-s.material.uniqueId:i.uniqueId-s.uniqueId}prepare(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){this._spriteManagers.reset()}dispose(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,i){t===void 0&&(t=e.getMesh()),i===void 0&&(i=e.getMaterial()),i!=null&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTestingForMesh(t)?(i.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t.isEnabled()&&t.isVisible&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){this._particleSystems.push(e),this._empty=!1}_renderParticles(e){if(this._particleSystems.length===0)return;const t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let i=0;i<this._particleSystems.length;i++){const s=this._particleSystems.data[i];if((t&&t.layerMask&s.layerMask)===0)continue;const r=s.emitter;(!r.position||!e||e.indexOf(r)!==-1)&&this._scene._activeParticles.addCount(s.render(),!1)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}_renderSprites(){if(!this._scene.spritesEnabled||this._spriteManagers.length===0)return;const e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(let t=0;t<this._spriteManagers.length;t++){const i=this._spriteManagers.data[t];(e&&e.layerMask&i.layerMask)!==0&&i.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}}Ws._ZeroVector=E.Zero();class Iw{}class Xi{get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){this._disableDepthPrePass=e;for(const t of this._renderingGroups)t.disableDepthPrePass=e}get maintainStateBetweenFrames(){return this._maintainStateBetweenFrames}set maintainStateBetweenFrames(e){e!==this._maintainStateBetweenFrames&&(this._maintainStateBetweenFrames=e,this._maintainStateBetweenFrames||this.restoreDispachedFlags())}restoreDispachedFlags(){for(const e of this._scene.meshes)if(e.subMeshes)for(const t of e.subMeshes)t._wasDispatched=!1;if(this._scene.spriteManagers)for(const e of this._scene.spriteManagers)e._wasDispatched=!1;for(const e of this._scene.particleSystems)e._wasDispatched=!1}constructor(e){this._useSceneAutoClearSetup=!1,this._disableDepthPrePass=!1,this._renderingGroups=new Array,this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new Iw,this._maintainStateBetweenFrames=!1,this._scene=e;for(let t=Xi.MIN_RENDERINGGROUPS;t<Xi.MAX_RENDERINGGROUPS;t++)this._autoClearDepthStencil[t]={autoClear:!0,depth:!0,stencil:!0}}get renderingGroups(){return this._renderingGroups}getRenderingGroup(e){const t=e||0;return this._prepareRenderingGroup(t),this._renderingGroups[t]}_clearDepthStencilBuffer(e=!0,t=!0){this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)}render(e,t,i,s,r=!0,o=!0,c=!0,h=!0,f){const _=this._renderingGroupInfo;if(_.scene=this._scene,_.camera=this._scene.activeCamera,_.renderingManager=this,this._scene.spriteManagers&&s)for(let d=0;d<this._scene.spriteManagers.length;d++){const g=this._scene.spriteManagers[d];this.dispatchSprites(g)}for(let d=Xi.MIN_RENDERINGGROUPS;d<Xi.MAX_RENDERINGGROUPS;d++){this._depthStencilBufferAlreadyCleaned=d===Xi.MIN_RENDERINGGROUPS;const g=this._renderingGroups[d];if(!g||g._empty)continue;const p=1<<d;if(_.renderingGroupId=d,this._scene.onBeforeRenderingGroupObservable.notifyObservers(_,p),Xi.AUTOCLEAR){const x=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(d):this._autoClearDepthStencil[d];x&&x.autoClear&&this._clearDepthStencilBuffer(x.depth,x.stencil)}for(const x of this._scene._beforeRenderingGroupDrawStage)x.action(d);g.render(e,s,i,t,r,o,c,h,f);for(const x of this._scene._afterRenderingGroupDrawStage)x.action(d);this._scene.onAfterRenderingGroupObservable.notifyObservers(_,p)}}reset(){if(!this.maintainStateBetweenFrames)for(let e=Xi.MIN_RENDERINGGROUPS;e<Xi.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepare()}}resetSprites(){if(!this.maintainStateBetweenFrames)for(let e=Xi.MIN_RENDERINGGROUPS;e<Xi.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepareSprites()}}dispose(){this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null}freeRenderingGroups(){for(let e=Xi.MIN_RENDERINGGROUPS;e<Xi.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.dispose()}}_prepareRenderingGroup(e){this._renderingGroups[e]===void 0&&(this._renderingGroups[e]=new Ws(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]),this._renderingGroups[e].disableDepthPrePass=this._disableDepthPrePass)}dispatchSprites(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchSprites(e))}dispatchParticles(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchParticles(e))}dispatch(e,t,i){t===void 0&&(t=e.getMesh()),!(this.maintainStateBetweenFrames&&e._wasDispatched)&&(e._wasDispatched=!0,this.getRenderingGroup(t.renderingGroupId).dispatch(e,t,i))}setRenderingOrder(e,t=null,i=null,s=null){if(this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=i,this._customTransparentSortCompareFn[e]=s,this._renderingGroups[e]){const r=this._renderingGroups[e];r.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],r.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],r.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._autoClearDepthStencil[e]={autoClear:t,depth:i,stencil:s}}getAutoClearDepthStencilSetup(e){return this._autoClearDepthStencil[e]}}Xi.MAX_RENDERINGGROUPS=4;Xi.MIN_RENDERINGGROUPS=0;Xi.AUTOCLEAR=!0;class As{constructor(){this.hoverCursor="",this.actions=[],this.isRecursive=!1,this.disposeWhenUnowned=!0}static get HasTriggers(){for(const e in As.Triggers)if(Object.prototype.hasOwnProperty.call(As.Triggers,e))return!0;return!1}static get HasPickTriggers(){for(const e in As.Triggers)if(Object.prototype.hasOwnProperty.call(As.Triggers,e)){const t=parseInt(e);if(t>=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){for(const t in As.Triggers)if(Object.prototype.hasOwnProperty.call(As.Triggers,t)&&parseInt(t)===e)return!0;return!1}}As.Triggers={};var Ne;(function(a){a[a.Generic=0]="Generic",a[a.Keyboard=1]="Keyboard",a[a.Mouse=2]="Mouse",a[a.Touch=3]="Touch",a[a.DualShock=4]="DualShock",a[a.Xbox=5]="Xbox",a[a.Switch=6]="Switch",a[a.DualSense=7]="DualSense"})(Ne||(Ne={}));var Xe;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.Move=12]="Move"})(Xe||(Xe={}));var d0;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.DeltaHorizontal=10]="DeltaHorizontal",a[a.DeltaVertical=11]="DeltaVertical"})(d0||(d0={}));var _0;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Share=8]="Share",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(_0||(_0={}));var m0;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Create=8]="Create",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(m0||(m0={}));var g0;(function(a){a[a.A=0]="A",a[a.B=1]="B",a[a.X=2]="X",a[a.Y=3]="Y",a[a.LB=4]="LB",a[a.RB=5]="RB",a[a.LT=6]="LT",a[a.RT=7]="RT",a[a.Back=8]="Back",a[a.Start=9]="Start",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.LStickXAxis=17]="LStickXAxis",a[a.LStickYAxis=18]="LStickYAxis",a[a.RStickXAxis=19]="RStickXAxis",a[a.RStickYAxis=20]="RStickYAxis"})(g0||(g0={}));var p0;(function(a){a[a.B=0]="B",a[a.A=1]="A",a[a.Y=2]="Y",a[a.X=3]="X",a[a.L=4]="L",a[a.R=5]="R",a[a.ZL=6]="ZL",a[a.ZR=7]="ZR",a[a.Minus=8]="Minus",a[a.Plus=9]="Plus",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.Capture=17]="Capture",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(p0||(p0={}));class jr{static CreateDeviceEvent(e,t,i,s,r,o,c){switch(e){case Ne.Keyboard:return this._CreateKeyboardEvent(i,s,r,o);case Ne.Mouse:if(i===Xe.MouseWheelX||i===Xe.MouseWheelY||i===Xe.MouseWheelZ)return this._CreateWheelEvent(e,t,i,s,r,o);case Ne.Touch:return this._CreatePointerEvent(e,t,i,s,r,o,c);default:throw`Unable to generate event for device ${Ne[e]}`}}static _CreatePointerEvent(e,t,i,s,r,o,c){const h=this._CreateMouseEvent(e,t,i,s,r,o);e===Ne.Mouse?(h.deviceType=Ne.Mouse,h.pointerId=1,h.pointerType="mouse"):(h.deviceType=Ne.Touch,h.pointerId=c??t,h.pointerType="touch");let f=0;return f+=r.pollInput(e,t,Xe.LeftClick),f+=r.pollInput(e,t,Xe.RightClick)*2,f+=r.pollInput(e,t,Xe.MiddleClick)*4,h.buttons=f,i===Xe.Move?h.type="pointermove":i>=Xe.LeftClick&&i<=Xe.RightClick&&(h.type=s===1?"pointerdown":"pointerup",h.button=i-2),h}static _CreateWheelEvent(e,t,i,s,r,o){const c=this._CreateMouseEvent(e,t,i,s,r,o);switch(c.pointerId=1,c.type="wheel",c.deltaMode=vl.DOM_DELTA_PIXEL,c.deltaX=0,c.deltaY=0,c.deltaZ=0,i){case Xe.MouseWheelX:c.deltaX=s;break;case Xe.MouseWheelY:c.deltaY=s;break;case Xe.MouseWheelZ:c.deltaZ=s;break}return c}static _CreateMouseEvent(e,t,i,s,r,o){const c=this._CreateEvent(o),h=r.pollInput(e,t,Xe.Horizontal),f=r.pollInput(e,t,Xe.Vertical);return o?(c.movementX=0,c.movementY=0,c.offsetX=c.movementX-o.getBoundingClientRect().x,c.offsetY=c.movementY-o.getBoundingClientRect().y):(c.movementX=r.pollInput(e,t,10),c.movementY=r.pollInput(e,t,11),c.offsetX=0,c.offsetY=0),this._CheckNonCharacterKeys(c,r),c.clientX=h,c.clientY=f,c.x=h,c.y=f,c.deviceType=e,c.deviceSlot=t,c.inputIndex=i,c}static _CreateKeyboardEvent(e,t,i,s){const r=this._CreateEvent(s);return this._CheckNonCharacterKeys(r,i),r.deviceType=Ne.Keyboard,r.deviceSlot=0,r.inputIndex=e,r.type=t===1?"keydown":"keyup",r.key=String.fromCharCode(e),r.keyCode=e,r}static _CheckNonCharacterKeys(e,t){const i=t.isDeviceAvailable(Ne.Keyboard),s=i&&t.pollInput(Ne.Keyboard,0,18)===1,r=i&&t.pollInput(Ne.Keyboard,0,17)===1,o=i&&(t.pollInput(Ne.Keyboard,0,91)===1||t.pollInput(Ne.Keyboard,0,92)===1||t.pollInput(Ne.Keyboard,0,93)===1),c=i&&t.pollInput(Ne.Keyboard,0,16)===1;e.altKey=s,e.ctrlKey=r,e.metaKey=o,e.shiftKey=c}static _CreateEvent(e){const t={};return t.preventDefault=()=>{},t.target=e,t}}class ww{constructor(e,t,i){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(s,r,o,c)=>{const h=jr.CreateDeviceEvent(s,r,o,c,this);i(s,r,h)}):this._createDummyNativeInput()}pollInput(e,t,i){return this._nativeInput.pollInput(e,t,i)}isDeviceAvailable(e){return e===Ne.Mouse||e===Ne.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}const y0=255,b0=Object.keys(Xe).length/2;class Pw{constructor(e,t,i,s){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=_t.IsSafari(),this._usingMacOs=Xa()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=r=>{},this._keyboardUpEvent=r=>{},this._keyboardBlurEvent=r=>{},this._pointerMoveEvent=r=>{},this._pointerDownEvent=r=>{},this._pointerUpEvent=r=>{},this._pointerCancelEvent=r=>{},this._pointerCancelTouch=r=>{},this._pointerLeaveEvent=r=>{},this._pointerWheelEvent=r=>{},this._pointerBlurEvent=r=>{},this._pointerMacOsChromeOutEvent=r=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=Xa()&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,this._isUsingChromium=Xa()&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=r=>{},this._gamepadDisconnectedEvent=r=>{},this._eventPrefix=_t.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=i,this._onInputChanged=s,this._mouseId=this._isUsingFirefox?0:1,this._enableEvents(),this._usingMacOs&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{this._enableEvents()})}pollInput(e,t,i){const s=this._inputs[e][t];if(!s)throw`Unable to find device ${Ne[e]}`;e>=Ne.DualShock&&e<=Ne.DualSense&&this._updateDevice(e,t,i);const r=s[i];if(r===void 0)throw`Unable to find input ${i} for device ${Ne[e]} in slot ${t}`;return i===Xe.Move&&_t.Warn("Unable to provide information for PointerInput.Move.  Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),r}isDeviceAvailable(e){return this._inputs[e]!==void 0}dispose(){this._onDeviceConnected=()=>{},this._onDeviceDisconnected=()=>{},this._onInputChanged=()=>{},delete this._engine._onEngineViewChanged,this._elementToAttachTo&&this._disableEvents()}_enableEvents(){const e=this?._engine.getInputElement();if(e&&(!this._eventsAttached||this._elementToAttachTo!==e)){if(this._disableEvents(),this._inputs){for(const t of this._inputs)if(t)for(const i in t){const s=+i,r=t[s];if(r)for(let o=0;o<r.length;o++)r[o]=0}}this._elementToAttachTo=e,this._elementToAttachTo.tabIndex=this._elementToAttachTo.tabIndex!==-1?this._elementToAttachTo.tabIndex:this._engine.canvasTabIndex,this._handleKeyActions(),this._handlePointerActions(),this._handleGamepadActions(),this._eventsAttached=!0,this._checkForConnectedDevices()}}_disableEvents(){this._elementToAttachTo&&(this._elementToAttachTo.removeEventListener("blur",this._keyboardBlurEvent),this._elementToAttachTo.removeEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.removeEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.removeEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.removeEventListener(this._wheelEventName,this._pointerWheelEvent),this._usingMacOs&&this._isUsingChromium&&this._elementToAttachTo.removeEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent),window.removeEventListener("gamepadconnected",this._gamepadConnectedEvent),window.removeEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)),this._pointerInputClearObserver&&this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver),this._eventsAttached=!1}_checkForConnectedDevices(){if(navigator.getGamepads){const e=navigator.getGamepads();for(const t of e)t&&this._addGamePad(t)}typeof matchMedia=="function"&&matchMedia("(pointer:fine)").matches&&this._addPointerDevice(Ne.Mouse,0,0,0)}_addGamePad(e){const t=this._getGamepadDeviceType(e.id),i=e.index;this._gamepads=this._gamepads||new Array(e.index+1),this._registerDevice(t,i,e.buttons.length+e.axes.length),this._gamepads[i]=t}_addPointerDevice(e,t,i,s){this._pointerActive||(this._pointerActive=!0),this._registerDevice(e,t,b0);const r=this._inputs[e][t];r[0]=i,r[1]=s}_registerDevice(e,t,i){if(t===void 0)throw`Unable to register device ${Ne[e]} to undefined slot.`;if(this._inputs[e]||(this._inputs[e]={}),!this._inputs[e][t]){const s=new Array(i);s.fill(0),this._inputs[e][t]=s,this._onDeviceConnected(e,t)}}_unregisterDevice(e,t){this._inputs[e][t]&&(delete this._inputs[e][t],this._onDeviceDisconnected(e,t))}_handleKeyActions(){this._keyboardDownEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(Ne.Keyboard,0,y0));const t=this._inputs[Ne.Keyboard][0];if(t){t[e.keyCode]=1;const i=e;i.inputIndex=e.keyCode,this._usingMacOs&&e.metaKey&&e.key!=="Meta"&&(this._metaKeys.includes(e.keyCode)||this._metaKeys.push(e.keyCode)),this._onInputChanged(Ne.Keyboard,0,i)}},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(Ne.Keyboard,0,y0));const t=this._inputs[Ne.Keyboard][0];if(t){t[e.keyCode]=0;const i=e;if(i.inputIndex=e.keyCode,this._usingMacOs&&e.key==="Meta"&&this._metaKeys.length>0){for(const s of this._metaKeys){const r=jr.CreateDeviceEvent(Ne.Keyboard,0,s,0,this,this._elementToAttachTo);t[s]=0,this._onInputChanged(Ne.Keyboard,0,r)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(Ne.Keyboard,0,i)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){const e=this._inputs[Ne.Keyboard][0];for(let t=0;t<e.length;t++)if(e[t]!==0){e[t]=0;const i=jr.CreateDeviceEvent(Ne.Keyboard,0,t,0,this,this._elementToAttachTo);this._onInputChanged(Ne.Keyboard,0,i)}this._usingMacOs&&this._metaKeys.splice(0,this._metaKeys.length)}},this._elementToAttachTo.addEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.addEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.addEventListener("blur",this._keyboardBlurEvent)}_handlePointerActions(){this._maxTouchPoints=Xa()&&navigator.maxTouchPoints||2,this._activeTouchIds||(this._activeTouchIds=new Array(this._maxTouchPoints));for(let i=0;i<this._maxTouchPoints;i++)this._activeTouchIds[i]=-1;this._pointerMoveEvent=i=>{const s=this._getPointerType(i);let r=s===Ne.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===Ne.Touch&&r===-1){if(i.buttons===0)return;const c=this._activeTouchIds.indexOf(-1);if(c>=0)r=c,this._activeTouchIds[c]=i.pointerId,this._onDeviceConnected(s,r);else{_t.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][r]||this._addPointerDevice(s,r,i.clientX,i.clientY);const o=this._inputs[s][r];if(o){const c=i;c.inputIndex=Xe.Move,o[Xe.Horizontal]=i.clientX,o[Xe.Vertical]=i.clientY,s===Ne.Touch&&o[Xe.LeftClick]===0&&(o[Xe.LeftClick]=1),i.pointerId===void 0&&(i.pointerId=this._mouseId),this._onInputChanged(s,r,c),!this._usingSafari&&i.button!==-1&&(c.inputIndex=i.button+2,o[i.button+2]=o[i.button+2]?0:1,this._onInputChanged(s,r,c))}},this._pointerDownEvent=i=>{const s=this._getPointerType(i);let r=s===Ne.Mouse?0:i.pointerId;if(s===Ne.Touch){let c=this._activeTouchIds.indexOf(i.pointerId);if(c===-1&&(c=this._activeTouchIds.indexOf(-1)),c>=0)r=c,this._activeTouchIds[c]=i.pointerId;else{_t.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][r]?s===Ne.Touch&&this._onDeviceConnected(s,r):this._addPointerDevice(s,r,i.clientX,i.clientY);const o=this._inputs[s][r];if(o){const c=o[Xe.Horizontal],h=o[Xe.Vertical];if(s===Ne.Mouse){if(i.pointerId===void 0&&(i.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch{}}else if(i.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(i.pointerId)}catch{}o[Xe.Horizontal]=i.clientX,o[Xe.Vertical]=i.clientY,o[i.button+2]=1;const f=i;f.inputIndex=i.button+2,this._onInputChanged(s,r,f),(c!==i.clientX||h!==i.clientY)&&(f.inputIndex=Xe.Move,this._onInputChanged(s,r,f))}},this._pointerUpEvent=i=>{const s=this._getPointerType(i),r=s===Ne.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===Ne.Touch){if(r===-1)return;this._activeTouchIds[r]=-1}const o=this._inputs[s]?.[r];let c=i.button,h=o&&o[c+2]!==0;if(!h&&this._isUsingFirefox&&this._usingMacOs&&o&&(c=c===2?0:2,h=o[c+2]!==0),h){const f=o[Xe.Horizontal],_=o[Xe.Vertical];o[Xe.Horizontal]=i.clientX,o[Xe.Vertical]=i.clientY,o[c+2]=0;const d=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),(f!==i.clientX||_!==i.clientY)&&(d.inputIndex=Xe.Move,this._onInputChanged(s,r,d)),d.inputIndex=c+2,s===Ne.Mouse&&this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)?this._elementToAttachTo.releasePointerCapture(this._mouseId):i.pointerId&&this._elementToAttachTo.hasPointerCapture?.(i.pointerId)&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._onInputChanged(s,r,d),s===Ne.Touch&&this._onDeviceDisconnected(s,r)}},this._pointerCancelTouch=i=>{const s=this._activeTouchIds.indexOf(i);if(s===-1)return;this._elementToAttachTo.hasPointerCapture?.(i)&&this._elementToAttachTo.releasePointerCapture(i),this._inputs[Ne.Touch][s][Xe.LeftClick]=0;const r=jr.CreateDeviceEvent(Ne.Touch,s,Xe.LeftClick,0,this,this._elementToAttachTo,i);this._onInputChanged(Ne.Touch,s,r),this._activeTouchIds[s]=-1,this._onDeviceDisconnected(Ne.Touch,s)},this._pointerCancelEvent=i=>{if(i.pointerType==="mouse"){const s=this._inputs[Ne.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let r=Xe.LeftClick;r<=Xe.BrowserForward;r++)if(s[r]===1){s[r]=0;const o=jr.CreateDeviceEvent(Ne.Mouse,0,r,0,this,this._elementToAttachTo);this._onInputChanged(Ne.Mouse,0,o)}}else this._pointerCancelTouch(i.pointerId)},this._pointerLeaveEvent=i=>{i.pointerType==="pen"&&this._pointerCancelTouch(i.pointerId)},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=!1;const t=function(){};try{const i=Object.defineProperty({},"passive",{get:function(){e=!0}});this._elementToAttachTo.addEventListener("test",t,i),this._elementToAttachTo.removeEventListener("test",t,i)}catch{}this._pointerBlurEvent=()=>{if(this.isDeviceAvailable(Ne.Mouse)){const i=this._inputs[Ne.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let s=Xe.LeftClick;s<=Xe.BrowserForward;s++)if(i[s]===1){i[s]=0;const r=jr.CreateDeviceEvent(Ne.Mouse,0,s,0,this,this._elementToAttachTo);this._onInputChanged(Ne.Mouse,0,r)}}if(this.isDeviceAvailable(Ne.Touch)){const i=this._inputs[Ne.Touch];for(let s=0;s<this._activeTouchIds.length;s++){const r=this._activeTouchIds[s];if(this._elementToAttachTo.hasPointerCapture?.(r)&&this._elementToAttachTo.releasePointerCapture(r),r!==-1&&i[s]?.[Xe.LeftClick]===1){i[s][Xe.LeftClick]=0;const o=jr.CreateDeviceEvent(Ne.Touch,s,Xe.LeftClick,0,this,this._elementToAttachTo,r);this._onInputChanged(Ne.Touch,s,o),this._activeTouchIds[s]=-1,this._onDeviceDisconnected(Ne.Touch,s)}}}},this._pointerWheelEvent=i=>{const s=Ne.Mouse,r=0;this._inputs[s]||(this._inputs[s]=[]),this._inputs[s][r]||(this._pointerActive=!0,this._registerDevice(s,r,b0));const o=this._inputs[s][r];if(o){o[Xe.MouseWheelX]=i.deltaX||0,o[Xe.MouseWheelY]=i.deltaY||i.wheelDelta||0,o[Xe.MouseWheelZ]=i.deltaZ||0;const c=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),o[Xe.MouseWheelX]!==0&&(c.inputIndex=Xe.MouseWheelX,this._onInputChanged(s,r,c)),o[Xe.MouseWheelY]!==0&&(c.inputIndex=Xe.MouseWheelY,this._onInputChanged(s,r,c)),o[Xe.MouseWheelZ]!==0&&(c.inputIndex=Xe.MouseWheelZ,this._onInputChanged(s,r,c))}},this._usingMacOs&&this._isUsingChromium&&(this._pointerMacOsChromeOutEvent=i=>{i.buttons>1&&this._pointerCancelEvent(i)},this._elementToAttachTo.addEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent)),this._elementToAttachTo.addEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.addEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.addEventListener(this._wheelEventName,this._pointerWheelEvent,e?{passive:!1}:!1),this._pointerInputClearObserver=this._engine.onEndFrameObservable.add(()=>{if(this.isDeviceAvailable(Ne.Mouse)){const i=this._inputs[Ne.Mouse][0];i[Xe.MouseWheelX]=0,i[Xe.MouseWheelY]=0,i[Xe.MouseWheelZ]=0}})}_handleGamepadActions(){this._gamepadConnectedEvent=e=>{this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{if(this._gamepads){const t=this._getGamepadDeviceType(e.gamepad.id),i=e.gamepad.index;this._unregisterDevice(t,i),delete this._gamepads[i]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,i){const s=navigator.getGamepads()[t];if(s&&e===this._gamepads[t]){const r=this._inputs[e][t];i>=s.buttons.length?r[i]=s.axes[i-s.buttons.length].valueOf():r[i]=s.buttons[i].value}}_getGamepadDeviceType(e){return e.indexOf("054c")!==-1?e.indexOf("0ce6")!==-1?Ne.DualSense:Ne.DualShock:e.indexOf("Xbox One")!==-1||e.search("Xbox 360")!==-1||e.search("xinput")!==-1||e.indexOf("045e")!==-1&&e.indexOf("Surface Dock")===-1?Ne.Xbox:e.indexOf("057e")!==-1?Ne.Switch:Ne.Generic}_getPointerType(e){let t=Ne.Mouse;return(e.pointerType==="touch"||e.pointerType==="pen"||e.touches)&&(t=Ne.Touch),t}}class x0{constructor(e,t,i=0){this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new Ae,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class Ow{constructor(e){this._registeredManagers=new Array,this._refCount=0,this.registerManager=o=>{for(let c=0;c<this._devices.length;c++){const h=this._devices[c];for(const f in h){const _=+f;o._addDevice(new x0(this._deviceInputSystem,c,_))}}this._registeredManagers.push(o)},this.unregisterManager=o=>{const c=this._registeredManagers.indexOf(o);c>-1&&this._registeredManagers.splice(c,1)};const t=Object.keys(Ne).length/2;this._devices=new Array(t);const i=(o,c)=>{this._devices[o]||(this._devices[o]=new Array),this._devices[o][c]||(this._devices[o][c]=c);for(const h of this._registeredManagers){const f=new x0(this._deviceInputSystem,o,c);h._addDevice(f)}},s=(o,c)=>{this._devices[o]?.[c]&&delete this._devices[o][c];for(const h of this._registeredManagers)h._removeDevice(o,c)},r=(o,c,h)=>{if(h)for(const f of this._registeredManagers)f._onInputChanged(o,c,h)};typeof _native<"u"?this._deviceInputSystem=new ww(i,s,r):this._deviceInputSystem=new Pw(e,i,s,r)}dispose(){this._deviceInputSystem.dispose()}}class Fw{getDeviceSource(e,t){if(t===void 0){if(this._firstDevice[e]===void 0)return null;t=this._firstDevice[e]}return!this._devices[e]||this._devices[e][t]===void 0?null:this._devices[e][t]}getDeviceSources(e){return this._devices[e]?this._devices[e].filter(t=>!!t):[]}constructor(e){const t=Object.keys(Ne).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new Ow(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new Ae(i=>{for(const s of this._devices)if(s)for(const r of s)r&&this.onDeviceConnectedObservable.notifyObserver(i,r)}),this.onDeviceDisconnectedObservable=new Ae,this._engine._deviceSourceManager.registerManager(this),this._onDisposeObserver=e.onDisposeObservable.add(()=>{this.dispose()})}dispose(){this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._engine._deviceSourceManager&&(this._engine._deviceSourceManager.unregisterManager(this),--this._engine._deviceSourceManager._refCount<1&&(this._engine._deviceSourceManager.dispose(),delete this._engine._deviceSourceManager)),this._engine.onDisposeObservable.remove(this._onDisposeObserver)}_addDevice(e){this._devices[e.deviceType]||(this._devices[e.deviceType]=[]),this._devices[e.deviceType][e.deviceSlot]||(this._devices[e.deviceType][e.deviceSlot]=e,this._updateFirstDevices(e.deviceType)),this.onDeviceConnectedObservable.notifyObservers(e)}_removeDevice(e,t){const i=this._devices[e]?.[t];this.onDeviceDisconnectedObservable.notifyObservers(i),this._devices[e]?.[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){this._devices[e]?.[t]?.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){switch(e){case Ne.Keyboard:case Ne.Mouse:this._firstDevice[e]=0;break;case Ne.Touch:case Ne.DualSense:case Ne.DualShock:case Ne.Xbox:case Ne.Switch:case Ne.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t){for(let i=0;i<t.length;i++)if(t[i]){this._firstDevice[e]=i;break}}break}}}}class X1{}X1._IsPickingAvailable=!1;class v0{constructor(){this._singleClick=!1,this._doubleClick=!1,this._hasSwiped=!1,this._ignore=!1}get singleClick(){return this._singleClick}get doubleClick(){return this._doubleClick}get hasSwiped(){return this._hasSwiped}get ignore(){return this._ignore}set singleClick(e){this._singleClick=e}set doubleClick(e){this._doubleClick=e}set hasSwiped(e){this._hasSwiped=e}set ignore(e){this._ignore=e}}class li{constructor(e){this._alreadyAttached=!1,this._meshPickProceed=!1,this._currentPickResult=null,this._previousPickResult=null,this._activePointerIds=new Array,this._activePointerIdsCount=0,this._doubleClickOccured=!1,this._isSwiping=!1,this._swipeButtonPressed=-1,this._skipPointerTap=!1,this._isMultiTouchGesture=!1,this._pointerX=0,this._pointerY=0,this._startingPointerPosition=new Ue(0,0),this._previousStartingPointerPosition=new Ue(0,0),this._startingPointerTime=0,this._previousStartingPointerTime=0,this._pointerCaptures={},this._meshUnderPointerId={},this._movePointerInfo=null,this._cameraObserverCount=0,this._delayedClicks=[null,null,null,null,null],this._deviceSourceManager=null,this._scene=e||ft.LastCreatedScene,this._scene}get meshUnderPointer(){return this._movePointerInfo&&(this._movePointerInfo._generatePickInfo(),this._movePointerInfo=null),this._pointerOverMesh}getMeshUnderPointerByPointerId(e){return this._meshUnderPointerId[e]||null}get unTranslatedPointer(){return new Ue(this._unTranslatedPointerX,this._unTranslatedPointerY)}get pointerX(){return this._pointerX}set pointerX(e){this._pointerX=e}get pointerY(){return this._pointerY}set pointerY(e){this._pointerY=e}_updatePointerPosition(e){const t=this._scene.getEngine().getInputElementClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)}_processPointerMove(e,t){const i=this._scene,s=i.getEngine(),r=s.getInputElement();r&&(r.tabIndex=s.canvasTabIndex,i.doNotHandleCursors||(r.style.cursor=i.defaultCursor)),this._setCursorAndPointerOverMesh(e,t,i);for(const h of i._pointerMoveStage){e=e||this._pickMove(t);const f=!!e?.pickedMesh;e=h.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,f,r)}const o=t.inputIndex>=Xe.MouseWheelX&&t.inputIndex<=Xe.MouseWheelZ?at.POINTERWHEEL:at.POINTERMOVE;i.onPointerMove&&(e=e||this._pickMove(t),i.onPointerMove(t,e,o));let c;e?(c=new Un(o,t,e),this._setRayOnPointerInfo(e,t)):(c=new Un(o,t,null,this),this._movePointerInfo=c),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(c,o)}_setRayOnPointerInfo(e,t){const i=this._scene;e&&X1._IsPickingAvailable&&(e.ray||(e.ray=i.createPickingRay(t.offsetX,t.offsetY,se.Identity(),i.activeCamera)))}_addCameraPointerObserver(e,t){return this._cameraObserverCount++,this._scene.onPointerObservable.add(e,t)}_removeCameraPointerObserver(e){return this._cameraObserverCount--,this._scene.onPointerObservable.remove(e)}_checkForPicking(){return!!(this._scene.onPointerObservable.observers.length>this._cameraObserverCount||this._scene.onPointerPick)}_checkPrePointerObservable(e,t,i){const s=this._scene,r=new NI(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(r.originalPickingInfo=e,r.ray=e.ray,t.pointerType==="xr-near"&&e.originMesh&&(r.nearInteractionPickingInfo=e)),s.onPrePointerObservable.notifyObservers(r,i),!!r.skipOnPointerObservable}_pickMove(e){const t=this._scene,i=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,t.pointerMoveFastCheck,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(i,e,t),i}_setCursorAndPointerOverMesh(e,t,i){const r=i.getEngine().getInputElement();if(e?.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!i.doNotHandleCursors&&r&&this._pointerOverMesh){const o=this._pointerOverMesh._getActionManagerForTrigger();o&&o.hasPointerTriggers&&(r.style.cursor=o.hoverCursor||i.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){const i=new PointerEvent("pointermove",t);i.inputIndex=Xe.Move,!this._checkPrePointerObservable(e,i,at.POINTERMOVE)&&this._processPointerMove(e,i)}simulatePointerDown(e,t){const i=new PointerEvent("pointerdown",t);i.inputIndex=i.button+2,!this._checkPrePointerObservable(e,i,at.POINTERDOWN)&&this._processPointerDown(e,i)}_processPointerDown(e,t){const i=this._scene;if(e?.pickedMesh){this._pickedDownMesh=e.pickedMesh;const o=e.pickedMesh._getActionManagerForTrigger();if(o){if(o.hasPickTriggers)switch(o.processTrigger(5,new Pi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e)),t.button){case 0:o.processTrigger(2,new Pi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 1:o.processTrigger(4,new Pi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 2:o.processTrigger(3,new Pi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break}o.hasSpecificTrigger(8)&&window.setTimeout(()=>{const c=i.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,h=>h.isPickable&&h.isVisible&&h.isReady()&&h.actionManager&&h.actionManager.hasSpecificTrigger(8)&&h===this._pickedDownMesh,!1,i.cameraToUseForPointers);c?.pickedMesh&&o&&this._activePointerIdsCount!==0&&Date.now()-this._startingPointerTime>li.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,o.processTrigger(8,Pi.CreateNew(c.pickedMesh,t)))},li.LongPressDelay)}}else for(const o of i._pointerDownStage)e=o.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let s;const r=at.POINTERDOWN;e?(i.onPointerDown&&i.onPointerDown(t,e,r),s=new Un(r,t,e),this._setRayOnPointerInfo(e,t)):s=new Un(r,t,null,this),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(s,r)}_isPointerSwiping(){return this._isSwiping}simulatePointerUp(e,t,i){const s=new PointerEvent("pointerup",t);s.inputIndex=Xe.Move;const r=new v0;i?r.doubleClick=!0:r.singleClick=!0,!this._checkPrePointerObservable(e,s,at.POINTERUP)&&this._processPointerUp(e,s,r)}_processPointerUp(e,t,i){const s=this._scene;if(e?.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(s.onPointerPick&&s.onPointerPick(t,e),i.singleClick&&!i.ignore&&s.onPointerObservable.observers.length>this._cameraObserverCount)){const o=at.POINTERPICK,c=new Un(o,t,e);this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(c,o)}const r=e.pickedMesh._getActionManagerForTrigger();if(r&&!i.ignore){r.processTrigger(7,Pi.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&r.processTrigger(1,Pi.CreateNew(e.pickedMesh,t,e));const o=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&o&&o.processTrigger(6,Pi.CreateNew(e.pickedMesh,t,e))}}else if(!i.ignore)for(const r of s._pointerUpStage)e=r.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,i.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){const r=this._pickedDownMesh._getActionManagerForTrigger(16);r&&r.processTrigger(16,Pi.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){const r=new Un(at.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(r,at.POINTERUP),s.onPointerUp&&s.onPointerUp(t,e,at.POINTERUP),!i.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let o=0;if(i.singleClick?o=at.POINTERTAP:i.doubleClick&&(o=at.POINTERDOUBLETAP),o){const c=new Un(o,t,e);s.onPointerObservable.hasObservers()&&s.onPointerObservable.hasSpecificMask(o)&&s.onPointerObservable.notifyObservers(c,o)}}}}isPointerCaptured(e=0){return this._pointerCaptures[e]}attachControl(e=!0,t=!0,i=!0,s=null){const r=this._scene,o=r.getEngine();s||(s=o.getInputElement()),this._alreadyAttached&&this.detachControl(),s&&(this._alreadyAttachedTo=s),this._deviceSourceManager=new Fw(o),this._initActionManager=c=>{if(!this._meshPickProceed){const h=r.skipPointerUpPicking||r._registeredActions===0&&!this._checkForPicking()&&!r.onPointerUp?null:r.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,r.pointerUpPredicate,r.pointerUpFastCheck,r.cameraToUseForPointers,r.pointerUpTrianglePredicate);this._currentPickResult=h,h&&(c=h.hit&&h.pickedMesh?h.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return c},this._delayedSimpleClick=(c,h,f)=>{if((Date.now()-this._previousStartingPointerTime>li.DoubleClickDelay&&!this._doubleClickOccured||c!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,h.singleClick=!0,h.ignore=!1,this._delayedClicks[c])){const _=this._delayedClicks[c].evt,d=at.POINTERTAP,g=new Un(d,_,this._currentPickResult);r.onPointerObservable.hasObservers()&&r.onPointerObservable.hasSpecificMask(d)&&r.onPointerObservable.notifyObservers(g,d),this._delayedClicks[c]=null}},this._initClickEvent=(c,h,f,_)=>{const d=new v0;this._currentPickResult=null;let g=null,p=c.hasSpecificMask(at.POINTERPICK)||h.hasSpecificMask(at.POINTERPICK)||c.hasSpecificMask(at.POINTERTAP)||h.hasSpecificMask(at.POINTERTAP)||c.hasSpecificMask(at.POINTERDOUBLETAP)||h.hasSpecificMask(at.POINTERDOUBLETAP);!p&&As&&(g=this._initActionManager(g,d),g&&(p=g.hasPickTriggers));let x=!1;if(p=p&&!this._isMultiTouchGesture,p){const b=f.button;if(d.hasSwiped=this._isPointerSwiping(),!d.hasSwiped){let T=!li.ExclusiveDoubleClickMode;if(T||(T=!c.hasSpecificMask(at.POINTERDOUBLETAP)&&!h.hasSpecificMask(at.POINTERDOUBLETAP),T&&!As.HasSpecificTrigger(6)&&(g=this._initActionManager(g,d),g&&(T=!g.hasSpecificTrigger(6)))),T)(Date.now()-this._previousStartingPointerTime>li.DoubleClickDelay||b!==this._previousButtonPressed)&&(d.singleClick=!0,_(d,this._currentPickResult),x=!0);else{const S={evt:f,clickInfo:d,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,b,d,_),li.DoubleClickDelay)};this._delayedClicks[b]=S}let R=c.hasSpecificMask(at.POINTERDOUBLETAP)||h.hasSpecificMask(at.POINTERDOUBLETAP);!R&&As.HasSpecificTrigger(6)&&(g=this._initActionManager(g,d),g&&(R=g.hasSpecificTrigger(6))),R&&(b===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime<li.DoubleClickDelay&&!this._doubleClickOccured?(!d.hasSwiped&&!this._isPointerSwiping()?(this._previousStartingPointerTime=0,this._doubleClickOccured=!0,d.doubleClick=!0,d.ignore=!1,li.ExclusiveDoubleClickMode&&this._delayedClicks[b]&&(clearTimeout(this._delayedClicks[b]?.timeoutId),this._delayedClicks[b]=null),_(d,this._currentPickResult)):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=b,li.ExclusiveDoubleClickMode?(this._delayedClicks[b]&&(clearTimeout(this._delayedClicks[b]?.timeoutId),this._delayedClicks[b]=null),_(d,this._previousPickResult)):_(d,this._currentPickResult)),x=!0):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=b))}}x||_(d,this._currentPickResult)},this._onPointerMove=c=>{if(this._updatePointerPosition(c),!this._isSwiping&&this._swipeButtonPressed!==-1&&(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>li.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>li.DragMovementThreshold),o.isPointerLock&&o._verifyPointerLock(),this._checkPrePointerObservable(null,c,c.inputIndex>=Xe.MouseWheelX&&c.inputIndex<=Xe.MouseWheelZ?at.POINTERWHEEL:at.POINTERMOVE)||!r.cameraToUseForPointers&&!r.activeCamera)return;if(r.skipPointerMovePicking){this._processPointerMove(new _l,c);return}r.pointerMovePredicate||(r.pointerMovePredicate=f=>f.isPickable&&f.isVisible&&f.isReady()&&f.isEnabled()&&(f.enablePointerMoveEvents||r.constantlyUpdateMeshUnderPointer||f._getActionManagerForTrigger()!==null)&&(!r.cameraToUseForPointers||(r.cameraToUseForPointers.layerMask&f.layerMask)!==0));const h=r._registeredActions>0||r.constantlyUpdateMeshUnderPointer?this._pickMove(c):null;this._processPointerMove(h,c)},this._onPointerDown=c=>{const h=this._activePointerIds.indexOf(-1);if(h===-1?this._activePointerIds.push(c.pointerId):this._activePointerIds[h]=c.pointerId,this._activePointerIdsCount++,this._pickedDownMesh=null,this._meshPickProceed=!1,li.ExclusiveDoubleClickMode){for(let _=0;_<this._delayedClicks.length;_++)if(this._delayedClicks[_])if(c.button===_)clearTimeout(this._delayedClicks[_]?.timeoutId);else{const d=this._delayedClicks[_].clickInfo;this._doubleClickOccured=!1,d.singleClick=!0,d.ignore=!1;const g=this._delayedClicks[_].evt,p=at.POINTERTAP,x=new Un(p,g,this._currentPickResult);r.onPointerObservable.hasObservers()&&r.onPointerObservable.hasSpecificMask(p)&&r.onPointerObservable.notifyObservers(x,p),this._delayedClicks[_]=null}}if(this._updatePointerPosition(c),this._swipeButtonPressed===-1&&(this._swipeButtonPressed=c.button),r.preventDefaultOnPointerDown&&s&&(c.preventDefault(),s.focus()),this._startingPointerPosition.x=this._pointerX,this._startingPointerPosition.y=this._pointerY,this._startingPointerTime=Date.now(),this._checkPrePointerObservable(null,c,at.POINTERDOWN)||!r.cameraToUseForPointers&&!r.activeCamera)return;this._pointerCaptures[c.pointerId]=!0,r.pointerDownPredicate||(r.pointerDownPredicate=_=>_.isPickable&&_.isVisible&&_.isReady()&&_.isEnabled()&&(!r.cameraToUseForPointers||(r.cameraToUseForPointers.layerMask&_.layerMask)!==0)),this._pickedDownMesh=null;let f;r.skipPointerDownPicking||r._registeredActions===0&&!this._checkForPicking()&&!r.onPointerDown?f=new _l:f=r.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,r.pointerDownPredicate,r.pointerDownFastCheck,r.cameraToUseForPointers,r.pointerDownTrianglePredicate),this._processPointerDown(f,c)},this._onPointerUp=c=>{const h=this._activePointerIds.indexOf(c.pointerId);h!==-1&&(this._activePointerIds[h]=-1,this._activePointerIdsCount--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(c),r.preventDefaultOnPointerUp&&s&&(c.preventDefault(),s.focus()),this._initClickEvent(r.onPrePointerObservable,r.onPointerObservable,c,(f,_)=>{if(r.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!f.ignore)){if(this._checkPrePointerObservable(null,c,at.POINTERUP)){this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1),c.buttons===0&&(this._pointerCaptures[c.pointerId]=!1);return}f.hasSwiped||(f.singleClick&&r.onPrePointerObservable.hasSpecificMask(at.POINTERTAP)&&this._checkPrePointerObservable(null,c,at.POINTERTAP)&&(this._skipPointerTap=!0),f.doubleClick&&r.onPrePointerObservable.hasSpecificMask(at.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,c,at.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}if(!this._pointerCaptures[c.pointerId]){this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}c.buttons===0&&(this._pointerCaptures[c.pointerId]=!1),!(!r.cameraToUseForPointers&&!r.activeCamera)&&(r.pointerUpPredicate||(r.pointerUpPredicate=d=>d.isPickable&&d.isVisible&&d.isReady()&&d.isEnabled()&&(!r.cameraToUseForPointers||(r.cameraToUseForPointers.layerMask&d.layerMask)!==0)),!this._meshPickProceed&&(As&&As.HasTriggers||this._checkForPicking()||r.onPointerUp)&&this._initActionManager(null,f),_||(_=this._currentPickResult),this._processPointerUp(_,c,f),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))}))},this._onKeyDown=c=>{const h=dl.KEYDOWN;if(r.onPreKeyboardObservable.hasObservers()){const f=new yb(h,c);if(r.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(r.onKeyboardObservable.hasObservers()){const f=new Dd(h,c);r.onKeyboardObservable.notifyObservers(f,h)}r.actionManager&&r.actionManager.processTrigger(14,Pi.CreateNewFromScene(r,c))},this._onKeyUp=c=>{const h=dl.KEYUP;if(r.onPreKeyboardObservable.hasObservers()){const f=new yb(h,c);if(r.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(r.onKeyboardObservable.hasObservers()){const f=new Dd(h,c);r.onKeyboardObservable.notifyObservers(f,h)}r.actionManager&&r.actionManager.processTrigger(15,Pi.CreateNewFromScene(r,c))},this._deviceSourceManager.onDeviceConnectedObservable.add(c=>{c.deviceType===Ne.Mouse?c.onInputChangedObservable.add(h=>{this._originMouseEvent=h,h.inputIndex===Xe.LeftClick||h.inputIndex===Xe.MiddleClick||h.inputIndex===Xe.RightClick||h.inputIndex===Xe.BrowserBack||h.inputIndex===Xe.BrowserForward?t&&c.getInput(h.inputIndex)===1?this._onPointerDown(h):e&&c.getInput(h.inputIndex)===0&&this._onPointerUp(h):i&&(h.inputIndex===Xe.Move?this._onPointerMove(h):(h.inputIndex===Xe.MouseWheelX||h.inputIndex===Xe.MouseWheelY||h.inputIndex===Xe.MouseWheelZ)&&this._onPointerMove(h))}):c.deviceType===Ne.Touch?c.onInputChangedObservable.add(h=>{h.inputIndex===Xe.LeftClick&&(t&&c.getInput(h.inputIndex)===1?(this._onPointerDown(h),this._activePointerIdsCount>1&&(this._isMultiTouchGesture=!0)):e&&c.getInput(h.inputIndex)===0&&(this._onPointerUp(h),this._activePointerIdsCount===0&&(this._isMultiTouchGesture=!1))),i&&h.inputIndex===Xe.Move&&this._onPointerMove(h)}):c.deviceType===Ne.Keyboard&&c.onInputChangedObservable.add(h=>{h.type==="keydown"?this._onKeyDown(h):h.type==="keyup"&&this._onKeyUp(h)})}),this._alreadyAttached=!0}detachControl(){this._alreadyAttached&&(this._deviceSourceManager.dispose(),this._deviceSourceManager=null,this._alreadyAttachedTo&&!this._scene.doNotHandleCursors&&(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1,this._alreadyAttachedTo=null)}setPointerOverMesh(e,t=0,i,s){if(this._meshUnderPointerId[t]===e&&(!e||!e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;const r=this._meshUnderPointerId[t];let o;r&&(o=r._getActionManagerForTrigger(10),o&&o.processTrigger(10,new Pi(r,this._pointerX,this._pointerY,e,s,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,o=e._getActionManagerForTrigger(9),o&&o.processTrigger(9,new Pi(e,this._pointerX,this._pointerY,e,s,{pointerId:t,pickResult:i}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null),this._scene.onMeshUnderPointerUpdatedObservable.hasObservers()&&this._scene.onMeshUnderPointerUpdatedObservable.notifyObservers({mesh:e,pointerId:t})}getPointerOverMesh(){return this.meshUnderPointer}
161_invalidateMesh(e){this._pointerOverMesh===e&&(this._pointerOverMesh=null),this._pickedDownMesh===e&&(this._pickedDownMesh=null),this._pickedUpMesh===e&&(this._pickedUpMesh=null);for(const t in this._meshUnderPointerId)this._meshUnderPointerId[t]===e&&delete this._meshUnderPointerId[t]}}li.DragMovementThreshold=10;li.LongPressDelay=500;li.DoubleClickDelay=300;li.ExclusiveDoubleClickMode=!1;class q1{static get UniqueId(){const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}q1._UniqueIdCounter=1;class Bw{constructor(){this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var T0,R0,A0,M0,S0,E0,C0,D0,I0,w0,P0,O0,F0,B0,L0,U0,k0,N0,z0,V0,G0,H0,W0,X0,q0,j0,Y0,K0,Z0,Q0,$0,J0,ex,tx,ix,sx,nx,rx,ax,ox,lx,cx,hx,ux,fx,dx,_x,mx,gx,px,yx,bx,xx;const Lw=new it,Uw=new it;var vx;(function(a){a[a.BackwardCompatible=0]="BackwardCompatible",a[a.Intermediate=1]="Intermediate",a[a.Aggressive=2]="Aggressive"})(vx||(vx={}));class Me{static DefaultMaterialFactory(e){throw je("StandardMaterial")}static CollisionCoordinatorFactory(){throw je("DefaultCollisionCoordinator")}get clearColor(){return this._clearColor}set clearColor(e){e!==this._clearColor&&(this._clearColor=e,this.onClearColorChangedObservable.notifyObservers(this._clearColor))}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}get performancePriority(){return this._performancePriority}set performancePriority(e){if(e!==this._performancePriority){switch(this._performancePriority=e,e){case 0:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case 1:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case 2:this.skipFrustumClipping=!0,this._renderingManager.maintainStateBetweenFrames=!0,this.skipPointerMovePicking=!0,this.autoClear=!1;break}this.onScenePerformancePriorityChangedObservable.notifyObservers(e)}}set forceWireframe(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(16))}get forceWireframe(){return this._forceWireframe}set skipFrustumClipping(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)}get skipFrustumClipping(){return this._skipFrustumClipping}set forcePointsCloud(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(16))}get forcePointsCloud(){return this._forcePointsCloud}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.onEnvironmentTextureChangedObservable.notifyObservers(e),this.markAllMaterialsAsDirty(1))}getNodes(){let e=[];e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes);for(const t of this.skeletons)e=e.concat(t.bones);return e}get animationPropertiesOverride(){return this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set beforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))}set afterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))}set beforeCameraRender(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)}set afterCameraRender(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)}get pointerDownPredicate(){return this._pointerPickingConfiguration.pointerDownPredicate}set pointerDownPredicate(e){this._pointerPickingConfiguration.pointerDownPredicate=e}get pointerUpPredicate(){return this._pointerPickingConfiguration.pointerUpPredicate}set pointerUpPredicate(e){this._pointerPickingConfiguration.pointerUpPredicate=e}get pointerMovePredicate(){return this._pointerPickingConfiguration.pointerMovePredicate}set pointerMovePredicate(e){this._pointerPickingConfiguration.pointerMovePredicate=e}get pointerDownFastCheck(){return this._pointerPickingConfiguration.pointerDownFastCheck}set pointerDownFastCheck(e){this._pointerPickingConfiguration.pointerDownFastCheck=e}get pointerUpFastCheck(){return this._pointerPickingConfiguration.pointerUpFastCheck}set pointerUpFastCheck(e){this._pointerPickingConfiguration.pointerUpFastCheck=e}get pointerMoveFastCheck(){return this._pointerPickingConfiguration.pointerMoveFastCheck}set pointerMoveFastCheck(e){this._pointerPickingConfiguration.pointerMoveFastCheck=e}get skipPointerMovePicking(){return this._pointerPickingConfiguration.skipPointerMovePicking}set skipPointerMovePicking(e){this._pointerPickingConfiguration.skipPointerMovePicking=e}get skipPointerDownPicking(){return this._pointerPickingConfiguration.skipPointerDownPicking}set skipPointerDownPicking(e){this._pointerPickingConfiguration.skipPointerDownPicking=e}get skipPointerUpPicking(){return this._pointerPickingConfiguration.skipPointerUpPicking}set skipPointerUpPicking(e){this._pointerPickingConfiguration.skipPointerUpPicking=e}get unTranslatedPointer(){return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){return li.DragMovementThreshold}static set DragMovementThreshold(e){li.DragMovementThreshold=e}static get LongPressDelay(){return li.LongPressDelay}static set LongPressDelay(e){li.LongPressDelay=e}static get DoubleClickDelay(){return li.DoubleClickDelay}static set DoubleClickDelay(e){li.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return li.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){li.ExclusiveDoubleClickMode=e}get _eyePosition(){return this._forcedViewPosition??this.activeCamera?.globalPosition??E.ZeroReadOnly}bindEyePosition(e,t="vEyePosition",i=!1){const s=this._eyePosition,r=this.useRightHandedSystem===(this._mirroredCameraPosition!=null),o=this.floatingOriginOffset,c=Lw.set(s.x,s.y,s.z,r?-1:1),h=c.subtractFromFloatsToRef(o.x,o.y,o.z,0,Uw);return e&&(i?e.setFloat3(t,h.x,h.y,h.z):e.setVector4(t,h)),c}finalizeSceneUbo(){const e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null),i=this.floatingOriginOffset;return e.updateFloat4("vEyePosition",t.x-i.x,t.y-i.y,t.z-i.z,t.w),e.update(
vendor: 4,193 bytes, line 161
161),e}set useRightHandedSystem(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(16))}get useRightHandedSystem(){return this._useRightHandedSystem}setStepId(e){this._currentStepId=e}getStepId(){return this._currentStepId}getInternalStep(){return this._currentInternalStep}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(16))}get fogEnabled(){return this._fogEnabled}set fogMode(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(16))}get fogMode(){return this._fogMode}get prePass(){return!!this.prePassRenderer&&this.prePassRenderer.defaultRT.enabled}set shadowsEnabled(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(2))}get shadowsEnabled(){return this._shadowsEnabled}set lightsEnabled(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(2))}get lightsEnabled(){return this._lightsEnabled}get activeCameras(){return this._activeCameras}set activeCameras(e){this._unObserveActiveCameras&&(this._unObserveActiveCameras(),this._unObserveActiveCameras=null),e&&(this._unObserveActiveCameras=HD(e,()=>{this.onActiveCamerasChanged.notifyObservers(this)})),this._activeCameras=e}get activeCamera(){return this._activeCamera}set activeCamera(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))}get _hasDefaultMaterial(){return Me.DefaultMaterialFactory!==Me._OriginalDefaultMaterialFactory}get defaultMaterial(){return this._defaultMaterial||(this._defaultMaterial=Me.DefaultMaterialFactory(this)),this._defaultMaterial}set defaultMaterial(e){this._defaultMaterial=e}set texturesEnabled(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(1))}get texturesEnabled(){return this._texturesEnabled}get frameGraph(){return this._frameGraph}set frameGraph(e){if(this._frameGraph){this._frameGraph=e,e||(this.customRenderFunction=this._currentCustomRenderFunction);return}this._frameGraph=e,e&&(this._currentCustomRenderFunction=this.customRenderFunction,this.customRenderFunction=this._renderWithFrameGraph,this.activeCamera=null)}set skeletonsEnabled(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(8))}get skeletonsEnabled(){return this._skeletonsEnabled}get collisionCoordinator(){return this._collisionCoordinator||(this._collisionCoordinator=Me.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator}get renderingManager(){return this._renderingManager}get frustumPlanes(){return this._frustumPlanes}_registerTransientComponents(){if(this._transientComponents.length>0){for(const e of this._transientComponents)e.register();this._transientComponents.length=0}}_addComponent(e){this._components.push(e),this._transientComponents.push(e);const t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)}_getComponent(e){for(const t of this._components)if(t.name===e)return t;return null}get uniqueId(){return this._uniqueId}constructor(e,t){this._inputManager=new li(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this._clearColor=new dt(.2,.2,.3,1),this.onClearColorChangedObservable=new Ae,this.ambientColor=new lt(0,0,0),this.environmentIntensity=1,this.iblIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new Ae,this._forceWireframe=!1,this._skipFrustumClipping=!1,this._forcePointsCloud=!1,this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.objectRenderers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.effectLayers=[],this.sounds=null,this.layers=[],this.lensFlareSystems=[],this.proceduralTextures=[],this.animationsEnabled=!0,this._animationPropertiesOverride=null,this.useConstantAnimationDeltaTime=!1,this.constantlyUpdateMeshUnderPointer=!1,this.hoverCurs
vendor: 7,253 bytes, line 161
161or="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=[],this.onDisposeObservable=new Ae,this._onDisposeObserver=null,this.onBeforeRenderObservable=new Ae,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new Ae,this.onAfterRenderCameraObservable=new Ae,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new Ae,this.onAfterAnimationsObservable=new Ae,this.onBeforeDrawPhaseObservable=new Ae,this.onAfterDrawPhaseObservable=new Ae,this.onReadyObservable=new Ae,this.onBeforeCameraRenderObservable=new Ae,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new Ae,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new Ae,this.onAfterActiveMeshesEvaluationObservable=new Ae,this.onBeforeParticlesRenderingObservable=new Ae,this.onAfterParticlesRenderingObservable=new Ae,this.onDataLoadedObservable=new Ae,this.onNewCameraAddedObservable=new Ae,this.onCameraRemovedObservable=new Ae,this.onNewLightAddedObservable=new Ae,this.onLightRemovedObservable=new Ae,this.onNewGeometryAddedObservable=new Ae,this.onGeometryRemovedObservable=new Ae,this.onNewTransformNodeAddedObservable=new Ae,this.onTransformNodeRemovedObservable=new Ae,this.onNewMeshAddedObservable=new Ae,this.onMeshRemovedObservable=new Ae,this.onNewSkeletonAddedObservable=new Ae,this.onSkeletonRemovedObservable=new Ae,this.onNewParticleSystemAddedObservable=new Ae,this.onParticleSystemRemovedObservable=new Ae,this.onNewAnimationGroupAddedObservable=new Ae,this.onAnimationGroupRemovedObservable=new Ae,this.onNewMaterialAddedObservable=new Ae,this.onNewMultiMaterialAddedObservable=new Ae,this.onMaterialRemovedObservable=new Ae,this.onMultiMaterialRemovedObservable=new Ae,this.onNewTextureAddedObservable=new Ae,this.onTextureRemovedObservable=new Ae,this.onNewFrameGraphAddedObservable=new Ae,this.onFrameGraphRemovedObservable=new Ae,this.onNewObjectRendererAddedObservable=new Ae,this.onObjectRendererRemovedObservable=new Ae,this.onNewPostProcessAddedObservable=new Ae,this.onPostProcessRemovedObservable=new Ae,this.onNewEffectLayerAddedObservable=new Ae,this.onEffectLayerRemovedObservable=new Ae,this.onBeforeRenderTargetsRenderObservable=new Ae,this.onAfterRenderTargetsRenderObservable=new Ae,this.onBeforeStepObservable=new Ae,this.onAfterStepObservable=new Ae,this.onActiveCameraChanged=new Ae,this.onActiveCamerasChanged=new Ae,this.onBeforeRenderingGroupObservable=new Ae,this.onAfterRenderingGroupObservable=new Ae,this.onMeshImportedObservable=new Ae,this.onAnimationFileImportedObservable=new Ae,this.onEnvironmentTextureChangedObservable=new Ae,this.onMeshUnderPointerUpdatedObservable=new Ae,this._registeredForLateAnimationBindings=new qr(256),this._pointerPickingConfiguration=new Bw,this.onPrePointerObservable=new Ae,this.onPointerObservable=new Ae,this.onPreKeyboardObservable=new Ae,this.onKeyboardObservable=new Ae,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=Me.FOGMODE_NONE,this.fogColor=new lt(.2,.2,.3),this.fogDensity=.1,this.fogStart=0,this.fogEnd=1e3,this.needsPreviousWorldMatrices=!1,this._shadowsEnabled=!0,this._lightsEnabled=!0,this._unObserveActiveCameras=null,this._texturesEnabled=!0,this._frameGraph=null,this.frameGraphs=[],this.physicsEnabled=!0,this.particlesEnabled=!0,this.spritesEnabled=!0,this._skeletonsEnabled=!0,this.lensFlaresEnabled=!0,this.collisionsEnabled=!0,this.gravity=new E(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new qr(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new Xs,this._activeIndices=new Xs,this._activeParticles=new Xs,this._activeBones=new Xs,this._animationTime=0,this.animationTimeScale=1,this._renderId=0,this._frameId=0,this._executeWhenReadyTimeoutId=null,this._intermediateRendering=!1,this._defaultFrameBufferCleared=!1,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1,this._toBeDisposed=new Array(256),this._activeRequests=new Array,this._delayedFileRequests=null,this._pendingData=[],this._isDisposed=!1,this._isDisposing=!1,this._isReadyChecks=[],this.dispatchAllSubMeshesOfActiveMeshes=!1,this._activeMeshes=new ds(256),this._processedMaterials=new ds(256),this._renderTargets=new qr(256),this._materialsRenderTargets=new qr(256),this._activeParticleSystems=new ds(256),this._activeSkeletons=new qr(32),this._softwareSkinnedMeshes=new qr(32),this._activeAnimatables=new Array,this._transformMatrix=se.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=oi.Create(),this._beforeClearStage=oi.Create(),this._beforeRenderTargetClearStage=oi.Create(),this._gatherRenderTargetsStage=oi.Create(),this._gatherActiveCameraRenderTargetsStage=oi.Create(),this._isReadyForMeshStage=oi.Create(),this._beforeEvaluateActiveMeshStage=oi.Create(),this._evaluateSubMeshStage=oi.Create(),this._preActiveMeshStage=oi.Create(),this._cameraDrawRenderTargetStage=oi.Create(),this._beforeCameraDrawStage=oi.Create(),this._beforeRenderTargetDrawStage=oi.Create(),this._beforeRenderingGroupDrawStage=oi.Create(),this._beforeRenderingMeshStage=oi.Create(),this._afterRenderingMeshStage=oi.Create(),this._afterRenderingGroupDrawStage=oi.Create(),this._afterCameraDrawStage=oi.Create(),this._afterCameraPostProcessStage=oi.Create(),this._afterRenderTargetDrawStage=oi.Create(),this._afterRenderTargetPostProcessStage=oi.Create(),this._afterRenderStage=oi.Create(),this._pointerMoveStage=oi.Create(),this._pointerDownStage=oi.Create(),this._pointerUpStage=oi.Create(),this._geometriesByUniqueId=null,this._uniqueId=0,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this.onReadyTimeoutObservable=new Ae,this.onReadyTimeoutDuration=120*1e3,this._timeoutChecksStartTime=0,this._floatingOriginScene=void 0,this._preventFreeActiveMeshesAndRenderingGroups=!1,this._activeMeshesFrozen=!1,this._activeMeshesFrozenButKeepClipping=!1,this._skipEvaluateActiveMeshesCompletely=!1,this._freezeActiveMeshesCancel=null,this._useCurrentFrameBuffer=!1,this._allowPostProcessClearColor=!0,this.getDeterministicFrameTime=()=>this._engine.getTimeStep(),this._getFloatingOriginScene=()=>this._floatingOriginScene,this._registeredActions=0,this._blockMaterialDirtyMechanism=!1,this._perfCollector=null,this.activeCameras=[],this._uniqueId=this.getUniqueId();const i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,defaultCameraLayerMask:268435455,defaultRenderableLayerMask:268435455,...t};this.defaultCameraLayerMask=i.defaultCameraLayerMask,this.defaultRenderableLayerMask=i.defaultRenderableLayerMask,e=this._engine=e||ft.LastCreatedEngine,i.virtual?e._virtualScenes.push(this):(ft._LastCreatedScene=this,e.scenes.push(this)),(e.getCreationOptions().useLargeWorldRendering||t?.useFloatingOrigin)&&(sw(),this._floatingOriginScene=this,ml.getSce
vendor: 5,087 bytes, line 161
161ne=this._getFloatingOriginScene),this._uid=null,this._renderingManager=new Xi(this),f0&&(this.postProcessManager=new f0(this)),Bi()&&this.attachControl(),this._createUbo(),u0&&(this._imageProcessingConfiguration=new u0),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.useClonedMeshMap,(!t||!t.virtual)&&e.onNewSceneAddedObservable.notifyObservers(this)}getClassName(){return"Scene"}_getDefaultMeshCandidates(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates}_getDefaultSubMeshCandidates(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates}setDefaultCandidateProviders(){this.getActiveMeshCandidates=()=>this._getDefaultMeshCandidates(),this.getActiveSubMeshCandidates=e=>this._getDefaultSubMeshCandidates(e),this.getIntersectingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e),this.getCollidingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e)}get meshUnderPointer(){return this._inputManager.meshUnderPointer}get pointerX(){return this._inputManager.pointerX}set pointerX(e){this._inputManager.pointerX=e}get pointerY(){return this._inputManager.pointerY}set pointerY(e){this._inputManager.pointerY=e}getCachedMaterial(){return this._cachedMaterial}getCachedEffect(){return this._cachedEffect}getCachedVisibility(){return this._cachedVisibility}isCachedMaterialInvalid(e,t,i=1){return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i}getEngine(){return this._engine}getTotalVertices(){return this._totalVertices.current}get totalVerticesPerfCounter(){return this._totalVertices}getActiveIndices(){return this._activeIndices.current}get totalActiveIndicesPerfCounter(){return this._activeIndices}getActiveParticles(){return this._activeParticles.current}get activeParticlesPerfCounter(){return this._activeParticles}getActiveBones(){return this._activeBones.current}get activeBonesPerfCounter(){return this._activeBones}getActiveMeshes(){return this._activeMeshes}getAnimationRatio(){return this._animationRatio!==void 0?this._animationRatio:1}getRenderId(){return this._renderId}getFrameId(){return this._frameId}incrementRenderId(){this._renderId++}_createUbo(){this.setSceneUniformBuffer(this.createSceneUniformBuffer())}simulatePointerMove(e,t){return this._inputManager.simulatePointerMove(e,t),this}simulatePointerDown(e,t){return this._inputManager.simulatePointerDown(e,t),this}simulatePointerUp(e,t,i){return this._inputManager.simulatePointerUp(e,t,i),this}isPointerCaptured(e=0){return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,i=!0){this._inputManager.attachControl(e,t,i)}detachControl(){this._inputManager.detachControl()}isReady(e=!0){if(this._isDisposed)return!1;let t;const i=this.getEngine(),s=i.currentRenderPassId;i.currentRenderPassId=this.activeCamera?.renderPassId??s;let r=!0;for(this._pendingData.length>0&&(r=!1),this.prePassRenderer?.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&r&&(r=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t<this.meshes.length;t++){const o=this.meshes[t];if(!o.subMeshes||o.subMeshes.length===0)continue;if(!o.isReady(!0)){r=!1;continue}const c=o.hasThinInstances||o.getClassName()==="InstancedMesh"||o.getClassName()==="InstancedLinesMesh"||i.getCaps().instancedArrays&&o.instances.length>0;for(const f of this._isReadyForMeshStage)f.action(o,c)||(r=!1);if(!e)continue;const h=o.material||this.defaultMaterial;if(h)if(h._storeEffectOnSubMeshes)for(const f of o.subMeshes){const _=f.getMaterial();_&&_.hasRenderTargetTextures&&_.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(_)===-1&&(this._processedMaterials.push(_),this._materialsRenderTargets.concatWithNoDuplicate(_.getRenderTargetTextures()))}else h.hasRenderTargetTextures&&h.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(h)===-1&&(this._processedMaterials.push(h),this._materialsRenderTargets.concatWithNoDuplicate(h.getRenderTargetTextures()))}if(e){for(t=0;t<this._materialsRenderTargets.length;++t)this._materialsRenderTargets.data[t].isReadyForRendering()||(r=!1);for(t=0;t<this.customRenderTargets.length;++t)this.customRenderTargets[t].isReadyForRendering()||(r=!1)}for(t=0;t<this.geometries.length;t++)this.geometries[t].delayLoadState===2&&(r=!1);if(this.activeCameras&&this.activeCameras.length>0)for(const o of this.activeCameras)o.isReady(!0)||(r=!1);else this.activeCamera&&(this.activeCamera.isReady(!0)||(r=!1));for(const o of this.particleSystems)o.isReady()||(r=!1);if(this.proceduralTexturesEnabled)for(const o of this.proceduralTextures)o.isReady()||(r=!1);if(this.layers)for(const o of this.layers)o.isReady()||(r=!1);if(this.effectLayers)for(const o of this.effectLayers)o.isLayerReady()||(r=!1);for(const o of this._isReadyChecks)o.isReady()||(r=!1);
161return i.areAllEffectsReady()||(r=!1),i.currentRenderPassId=s,r}resetCachedMaterial(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null}registerBeforeRender(e){this.onBeforeRenderObservable.add(e)}unregisterBeforeRender(e){this.onBeforeRenderObservable.removeCallback(e)}registerAfterRender(e){this.onAfterRenderObservable.add(e)}unregisterAfterRender(e){this.onAfterRenderObservable.removeCallback(e)}_executeOnceBeforeRender(e){const t=()=>{e(),setTimeout(()=>{this.unregisterBeforeRender(t)})};this.registerBeforeRender(t)}executeOnceBeforeRender(e,t){t!==void 0?setTimeout(()=>{this._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)}addPendingData(e){this._pendingData.push(e)}removePendingData(e){const t=this.isLoading,i=this._pendingData.indexOf(e);i!==-1&&this._pendingData.splice(i,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)}getWaitingItemsCount(){return this._pendingData.length}get isLoading(){return this._pendingData.length>0}addIsReadyCheck(e){this._isReadyChecks.indexOf(e)===-1&&this._isReadyChecks.push(e)}removeIsReadyCheck(e){const t=this._isReadyChecks.indexOf(e);t!==-1&&this._isReadyChecks.splice(t,1)}executeWhenReady(e,t=!1){this.onReadyObservable.addOnce(e),this._executeWhenReadyTimeoutId===null&&this._checkIsReady(t)}async whenReadyAsync(e=!1){return await new Promise(t=>{this.executeWhenReady(()=>{t()},e)})}_clearReadynessChecksData(){this._timeoutChecksStartTime=0,this.onReadyTimeoutObservable.clear(),this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null}_checkIsReady(e=!1){if(this._registerTransientComponents(),this._timeoutChecksStartTime===0)this._timeoutChecksStartTime=Vn.Now;else if(this.onReadyTimeoutDuration>0&&Vn.Now-this._timeoutChecksStartTime>this.onReadyTimeoutDuration){this.onReadyTimeoutObservable.notifyObservers(this),this._clearReadynessChecksData();return}if(this.isReady(e)){this.onReadyObservable.notifyObservers(this),this._clearReadynessChecksData();return}if(this._isDisposed){this._clearReadynessChecksData();return}this._executeWhenReadyTimeoutId=setTimeout(()=>{this.incrementRenderId(),this._checkIsReady(e)},100)}get animatables(){return this._activeAnimatables}resetLastAnimationTimeFrame(){this._animationTimeLast=Vn.Now}getViewMatrix(){return this._viewMatrix}getProjectionMatrix(){return this._projectionMatrix}getInverseProjectionMatrix(){return this._inverseProjectionMatrix}getTransformMatrix(){return this._transformMatrix}setTransformMatrix(e,t,i,s){this._multiviewSceneUboIsActive=!!(i&&s&&this._multiviewSceneUbo),!(this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag)&&(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._inverseProjectionMatrix||(this._inverseProjectionMatrix=new se),this._projectionMatrix.invertToRef(this._inverseProjectionMatrix),this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?Ns.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=Ns.GetPlanes(this._transformMatrix),this._multiviewSceneUboIsActive&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,s):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.updateMatrix("projection",this._projectionMatrix),this._sceneUbo.updateMatrix("inverseProjection",this._inverseProjectionMatrix)))}getSceneUniformBuffer(){return this._multiviewSceneUboIsActive&&this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo}createSceneUniformBuffer(e,t){const i=typeof t=="boolean"?t:t?.trackUBOsInFrame,s=new Le(this._engine,void 0,!1,e??"scene",void 0,i);return s.addUniform("viewProjection",16),s.addUniform("view",16),s.addUniform("projection",16),s.addUniform("vEyePosition",4),s.addUniform("inverseProjection",16),s}setSceneUniformBuffer(e){this._sceneUbo=e,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1}get floatingOriginMode(){return this._floatingOriginScene!==void 0}get floatingOriginOffset(){return this.floatingOriginMode?this._eyePosition:E.ZeroReadOnly}getUniqueId(){return q1.UniqueId}
vendor: 12,399 bytes, line 161
161addMesh(e,t=!1){if(!this._blockEntityCollection&&(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),Ki.SetImmediate(()=>{this.onNewMeshAddedObservable.notifyObservers(e)}),t)){const i=e.getChildMeshes();for(const s of i)this.addMesh(s)}}removeMesh(e,t=!1){const i=this.meshes.indexOf(e);if(i!==-1&&(this.meshes.splice(i,1),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t){const s=e.getChildMeshes();for(const r of s)this.removeMesh(r)}return i}addTransformNode(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneTransformNodesArray!==-1||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))}removeTransformNode(e){const t=e._indexInSceneTransformNodesArray;if(t!==-1){if(t!==this.transformNodes.length-1){const i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t}removeSkeleton(e){const t=this.skeletons.indexOf(e);return t!==-1&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e),this._executeActiveContainerCleanup(this._activeSkeletons)),t}removeMorphTargetManager(e){const t=this.morphTargetManagers.indexOf(e);return t!==-1&&this.morphTargetManagers.splice(t,1),t}removeLight(e){const t=this.lights.indexOf(e);if(t!==-1){for(const i of this.meshes)i._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes(),this.onLightRemovedObservable.notifyObservers(e)}return t}removeCamera(e){const t=this.cameras.indexOf(e);if(t!==-1&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){const i=this.activeCameras.indexOf(e);i!==-1&&this.activeCameras.splice(i,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t}removeParticleSystem(e){const t=this.particleSystems.indexOf(e);return t!==-1&&(this.particleSystems.splice(t,1),this._executeActiveContainerCleanup(this._activeParticleSystems)),this.onParticleSystemRemovedObservable.notifyObservers(e),t}removeAnimation(e){const t=this.animations.indexOf(e);return t!==-1&&this.animations.splice(t,1),t}stopAnimation(e,t,i){}removeAnimationGroup(e){const t=this.animationGroups.indexOf(e);return t!==-1&&this.animationGroups.splice(t,1),this.onAnimationGroupRemovedObservable.notifyObservers(e),t}removeMultiMaterial(e){const t=this.multiMaterials.indexOf(e);return t!==-1&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t}removeMaterial(e){const t=e._indexInSceneMaterialArray;if(t!==-1&&t<this.materials.length){if(t!==this.materials.length-1){const i=this.materials[this.materials.length-1];this.materials[t]=i,i._indexInSceneMaterialArray=t}e._indexInSceneMaterialArray=-1,this.materials.pop()}return this.onMaterialRemovedObservable.notifyObservers(e),t}removeActionManager(e){const t=this.actionManagers.indexOf(e);return t!==-1&&this.actionManagers.splice(t,1),t}removeTexture(e){const t=this.textures.indexOf(e);return t!==-1&&this.textures.splice(t,1),this.onTextureRemovedObservable.notifyObservers(e),t}removeFrameGraph(e){const t=this.frameGraphs.indexOf(e);return t!==-1&&this.frameGraphs.splice(t,1),this.onFrameGraphRemovedObservable.notifyObservers(e),t}removeObjectRenderer(e){const t=this.objectRenderers.indexOf(e);return t!==-1&&this.objectRenderers.splice(t,1),this.onObjectRendererRemovedObservable.notifyObservers(e),t}removePostProcess(e){const t=this.postProcesses.indexOf(e);return t!==-1&&this.postProcesses.splice(t,1),this.onPostProcessRemovedObservable.notifyObservers(e),t}removeEffectLayer(e){const t=this.effectLayers.indexOf(e);return t!==-1&&this.effectLayers.splice(t,1),this.onEffectLayerRemovedObservable.notifyObservers(e),t}addLight(e){if(!this._blockEntityCollection){this.lights.push(e),this.sortLightsByPriority(),e.parent||e._addToSceneRootNodes();for(const t of this.meshes)t.lightSources.indexOf(e)===-1&&(t.lightSources.push(e),t._resyncLightSources());Ki.SetImmediate(()=>{this.onNewLightAddedObservable.notifyObservers(e)})}}sortLightsByPriority(){this.requireLightSorting&&this.lights.sort(Li.CompareLightsPriority)}addCamera(e){this._blockEntityCollection||(this.cameras.push(e),Ki.SetImmediate(()=>{this.onNewCameraAddedObservable.notifyObservers(e)}),e.parent||e._addToSceneRootNodes())}addSkeleton(e){this._blockEntityCollection||(this.skeletons.push(e),Ki.SetImmediate(()=>{this.onNewSkeletonAddedObservable.notifyObservers(e)}))}addParticleSystem(e){this._blockEntityCollection||(this.particleSystems.push(e),Ki.SetImmediate(()=>{this.onNewParticleSystemAddedObservable.notifyObservers(e)}))}addAnimation(e){this._blockEntityCollection||this.animations.push(e)}addAnimationGroup(e){this._blockEntityCollection||(this.animationGroups.push(e),Ki.SetImmediate(()=>{this.onNewAnimationGroupAddedObservable.notifyObservers(e)}))}addMultiMaterial(e){this._blockEntityCollection||(this.multiMaterials.push(e),Ki.SetImmediate(()=>{this.onNewMultiMaterialAddedObservable.notifyObservers(e)}))}addMaterial(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneMaterialArray!==-1||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),Ki.SetImmediate(()=>{this.onNewMaterialAddedObservable.notifyObservers(e)}))}addMorphTargetManager(e){this._blockEntityCollection||this.morphTargetManagers.push(e)}addGeometry(e){this._blockEntityCollection||(this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))}addActionManager(e){this.actionManagers.push(e)}addTexture(e){this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))}addFrameGraph(e){this.frameGraphs.push(e),Ki.SetImmediate(()=>{this.onNewFrameGraphAddedObservable.notifyObservers(e)})}addObjectRenderer(e){this.objectRenderers.push(e),Ki.SetImmediate(()=>{this.onNewObjectRendererAddedObservable.notifyObservers(e)})}addPostProcess(e){this._blockEntityCollection||(this.postProcesses.push(e),Ki.SetImmediate(()=>{this.onNewPostProcessAddedObservable.notifyObservers(e)}))}addEffectLayer(e){this._blockEntityCollection||(this.effectLayers.push(e),Ki.SetImmediate(()=>{this.onNewEffectLayerAddedObservable.notifyObservers(e)}))}switchActiveCamera(e,t=!0){this._engine.getInputElement()&&(this.activeCamera&&this.activeCamera.detachControl(),this.activeCamera=e,t&&e.attachControl())}setActiveCameraById(e){const t=this.getCameraById(e);return t?(this.activeCamera=t,t):null}setActiveCameraByName(e){const t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null}getAnimationGroupByName(e){for(let t=0;t<this.animationGroups.length;t++)if(this.animationGroups[t].name===e)return this.animationGroups[t];return null}_getMaterial(e,t){for(let i=0;i<this.materials.length;i++){const s=this.materials[i];if(t(s))return s}if(e)for(let i=0;i<this.multiMaterials.length;i++){const s=this.multiMaterials[i];if(t(s))return s}return null}getMaterialByUniqueID(e,t=!1){return this.getMaterialByUniqueId(e,t)}getMaterialByUniqueId(e,t=!1){return this._getMaterial(t,i=>i.uniqueId===e)}getMaterialById(e,t=!1){return this._getMaterial(t,i=>i.id===e)}getMaterialByName(e,t=!1){return this._getMaterial(t,i=>i.name===e)}getLastMaterialById(e,t=!1){for(let i=this.materials.length-1;i>=0;i--)if(this.materials[i].id===e)return this.materials[i];if(t){for(let i=this.multiMaterials.length-1;i>=0;i--)if(this.multiMaterials[i].id===e)return this.multiMaterials[i]}return null}getTextureByUniqueId(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].uniqueId===e)return this.textures[t];return null}getTextureByName(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].name===e)return this.textures[t];return null}getCameraById(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].id===e)return this.cameras[t];return null}getCameraByUniqueId(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].uniqueId===e)return this.cameras[t];return null}getCameraByName(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].name===e)return this.cameras[t];return null}getBoneById(e){for(let t=0;t<this.skeletons.length;t++){const i=this.skeletons[t];for(let s=0;s<i.bones.length;s++)if(i.bones[s].id===e)return i.bones[s]}return null}getBoneByName(e){for(let t=0;t<this.skeletons.length;t++){const i=this.skeletons[t];for(let s=0;s<i.bones.length;s++)if(i.bones[s].name===e)return i.bones[s]}return null}getLightByName(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].name===e)return this.lights[t];return null}getLightById(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].id===e)return this.lights[t];return null}getLightByUniqueId(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].uniqueId===e)return this.lights[t];return null}getParticleSystemById(e){for(let t=0;t<this.particleSystems.length;t++)if(this.particleSystems[t].id===e)return this.particleSystems[t];return null}getGeometryById(e){for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].id===e)return this.geometries[t];return null}_getGeometryByUniqueId(e){if(this._geometriesByUniqueId){const t=this._geometriesByUniqueId[e];if(t!==void 0)return this.geometries[t]}else for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].uniqueId===e)return this.geometries[t];return null}getFrameGraphByName(e){for(let t=0;t<this.frameGraphs.length;t++)if(this.frameGraphs[t].name===e)return this.frameGraphs[t];return null}pushGeometry(e,t){return!t&&this._getGeometryByUniqueId(e.uniqueId)?!1:(this.addGeometry(e),Ki.SetImmediate(()=>{this.onNewGeometryAddedObservable.notifyObservers(e)}),!0)}removeGeometry(e){let t;if(this._geometriesByUniqueId){if(t=this._geometriesByUniqueId[e.uniqueId],t===void 0)return!1}else if(t=this.geometries.indexOf(e),t<0)return!1;if(t!==this.geometries.length-1){const i=this.geometries[this.geometries.length-1];i&&(this.geometries[t]=i,this._geometriesByUniqueId&&(this._geometriesByUniqueId[i.uniqueId]=t))}return this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=void 0),this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0}getGeometries(){return this.geometries}getMeshById(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].id===e)return this.meshes[t];return null}getMeshesById(e){return this.meshes.filter(function(t){return t.id===e})}getTransformNodeById(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getTransformNodeByUniqueId(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].uniqueId===e)return this.transformNodes[t];return null}getTransformNodesById(e){return this.transformNodes.filter(function(t){return t.id===e})}getMeshByUniqueId(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].uniqueId===e)return this.meshes[t];return null}getLastMeshById(e){for(let t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null}getLastTransformNodeById(e){for(let t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getLastEntryById(e){let t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];for(t=this.skeletons.length-1;t>=0;t--){const i=this.skeletons[t];for(let s=i.bones.length-1;s>=0;s--)if(i.bones[s].id===e)return i.bones[s]}return null}getNodeById(e){const t=this.getMeshById(e);if(t)return t;const i=this.getTransformNodeById(e);if(i)return i;const s=this.getLightById(e);if(s)return s;const r=this.getCameraById(e);if(r)return r;const o=this.getBoneById(e);return o||null}getNodeByName(e){const t=this.getMeshByName(e);
vendor: 4,685 bytes, line 161
161if(t)return t;const i=this.getTransformNodeByName(e);if(i)return i;const s=this.getLightByName(e);if(s)return s;const r=this.getCameraByName(e);if(r)return r;const o=this.getBoneByName(e);return o||null}getMeshByName(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].name===e)return this.meshes[t];return null}getTransformNodeByName(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].name===e)return this.transformNodes[t];return null}getLastSkeletonById(e){for(let t=this.skeletons.length-1;t>=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByUniqueId(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].uniqueId===e)return this.skeletons[t];return null}getSkeletonById(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByName(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].name===e)return this.skeletons[t];return null}getMorphTargetManagerById(e){for(let t=0;t<this.morphTargetManagers.length;t++)if(this.morphTargetManagers[t].uniqueId===e)return this.morphTargetManagers[t];return null}getMorphTargetById(e){for(let t=0;t<this.morphTargetManagers.length;++t){const i=this.morphTargetManagers[t];for(let s=0;s<i.numTargets;++s){const r=i.getTarget(s);if(r.id===e)return r}}return null}getMorphTargetByName(e){for(let t=0;t<this.morphTargetManagers.length;++t){const i=this.morphTargetManagers[t];for(let s=0;s<i.numTargets;++s){const r=i.getTarget(s);if(r.name===e)return r}}return null}getPostProcessByName(e){for(let t=0;t<this.postProcesses.length;++t){const i=this.postProcesses[t];if(i.name===e)return i}return null}isActiveMesh(e){return this._activeMeshes.indexOf(e)!==-1}get uid(){return this._uid||(this._uid=_t.RandomId()),this._uid}addExternalData(e,t){return this._externalData||(this._externalData=new h0),this._externalData.add(e,t)}getExternalData(e){return this._externalData?this._externalData.get(e):null}getOrAddExternalDataWithFactory(e,t){return this._externalData||(this._externalData=new h0),this._externalData.getOrAddWithFactory(e,t)}removeExternalData(e){return this._externalData.remove(e)}_evaluateSubMesh(e,t,i,s){if(s||e.isInFrustum(this._frustumPlanes)){for(const o of this._evaluateSubMeshStage)o.action(t,e);const r=e.getMaterial();r!=null&&(r.hasRenderTargetTextures&&r.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(r)===-1&&(this._processedMaterials.push(r),this._materialsRenderTargets.concatWithNoDuplicate(r.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,r))}}freeProcessedMaterials(){this._processedMaterials.dispose()}get blockfreeActiveMeshesAndRenderingGroups(){return this._preventFreeActiveMeshesAndRenderingGroups}set blockfreeActiveMeshesAndRenderingGroups(e){this._preventFreeActiveMeshesAndRenderingGroups!==e&&(e&&(this.freeActiveMeshes(),this.freeRenderingGroups()),this._preventFreeActiveMeshesAndRenderingGroups=e)}freeActiveMeshes(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._activeMeshes.dispose(),this.activeCamera&&this.activeCamera._activeMeshes&&this.activeCamera._activeMeshes.dispose(),this.activeCameras))for(let e=0;e<this.activeCameras.length;e++){const t=this.activeCameras[e];t&&t._activeMeshes&&t._activeMeshes.dispose()}}freeRenderingGroups(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._renderingManager&&this._renderingManager.freeRenderingGroups(),this.textures))for(let e=0;e<this.textures.length;e++){const t=this.textures[e];t&&t.renderList&&t.freeRenderingGroups()}}_isInIntermediateRendering(){return this._intermediateRendering}freezeActiveMeshes(e=!1,t,i,s=!0,r=!1){if(this.frameGraph){this._renderWithFrameGraph(!0,!1,!0);const o=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(const c of o)c.objectRenderer._freezeActiveMeshes(s);return this._freezeActiveMeshesCancel=Zd(()=>{let c=!0,h=!0;for(const f of o)c&&(c=f.objectRenderer._isFrozen),h&&(h=f.objectRenderer._freezeActiveMeshesCancel!==null);if(c)return!0;if(!h)throw new Error("Freezing active meshes was cancelled");return!1},()=>{this._freezeActiveMeshesCancel=null,this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=r,this._skipEvaluateActiveMeshesCompletely=e,t?.()},(c,h)=>{if(this._freezeActiveMeshesCancel=null,this.unfreezeActiveMeshes(),h){const f="Scene: Timeout while waiting for meshes to be frozen.";i?i(f):(me.Error(f),c&&me.Error(c))}else{const f="Scene: An unexpected error occurred while trying to freeze active meshes.";i?i(f):(me.Error(f),c&&(me.Error(c),c.stack&&me.Error(c.stack)))}}),this}return this.executeWhenReady(()=>
vendor: 12,365 bytes, line 161
161{if(!this.activeCamera){i&&i("No active camera found");return}if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=r,this._skipEvaluateActiveMeshesCompletely=e,s)for(let o=0;o<this._activeMeshes.length;o++)this._activeMeshes.data[o]._freeze();t&&t()}),this}unfreezeActiveMeshes(){for(let e=0;e<this.meshes.length;e++){const t=this.meshes[e];t._internalAbstractMeshDataInfo&&(t._internalAbstractMeshDataInfo._isActive=!1)}if(this._freezeActiveMeshesCancel?.(),this._freezeActiveMeshesCancel=null,this.frameGraph){const e=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(const t of e)t.objectRenderer._unfreezeActiveMeshes()}else for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();return this._activeMeshesFrozen=!1,this}_executeActiveContainerCleanup(e){!(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1)&&this._activeMeshesFrozen&&this._activeMeshes.length||this.onBeforeRenderObservable.addOnce(()=>e.dispose())}_evaluateActiveMeshes(){if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1){this._activeMeshes.length>0&&(this.activeCamera?._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset());return}if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely){const i=this._activeMeshes.length;for(let s=0;s<i;s++)this._activeMeshes.data[s].computeWorldMatrix()}if(this._activeParticleSystems){const i=this._activeParticleSystems.length;for(let s=0;s<i;s++)this._activeParticleSystems.data[s].animate()}this._renderingManager.resetSprites();return}if(!this.activeCamera)return;this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this),this.activeCamera._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset(),this._materialsRenderTargets.reset();for(const i of this._beforeEvaluateActiveMeshStage)i.action();const e=this.getActiveMeshCandidates(),t=e.length;for(let i=0;i<t;i++){const s=e.data[i];let r=s._internalAbstractMeshDataInfo._currentLOD.get(this.activeCamera);if(r?r[1]=-1:(r=[s,-1],s._internalAbstractMeshDataInfo._currentLOD.set(this.activeCamera,r)),s.isBlocked||(this._totalVertices.addCount(s.getTotalVertices(),!1),!s.isReady()||!s.isEnabled()||s.scaling.hasAZeroComponent))continue;s.computeWorldMatrix(),s.actionManager&&s.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(s);let o=this.customLODSelector?this.customLODSelector(s,this.activeCamera):s.getLOD(this.activeCamera);if(r[0]=o,r[1]=this._frameId,o!=null&&(o!==s&&o.billboardMode!==0&&o.computeWorldMatrix(),s._preActivate(),s.isVisible&&s.visibility>0&&(s.layerMask&this.activeCamera.layerMask)!==0&&(this._skipFrustumClipping||s.alwaysSelectAsActiveMesh||s.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(s),this.activeCamera._activeMeshes.push(s),o!==s&&o._activate(this._renderId,!1);for(const c of this._preActiveMeshStage)c.action(s);s._activate(this._renderId,!1)&&(s.isAnInstance?s._internalAbstractMeshDataInfo._actAsRegularMesh&&(o=s):o._internalAbstractMeshDataInfo._onlyForInstances=!1,o._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(s,o)),s._postActivate()}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let i=0;i<this.particleSystems.length;i++){const s=this.particleSystems[i];if(!s.isStarted()||!s.emitter)continue;const r=s.emitter;(!r.position||r.isEnabled())&&(this._activeParticleSystems.push(s),s.animate(),this._renderingManager.dispatchParticles(s))}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}_prepareSkeleton(e){!this._skeletonsEnabled||!e.skeleton||(this._activeSkeletons.pushNoDuplicate(e.skeleton)&&(e.skeleton.prepare(),this._activeBones.addCount(e.skeleton.bones.length,!1)),e.computeBonesUsingShaders||this._softwareSkinnedMeshes.pushNoDuplicate(e)&&this.frameGraph&&e.applySkeleton(e.skeleton))}_activeMesh(e,t){this._prepareSkeleton(t);let i=e.hasInstances||e.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh;if(t&&t.subMeshes&&t.subMeshes.length>0){const s=this.getActiveSubMeshCandidates(t),r=s.length;i=i||r===1;for(let o=0;o<r;o++){const c=s.data[o];this._evaluateSubMesh(c,t,e,i)}}}updateTransformMatrix(e){const t=this.activeCamera;if(t)if(t._renderingMultiview){const i=t._rigCameras[0],s=t._rigCameras[1];this.setTransformMatrix(i.getViewMatrix(),i.getProjectionMatrix(e),s.getViewMatrix(),s.getProjectionMatrix(e))}else this.setTransformMatrix(t.getViewMatrix(),t.getProjectionMatrix(e))}_bindFrameBuffer(e,t=!0){this._useCurrentFrameBuffer||(e&&e._multiviewTexture?e._multiviewTexture._bindFrameBuffer():e&&e.outputRenderTarget?e.outputRenderTarget._bindFrameBuffer():this._engine._currentFrameBufferIsDefaultFrameBuffer()||this._engine.restoreDefaultFramebuffer()),t&&this._clearFrameBuffer(e)}_clearFrameBuffer(e){if(!(e&&e._multiviewTexture))if(e&&e.outputRenderTarget&&!e._renderingMultiview){const t=e.outputRenderTarget;t.onClearObservable.hasObservers()?t.onClearObservable.notifyObservers(this._engine):!t.skipInitialClear&&!e.isRightCamera&&(this.autoClear&&this._engine.clear(t.clearColor||this._clearColor,!t._cleared,!0,!0),t._cleared=!0)}else this._defaultFrameBufferCleared?this._engine.clear(null,!1,!0,!0):(this._defaultFrameBufferCleared=!0,this._clear())}_renderForCamera(e,t,i=!0){if(e&&e._skipRendering)return;const s=this._engine;if(this._activeCamera=e,!this.activeCamera)throw new Error("Active camera not set");if(s.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,!this.prePass&&i){let c=!0;e._renderingMultiview&&e.outputRenderTarget&&(c=e.outputRenderTarget.skipInitialClear,this.autoClear&&(this._defaultFrameBufferCleared=!1,e.outputRenderTarget.skipInitialClear=!1)),this._bindFrameBuffer(this._activeCamera),e._renderingMultiview&&e.outputRenderTarget&&(e.outputRenderTarget.skipInitialClear=c)}this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._engine.currentRenderPassId=e.outputRenderTarget?.renderPassId??e.renderPassId??0,this._evaluateActiveMeshes();for(let c=0;c<this._softwareSkinnedMeshes.length;c++){const h=this._softwareSkinnedMeshes.data[c];h.applySkeleton(h.skeleton)}this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets),e.customRenderTargets&&e.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets),this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture);for(const c of this._gatherActiveCameraRenderTargetsStage)c.action(this._renderTargets);let r=!1;if(this.renderTargetsEnabled){this._intermediateRendering=!0;let c;if(this._renderTargets.length>0){_t.StartPerformanceCounter("Render targets",this._renderTargets.length>0);const h=this.getBoundingBoxRenderer?.();for(let f=0;f<this._renderTargets.length;f++){const _=this._renderTargets.data[f];if(_._shouldRender()){this._renderId++;const d=_.activeCamera&&_.activeCamera!==this.activeCamera;h&&!c&&(c=h.renderList.length>0?h.renderList.data.slice():[],c.length=h.renderList.length),_.render(d,this.dumpNextRenderTargets),r=!0}}h&&c&&(h.renderList.data=c,h.renderList.length=c.length),_t.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}if(this._cameraDrawRenderTargetStage.length>0){const h=this.getBoundingBoxRenderer?.();h&&!c&&(c=h.renderList.length>0?h.renderList.data.slice():[],c.length=h.renderList.length);for(const f of this._cameraDrawRenderTargetStage)r=f.action(this.activeCamera)||r;h&&c&&(h.renderList.data=c,h.renderList.length=c.length)}this._intermediateRendering=!1}r&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.postProcessManager&&!e._multiviewTexture&&!this.prePass&&this.postProcessManager._prepareFrame();for(const c of this._beforeCameraDrawStage)c.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this);const o=s.snapshotRendering&&s.snapshotRenderingMode===1;o&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!o),this.onAfterDrawPhaseObservable.notifyObservers(this);for(const c of this._afterCameraDrawStage)c.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){const c=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,c)}for(const c of this._afterCameraPostProcessStage)c.action(this.activeCamera);this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}_processSubCameras(e,t=!0){if(e.cameraRigMode===0||e._renderingMultiview){e._renderingMultiview&&!this._multiviewSceneUbo&&this._createMultiviewUbo(),this._renderForCamera(e,void 0,t),this.onAfterRenderCameraObservable.notifyObservers(e);return}if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else{this.onBeforeCameraRenderObservable.notifyObservers(e);for(let i=0;i<e._rigCameras.length;i++)this._renderForCamera(e._rigCameras[i],e)}this._activeCamera=e,this.updateTransformMatrix(),this.onAfterRenderCameraObservable.notifyObservers(e)}_checkIntersections(){for(let e=0;e<this._meshesForIntersections.length;e++){const t=this._meshesForIntersections.data[e];if(t.actionManager)for(let i=0;t.actionManager&&i<t.actionManager.actions.length;i++){const s=t.actionManager.actions[i];if(s.trigger===12||s.trigger===13){const r=s.getTriggerParameter(),o=r.mesh?r.mesh:r,c=o.intersectsMesh(t,r.usePreciseIntersection),h=t._intersectionsInProgress.indexOf(o);c&&h===-1?s.trigger===12?(s._executeCurrent(Pi.CreateNew(t,void 0,o)),t._intersectionsInProgress.push(o)):s.trigger===13&&t._intersectionsInProgress.push(o):!c&&h>-1&&(s.trigger===13&&s._executeCurrent(Pi.CreateNew(t,void 0,o)),(!t.actionManager.hasSpecificTrigger(13,f=>{const _=f.mesh?f.mesh:f;return o===_})||s.trigger===13)&&t._intersectionsInProgress.splice(h,1))}}}}_advancePhysicsEngineStep(e){}_animate(e){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(Me.MinDeltaTime,Math.min(this._engine.getDeltaTime(),Me.MaxDeltaTime))+this._timeAccumulator;const t=this._engine.getTimeStep(),i=1e3/t/1e3;let s=0;const r=this._engine.getLockstepMaxSteps();let o=Math.floor(e/t);for(o=Math.min(o,r);e>0&&s<o;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=t*i,this._animate(t),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(t),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,s++,e-=t;this._timeAccumulator=e<0?0:e}else{const e=this.useConstantAnimationDeltaTime?16:Math.max(Me.MinDeltaTime,Math.min(this._engine.getDeltaTime(),Me.MaxDeltaTime));this._animationRatio=e*(60/1e3),this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(e)}}_clear(){(this.autoClearDepthAndStencil||this.autoClear)&&this._engine.clear(this._clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil)}_checkCameraRenderTarget(e){if(e?.outputRenderTarget&&!e?.isRigCamera&&(e.outputRenderTarget._cleared=!1),e?.rigCameras?.length)for(let t=0;t<e.rigCameras.length;++t){const i=e.rigCameras[t].outputRenderTarget;i&&(i._cleared=!1)}}resetDrawCache(e){if(this.meshes)for(const t of this.meshes)t.resetDrawCache(e)}_renderWithFrameGraph(e=!0,t=!1,i=!1){if(this.activeCamera=null,this.activeCameras=null,e){for(const r of this.cameras)if(r.update(
vendor: 18,402 bytes, line 161
161),r.cameraRigMode!==0)for(let o=0;o<r._rigCameras.length;o++)r._rigCameras[o].update()}this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.reset();const s=this._frameGraph?.findMainCamera()??null;if(this.renderTargetsEnabled){this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture),this._renderTargets.concatWithNoDuplicate(this.customRenderTargets),_t.StartPerformanceCounter("Custom render targets",this._renderTargets.length>0);for(let r=0;r<this._renderTargets.length;r++){const o=this._renderTargets.data[r],c=o.activeCamera||s;this._renderRenderTarget(o,c,!0,this.dumpNextRenderTargets)}_t.EndPerformanceCounter("Custom render targets",this._renderTargets.length>0),this._renderId++}this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const r of this._beforeClearStage)r.action();if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1)this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();else{const r=this.getActiveMeshCandidates(),o=r.length;if(this._activeMeshesFrozen){if(!this._skipEvaluateActiveMeshesCompletely)for(let c=0;c<o;c++){const h=r.data[c];h._internalAbstractMeshDataInfo._wasActiveLastFrame&&h.computeWorldMatrix()}if(this.particlesEnabled){const c=this._activeParticleSystems.length;for(let h=0;h<c;h++)this._activeParticleSystems.data[h].animate()}}else{this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();for(let c=0;c<o;c++){const h=r.data[c];h._internalAbstractMeshDataInfo._wasActiveLastFrame=!1,!h.isBlocked&&(this._totalVertices.addCount(h.getTotalVertices(),!1),!(!h.isReady()||!h.isEnabled()||h.scaling.hasAZeroComponent)&&(h.computeWorldMatrix(i),h.actionManager&&h.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(h)))}if(this.particlesEnabled)for(let c=0;c<this.particleSystems.length;c++){const h=this.particleSystems[c];if(!h.isStarted()||!h.emitter)continue;const f=h.emitter;(!f.position||f.isEnabled())&&(this._activeParticleSystems.push(h),h.animate())}}}this.frameGraph?.execute()}_renderRenderTarget(e,t,i=!1,s=!1){if(this._intermediateRendering=!0,e._shouldRender()){if(this._renderId++,this.activeCamera=t,!this.activeCamera)throw new Error("Active camera not set");this._engine.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),e.render(i,s)}this._intermediateRendering=!1}render(e=!0,t=!1){if(!this.isDisposed){if(this.onReadyObservable.hasObservers()&&this._executeWhenReadyTimeoutId===null&&this._checkIsReady(),ml.getScene=this._getFloatingOriginScene,this._frameId++,this._defaultFrameBufferCleared=!1,this._checkCameraRenderTarget(this.activeCamera),this.activeCameras?.length)for(const i of this.activeCameras)this._checkCameraRenderTarget(i);this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(11),t||this.animate();for(const i of this._beforeCameraUpdateStage)i.action();if(e){if(this.activeCameras&&this.activeCameras.length>0)for(let i=0;i<this.activeCameras.length;i++){const s=this.activeCameras[i];if(s.update(),s.cameraRigMode!==0)for(let r=0;r<s._rigCameras.length;r++)s._rigCameras[r].update()}else if(this.activeCamera&&(this.activeCamera.update(),this.activeCamera.cameraRigMode!==0))for(let i=0;i<this.activeCamera._rigCameras.length;i++)this.activeCamera._rigCameras[i].update()}if(this.customRenderFunction)this._renderId++,this._engine.currentRenderPassId=0,this.customRenderFunction(e,t);else{this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);const i=this.activeCameras?.length?this.activeCameras[0]:this.activeCamera;if(this.renderTargetsEnabled){_t.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0);for(let s=0;s<this.customRenderTargets.length;s++){const r=this.customRenderTargets[s],o=r.activeCamera||this.activeCamera;this._renderRenderTarget(r,o,i!==o,this.dumpNextRenderTargets)}_t.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._renderId++}this._engine.currentRenderPassId=i?.renderPassId??0,this.activeCamera=i,this._activeCamera&&this._activeCamera.cameraRigMode!==22&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const s of this._beforeClearStage)s.action();this._clearFrameBuffer(this.activeCamera);for(const s of this._gatherRenderTargetsStage)s.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let s=0;s<this.activeCameras.length;s++)this._processSubCameras(this.activeCameras[s],s>0);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}}this._checkIntersections();for(const i of this._afterRenderStage)i.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let i=0;i<this._toBeDisposed.length;i++){const s=this._toBeDisposed[i];s&&s.dispose()}this._toBeDisposed.length=0}this.dumpNextRenderTargets&&(this.dumpNextRenderTargets=!1),this._activeBones.addCount(0,!0),this._activeIndices.addCount(0,!0),this._activeParticles.addCount(0,!0),this._engine.restoreDefaultFramebuffer()}}freezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].freeze()}unfreezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].unfreeze()}dispose(){if(this.isDisposed)return;if(this._isDisposing=!0,this.beforeRender=null,this.afterRender=null,this.metadata=null,this.skeletons.length=0,this.morphTargetManagers.length=0,this._transientComponents.length=0,this._isReadyForMeshStage.clear(),this._beforeEvaluateActiveMeshStage.clear(),this._evaluateSubMeshStage.clear(),this._preActiveMeshStage.clear(),this._cameraDrawRenderTargetStage.clear(),this._beforeCameraDrawStage.clear(),this._beforeRenderTargetDrawStage.clear(),this._beforeRenderingGroupDrawStage.clear(),this._beforeRenderingMeshStage.clear(),this._afterRenderingMeshStage.clear(),this._afterRenderingGroupDrawStage.clear(),this._afterCameraDrawStage.clear(),this._afterRenderTargetDrawStage.clear(),this._afterRenderStage.clear(),this._beforeCameraUpdateStage.clear(),this._beforeClearStage.clear(),this._gatherRenderTargetsStage.clear(),this._gatherActiveCameraRenderTargetsStage.clear(),this._pointerMoveStage.clear(),this._pointerDownStage.clear(),this._pointerUpStage.clear(),this._isReadyChecks.length=0,this.importedMeshesFiles=[],this._activeAnimatables&&jd(this.stopAllAnimations)){for(const r of this._activeAnimatables)r.onAnimationEndObservable.clear(),r.onAnimationEnd=null;this.stopAllAnimations()}this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this.activeCameras=null,this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._materialsRenderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed.length=0;const e=this._activeRequests.slice();for(const r of e)r.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(r){me.Error("An error occurred while calling onDisposeObservable!",r)}if(this.detachControl(),this._engine.getInputElement?.())for(let r=0;r<this.cameras.length;r++)this.cameras[r].detachControl();this._disposeList(this.animationGroups),this._disposeList(this.lights),this._defaultMaterial&&this._defaultMaterial.dispose(),this._disposeList(this.multiMaterials),this._disposeList(this.materials),this._disposeList(this.meshes,r=>r.dispose(!0)),this._disposeList(this.transformNodes,r=>r.dispose(!0));const i=this.cameras;this._disposeList(i),this._disposeList(this.particleSystems),this._disposeList(this.postProcesses),this._disposeList(this.textures),this._disposeList(this.morphTargetManagers),this._disposeList(this.frameGraphs),this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),this._disposeList(this._components);let s=this._engine.scenes.indexOf(this);if(s>-1&&this._engine.scenes.splice(s,1),this._floatingOriginScene=void 0,this._engine.scenes.length===0&&iw(),ft._LastCreatedScene===this){ft._LastCreatedScene=null;let r=ft.Instances.length-1;for(;r>=0;){const o=ft.Instances[r];if(o.scenes.length>0){ft._LastCreatedScene=o.scenes[this._engine.scenes.length-1];break}r--}}s=this._engine._virtualScenes.indexOf(this),s>-1&&this._engine._virtualScenes.splice(s,1),this._engine.wipeCaches(!0),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onAfterRenderCameraObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onNewFrameGraphAddedObservable.clear(),this.onFrameGraphRemovedObservable.clear(),this.onNewObjectRendererAddedObservable.clear(),this.onObjectRendererRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.onScenePerformancePriorityChangedObservable.clear(),this.onClearColorChangedObservable.clear(),this.onEnvironmentTextureChangedObservable.clear(),this.onMeshUnderPointerUpdatedObservable.clear(),this._isDisposed=!0}_disposeList(e,t){const i=e.slice(0);t=t??(s=>s.dispose());for(const s of i)t(s);e.length=0}get isDisposed(){return this._isDisposed}clearCachedVertexData(){for(let e=0;e<this.meshes.length;e++){const i=this.meshes[e].geometry;i&&i.clearCachedData()}}cleanCachedTextureBuffer(){for(const e of this.textures)e._buffer&&(e._buffer=null)}getWorldExtends(e){const t=new E(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new E(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);e=e||(()=>!0);const s=this.meshes.filter(e);for(const r of s){if(r.computeWorldMatrix(!0),!r.subMeshes||r.subMeshes.length===0||r.infiniteDistance)continue;const o=r.getBoundingInfo(),c=o.boundingBox.minimumWorld,h=o.boundingBox.maximumWorld;E.CheckExtends(c,t,i),E.CheckExtends(h,t,i)}return t.x===Number.MAX_VALUE?{min:E.Zero(),max:E.Zero()}:{min:t,max:i}}createPickingRay(e,t,i,s,r=!1){throw je("Ray")}createPickingRayToRef(e,t,i,s,r,o=!1,c=!1){throw je("Ray")}createPickingRayInCameraSpace(e,t,i){throw je("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,s){throw je("Ray")}pick(e,t,i,s,r,o){const c=je("Ray",!0);return c&&me.Warn(c),new _l}pickWithBoundingInfo(e,t,i,s,r){const o=je("Ray",!0);return o&&me.Warn(o),new _l}pickWithRay(e,t,i,s){throw je("Ray")}multiPick(e,t,i,s,r){throw je("Ray")}multiPickWithRay(e,t,i){throw je("Ray")}setPointerOverMesh(e,t,i){this._inputManager.setPointerOverMesh(e,t,i)}getPointerOverMesh(){return this._inputManager.getPointerOverMesh()}_rebuildGeometries(){for(const e of this.geometries)e._rebuild();for(const e of this.meshes)e._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(const e of this._components)e.rebuild();for(const e of this.particleSystems)e.rebuild();if(this.spriteManagers)for(const e of this.spriteManagers)e.rebuild()}_rebuildTextures(){for(const e of this.textures)e._rebuild(!0);this.markAllMaterialsAsDirty(1)}_getByTags(e,t,i){if(t===void 0)return e;const s=[];for(const r in e){const o=e[r];xt&&xt.MatchesQuery(o,t)&&(!i||i(o))&&s.push(o)}return s}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}setRenderingOrder(e,t=null,i=null,s=null){this._renderingManager.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,s)}getAutoClearDepthStencilSetup(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)}_forceBlockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism=e}get blockMaterialDirtyMechanism(){return this._blockMaterialDirtyMechanism}set blockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(127))}markAllMaterialsAsDirty(e,t){if(!this._blockMaterialDirtyMechanism)for(const i of this.materials)t&&!t(i)||i.markAsDirty(e)}_loadFile(e,t,i,s,r,o,c){const h=Tr(e,t,i,s?this.offlineProvider:void 0,r,o,c);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _loadFileAsync(e,t,i,s,r){return await new Promise((o,c)=>{this._loadFile(e,h=>{o(h)},t,i,s,(h,f)=>{c(f)},r)})}async _loadDelayedFileAsync(e,t,i){this._delayedFileRequests||(this._delayedFileRequests=new Map);const s=`${e}|${t?"binary":"string"}`;let r=this._delayedFileRequests.get(s);if(!r){r=t?this._loadFileAsync(e,void 0,i,!0):this._loadFileAsync(e,void 0,i,!1);const o=r;(async()=>{try{await o}catch{}this._delayedFileRequests?.delete(s)})(),this._delayedFileRequests.set(s,r)}return await r}_requestFile(e,t,i,s,r,o,c){const h=i_(e,t,i,s?this.offlineProvider:void 0,r,o,c);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _requestFileAsync(e,t,i,s,r){return await new Promise((o,c)=>{this._requestFile(e,h=>{o(h)},t,i,s,h=>{c(h)},r)})}_readFile(e,t,i,s,r){const o=ul(e,t,i,s,r);return this._activeRequests.push(o),o.onCompleteObservable.add(c=>{this._activeRequests.splice(this._activeRequests.indexOf(c),1)}),o}async _readFileAsync(e,t,i){return await new Promise((s,r)=>{this._readFile(e,o=>{s(o)},t,i,o=>{r(o)})})}getPerfCollector(){throw je("performanceViewerSceneExtension")}setActiveCameraByID(e){return this.setActiveCameraById(e)}getMaterialByID(e){return this.getMaterialById(e)}getLastMaterialByID(e){return this.getLastMaterialById(e)}getTextureByUniqueID(e){return this.getTextureByUniqueId(e)}getCameraByID(e){return this.getCameraById(e)}getCameraByUniqueID(e){return this.getCameraByUniqueId(e)}getBoneByID(e){return this.getBoneById(e)}getLightByID(e){return this.getLightById(e)}getLightByUniqueID(e){return this.getLightByUniqueId(e)}getParticleSystemByID(e){return this.getParticleSystemById(e)}getGeometryByID(e){return this.getGeometryById(e)}getMeshByID(e){return this.getMeshById(e)}getMeshByUniqueID(e){return this.getMeshByUniqueId(e)}getLastMeshByID(e){return this.getLastMeshById(e)}getMeshesByID(e){return this.getMeshesById(e)}getTransformNodeByID(e){return this.getTransformNodeById(e)}getTransformNodeByUniqueID(e){return this.getTransformNodeByUniqueId(e)}getTransformNodesByID(e){return this.getTransformNodesById(e)}getNodeByID(e){return this.getNodeById(e)}getLastEntryByID(e){return this.getLastEntryById(e)}getLastSkeletonByID(e){return this.getLastSkeletonById(e)}}Me.FOGMODE_NONE=0;Me.FOGMODE_EXP=1;Me.FOGMODE_EXP2=2;Me.FOGMODE_LINEAR=3;Me.MinDeltaTime=1;Me.MaxDeltaTime=1e3;Me._OriginalDefaultMaterialFactory=Me.DefaultMaterialFactory;let Tx=!1;function kw(){Tx||(Tx=!0,pr("BABYLON.Scene",Me))}(T0=Me.prototype).sortActiveAnimatables??(T0.sortActiveAnimatables=He("Scene","sortActiveAnimatables"));(R0=Me.prototype).beginWeightedAnimation??(R0.beginWeightedAnimation=He("Scene","beginWeightedAnimation"));(A0=Me.prototype).beginAnimation??(A0.beginAnimation=He("Scene","beginAnimation"));(M0=Me.prototype).beginHierarchyAnimation??(M0.beginHierarchyAnimation=He("Scene","beginHierarchyAnimation"));(S0=Me.prototype).beginDirectAnimation??(S0.beginDirectAnimation=He("Scene","beginDirectAnimation"));(E0=Me.prototype).beginDirectHierarchyAnimation??(E0.beginDirectHierarchyAnimation=He("Scene","beginDirectHierarchyAnimation"));(C0=Me.prototype).getAnimatableByTarget??(C0.getAnimatableByTarget=He("Scene","getAnimatableByTarget"));(D0=Me.prototype).getAllAnimatablesByTarget??(D0.getAllAnimatablesByTarget=He("Scene","getAllAnimatablesByTarget"));(I0=Me.prototype).stopAllAnimations??(I0.stopAllAnimations=He("Scene","stopAllAnimations"));(w0=Me.prototype).getSoundByName??(w0.getSoundByName=He("Scene","getSoundByName"));
161(P0=Me.prototype).createOrUpdateSelectionOctree??(P0.createOrUpdateSelectionOctree=He("Scene","createOrUpdateSelectionOctree"));(O0=Me.prototype).createDefaultLight??(O0.createDefaultLight=He("Scene","createDefaultLight"));(F0=Me.prototype).createDefaultCamera??(F0.createDefaultCamera=He("Scene","createDefaultCamera"));(B0=Me.prototype).createDefaultCameraOrLight??(B0.createDefaultCameraOrLight=He("Scene","createDefaultCameraOrLight"));(L0=Me.prototype).createDefaultSkybox??(L0.createDefaultSkybox=He("Scene","createDefaultSkybox"));(U0=Me.prototype).createDefaultEnvironment??(U0.createDefaultEnvironment=He("Scene","createDefaultEnvironment"));(k0=Me.prototype).createDefaultVRExperience??(k0.createDefaultVRExperience=He("Scene","createDefaultVRExperience"));(N0=Me.prototype).createDefaultXRExperienceAsync??(N0.createDefaultXRExperienceAsync=He("Scene","createDefaultXRExperienceAsync"));(z0=Me.prototype).getGlowLayerByName??(z0.getGlowLayerByName=He("Scene","getGlowLayerByName"));(V0=Me.prototype).getHighlightLayerByName??(V0.getHighlightLayerByName=He("Scene","getHighlightLayerByName"));(G0=Me.prototype).getSelectionOutlineLayerByName??(G0.getSelectionOutlineLayerByName=He("Scene","getSelectionOutlineLayerByName"));(H0=Me.prototype).removeLensFlareSystem??(H0.removeLensFlareSystem=He("Scene","removeLensFlareSystem"));(W0=Me.prototype).addLensFlareSystem??(W0.addLensFlareSystem=He("Scene","addLensFlareSystem"));(X0=Me.prototype).getLensFlareSystemByName??(X0.getLensFlareSystemByName=He("Scene","getLensFlareSystemByName"));(q0=Me.prototype).getLensFlareSystemByID??(q0.getLensFlareSystemByID=He("Scene","getLensFlareSystemByID"));(j0=Me.prototype).getLensFlareSystemById??(j0.getLensFlareSystemById=He("Scene","getLensFlareSystemById"));(Y0=Me.prototype).getPhysicsEngine??(Y0.getPhysicsEngine=He("Scene","getPhysicsEngine"));(K0=Me.prototype).enablePhysics??(K0.enablePhysics=He("Scene","enablePhysics"));(Z0=Me.prototype).disablePhysicsEngine??(Z0.disablePhysicsEngine=He("Scene","disablePhysicsEngine"));(Q0=Me.prototype).isPhysicsEnabled??(Q0.isPhysicsEnabled=He("Scene","isPhysicsEnabled"));($0=Me.prototype).deleteCompoundImpostor??($0.deleteCompoundImpostor=He("Scene","deleteCompoundImpostor"));(J0=Me.prototype).removeReflectionProbe??(J0.removeReflectionProbe=He("Scene","removeReflectionProbe"));(ex=Me.prototype).addReflectionProbe??(ex.addReflectionProbe=He("Scene","addReflectionProbe"));(tx=Me.prototype).getBoundingBoxRenderer??(tx.getBoundingBoxRenderer=He("Scene","getBoundingBoxRenderer"));(ix=Me.prototype).enableDepthRenderer??(ix.enableDepthRenderer=He("Scene","enableDepthRenderer"));(sx=Me.prototype).disableDepthRenderer??(sx.disableDepthRenderer=He("Scene","disableDepthRenderer"));(nx=Me.prototype).enableFluidRenderer??(nx.enableFluidRenderer=He("Scene","enableFluidRenderer"));(rx=Me.prototype).disableFluidRenderer??(rx.disableFluidRenderer=He("Scene","disableFluidRenderer"));(ax=Me.prototype).enableGeometryBufferRenderer??(ax.enableGeometryBufferRenderer=He("Scene","enableGeometryBufferRenderer"));(ox=Me.prototype).disableGeometryBufferRenderer??(ox.disableGeometryBufferRenderer=He("Scene","disableGeometryBufferRenderer"));(lx=Me.prototype).enableIblCdfGenerator??(lx.enableIblCdfGenerator=He("Scene","enableIblCdfGenerator"));(cx=Me.prototype).disableIblCdfGenerator??(cx.disableIblCdfGenerator=He("Scene","disableIblCdfGenerator"));(hx=Me.prototype).getOutlineRenderer??(hx.getOutlineRenderer=He("Scene","getOutlineRenderer"));(ux=Me.prototype).enablePrePassRenderer??(ux.enablePrePassRenderer=He("Scene","enablePrePassRenderer"));(fx=Me.prototype).disablePrePassRenderer??(fx.disablePrePassRenderer=He("Scene","disablePrePassRenderer"));
161(dx=Me.prototype).enableSubSurfaceForPrePass??(dx.enableSubSurfaceForPrePass=He("Scene","enableSubSurfaceForPrePass"));(_x=Me.prototype).disableSubSurfaceForPrePass??(_x.disableSubSurfaceForPrePass=He("Scene","disableSubSurfaceForPrePass"));(mx=Me.prototype).pickSprite??(mx.pickSprite=He("Scene","pickSprite"));(gx=Me.prototype).pickSpriteWithRay??(gx.pickSpriteWithRay=He("Scene","pickSpriteWithRay"));(px=Me.prototype).multiPickSprite??(px.multiPickSprite=He("Scene","multiPickSprite"));(yx=Me.prototype).multiPickSpriteWithRay??(yx.multiPickSpriteWithRay=He("Scene","multiPickSpriteWithRay"));(bx=Me.prototype).setPointerOverSprite??(bx.setPointerOverSprite=He("Scene","setPointerOverSprite"));(xx=Me.prototype).getPointerOverSprite??(xx.getPointerOverSprite=He("Scene","getPointerOverSprite"));Object.getOwnPropertyDescriptor(Me.prototype,"mainSoundTrack")||Object.defineProperty(Me.prototype,"mainSoundTrack",mt("Scene","mainSoundTrack"));Object.getOwnPropertyDescriptor(Me.prototype,"soundTracks")||Object.defineProperty(Me.prototype,"soundTracks",mt("Scene","soundTracks"));Object.getOwnPropertyDescriptor(Me.prototype,"audioEnabled")||Object.defineProperty(Me.prototype,"audioEnabled",mt("Scene","audioEnabled"));Object.getOwnPropertyDescriptor(Me.prototype,"headphone")||Object.defineProperty(Me.prototype,"headphone",mt("Scene","headphone"));Object.getOwnPropertyDescriptor(Me.prototype,"audioListenerPositionProvider")||Object.defineProperty(Me.prototype,"audioListenerPositionProvider",mt("Scene","audioListenerPositionProvider"));Object.getOwnPropertyDescriptor(Me.prototype,"audioListenerRotationProvider")||Object.defineProperty(Me.prototype,"audioListenerRotationProvider",mt("Scene","audioListenerRotationProvider"));Object.getOwnPropertyDescriptor(Me.prototype,"audioPositioningRefreshRate")||Object.defineProperty(Me.prototype,"audioPositioningRefreshRate",mt("Scene","audioPositioningRefreshRate"));Object.getOwnPropertyDescriptor(Me.prototype,"selectionOctree")||Object.defineProperty(Me.prototype,"selectionOctree",mt("Scene","selectionOctree"));Object.getOwnPropertyDescriptor(Me.prototype,"debugLayer")||Object.defineProperty(Me.prototype,"debugLayer",mt("Scene","debugL
161ayer"));Object.getOwnPropertyDescriptor(Me.prototype,"gamepadManager")||Object.defineProperty(Me.prototype,"gamepadManager",mt("Scene","gamepadManager"));Object.getOwnPropertyDescriptor(Me.prototype,"simplificationQueue")||Object.defineProperty(Me.prototype,"simplificationQueue",mt("Scene","simplificationQueue"));Object.getOwnPropertyDescriptor(Me.prototype,"onBeforePhysicsObservable")||Object.defineProperty(Me.prototype,"onBeforePhysicsObservable",mt("Scene","onBeforePhysicsObservable"));Object.getOwnPropertyDescriptor(Me.prototype,"onAfterPhysicsObservable")||Object.defineProperty(Me.prototype,"onAfterPhysicsObservable",mt("Scene","onAfterPhysicsObservable"));Object.getOwnPropertyDescriptor(Me.prototype,"reflectionProbes")||Object.defineProperty(Me.prototype,"reflectionProbes",mt("Scene","reflectionProbes"));Object.getOwnPropertyDescriptor(Me.prototype,"forceShowBoundingBoxes")||Object.defineProperty(Me.prototype,"forceShowBoundingBoxes",mt("Scene","forceShowBoundingBoxes"));Object.getOwnPropertyDescriptor(Me.prototype,"depthPeelingRenderer")||Object.defineProperty(Me.prototype,"depthPeelingRenderer",mt("Scene","depthPeelingRenderer"));Object.getOwnPropertyDescriptor(Me.prototype,"useOrderIndependentTransparency")||Object.defineProperty(Me.prototype,"useOrderIndependentTransparency",mt("Scene","useOrderIndependentTransparency"));Object.getOwnPropertyDescriptor(Me.prototype,"fluidRenderer")||Object.defineProperty(Me.prototype,"fluidRenderer",mt("Scene","fluidRenderer"));Object.getOwnPropertyDescriptor(Me.prototype,"geometryBufferRenderer")||Object.defineProperty(Me.prototype,"geometryBufferRenderer",mt("Scene","geometryBufferRenderer"));Object.getOwnPropertyDescriptor(Me.prototype,"iblCdfGenerator")||Object.defineProperty(Me.prototype,"iblCdfGenerator",mt("Scene","iblCdfGenerator"));Object.getOwnPropertyDescriptor(Me.prototype,"prePassRenderer")||Object.defineProperty(Me.prototype,"prePassRenderer",mt("Scene","prePassRenderer"));Object.getOwnPropertyDescriptor(Me.prototype,"subSurfaceConfiguration")||Object.defineProperty(Me.prototype,"subSurfaceConfiguration",mt("Scene","subSurfaceConfiguration"));Object.getOwnPropertyDescriptor(Me.prototype,"spriteManagers")||Object.defineProperty(Me.prototype,"spriteManagers",mt("Scene","spriteManagers"));Object.getOwnPropertyDescriptor(Me.prototype,"onBeforeSpritesRenderingObservable")||Object.defineProperty(Me.prototype,"onBeforeSpritesRenderingObservable",mt("Scene","onBeforeSpritesRenderingObservable"));Object.getOwnPropertyDescriptor(Me.prototype,"onAfterSpritesRenderingObservable")||Object.defineProperty(Me.prototype,"onAfterSpritesRenderingObservable",mt("Scene","onAfterSpritesRenderingObservable"));function j1(a){const e=a.height||2;let t=a.diameterTop===0?0:a.diameterTop||a.diameter||1,i=a.diameterBottom===0?0:a.diameterBottom||a.diameter||1;t=t||1e-5,i=i||1e-5;const s=(a.tessellation||24)|0,r=(a.subdivisions||1)|0,o=!!a.hasRings,c=!!a.enclose,h=a.cap===0?0:a.cap||K.CAP_ALL,f=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,_=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,d=a.faceUV||new Array(3),g=a.faceColors,p=f!==1&&c?2:0,x=o?r:1,b=2+(1+p)*x;let T;for(T=0;T<b;T++)g&&g[T]===void 0&&(g[T]=new dt(1,1,1,1));for(T=0;T<b;T++)d&&d[T]===void 0&&(d[T]=new it(0,0,1,1));const R=[],S=[],M=[],I=[],A=[],D=Math.PI*2*f/s;let C,k,H;const L=(i-t)/2/e,J=E.Zero(),te=E.Zero(),ae=E.Zero(),B=E.Zero(),$=E.Zero(),z=ea.Y;let X,q,G,j,w=1,O=0,U;for(X=0;X<=r;X++)for(k=X/r,H=(k*(t-i)+i)/2,j=o&&X!==0&&X!==r?2:1,G=0;G<j;G++){for(o&&(w+=G),c&&(w+=2*G),q=0;q<=s;q++)C=q*D,J.x=Math.cos(-C)*H,J.y=-e/2+k*e,J.z=Math.sin(-C)*H,t===0&&X===r?(te.x=M[M.length-(s+1)*3],te.y=M[M.length-(s+1)*3+1],te.z=M[M.length-(s+1)*3+2]):(te.x=J.x,te.z=J.z,te.y=Math.sqrt(te.x*te.x+te.z*te.z)*L,te.normalize()),q===0&&(ae.copyFrom(J),B.copyFrom(te)),S.push(J.x,J.y,J.z),M.push(te.x,te.y,te.z),o?U=O!==w?d[w].y:d[w].w:U=d[w].y+(d[w].w-d[w].y)*k,I.push(d[w].x+(d[w].z-d[w].x)*q/s,U),g&&A.push(g[w].r,g[w].g,g[w].b,g[w].a);f!==1&&c&&(S.push(J.x,J.y,J.z),S.push(0,J.y,0),S.push(0,J.y,0),S.push(ae.x,ae.y,ae.z),E.CrossToRef(z,te,$),$.normalize(),M.push($.x,$.y,$.z,$.x,$.y,$.z),E.CrossToRef(B,z,$),$.normalize(),M.push($.x,$.y,$.z,$.x,$.y,$.z),o?U=O!==w?d[w+1].y:d[w+1].w:U=d[w+1].y+(d[w+1].w-d[w+1].y)*k,I.push(d[w+1].x,U),I.push(d[w+1].z,U),o?U=O!==w?d[w+2].y:d[w+2].w:U=d[w+2].y+(d[w+2].w-d[w+2].y)*k,I.push(d[w+2].x,U),I.push(d[w+2].z,U),g&&(A.push(g[w+1].r,g[w+1].g,g[w+1].b,g[w+1].a),A.push(g[w+1].r,g[w+1].g,g[w+1].b,g[w+1].a),A.push(g[w+2].r,g[w+2].g,g[w+2].b,g[w+2].a),A.push(g[w+2].r,g[w+2].g,g[w+2].b,g[w+2].a))),O!==w&&(O=w)}const W=f!==1&&c?s+4:s;for(X=0,w=0;w<r;w++){let be=0,Ee=0,Fe=0,Y=0;for(q=0;q<s;
161q++)be=X*(W+1)+q,Ee=(X+1)*(W+1)+q,Fe=X*(W+1)+(q+1),Y=(X+1)*(W+1)+(q+1),R.push(be,Ee,Fe),R.push(Y,Fe,Ee);f!==1&&c&&(R.push(be+2,Ee+2,Fe+2),R.push(Y+2,Fe+2,Ee+2),R.push(be+4,Ee+4,Fe+4),R.push(Y+4,Fe+4,Ee+4)),X=o?X+2:X+1}const oe=be=>{const Ee=be?t/2:i/2;if(Ee===0)return;let Fe,Y,ue;const de=be?d[b-1]:d[0];let we=null;g&&(we=be?g[b-1]:g[0]);const qe=S.length/3,ke=be?e/2:-e/2,ut=new E(0,ke,0);S.push(ut.x,ut.y,ut.z),M.push(0,be?1:-1,0);const Gt=de.y+(de.w-de.y)*.5;I.push(de.x+(de.z-de.x)*.5,Gt),we&&A.push(we.r,we.g,we.b,we.a);const Ot=new Ue(.5,.5);for(ue=0;ue<=s;ue++){Fe=Math.PI*2*ue*f/s;const pt=Math.cos(-Fe),Nt=Math.sin(-Fe);Y=new E(pt*Ee,ke,Nt*Ee);const Ft=new Ue(pt*Ot.x+.5,Nt*Ot.y+.5);S.push(Y.x,Y.y,Y.z),M.push(0,be?1:-1,0);const $e=de.y+(de.w-de.y)*Ft.y;I.push(de.x+(de.z-de.x)*Ft.x,$e),we&&A.push(we.r,we.g,we.b,we.a)}for(ue=0;ue<s;ue++)be?(R.push(qe),R.push(qe+(ue+2)),R.push(qe+(ue+1))):(R.push(qe),R.push(qe+(ue+1)),R.push(qe+(ue+2)))};(h===K.CAP_START||h===K.CAP_ALL)&&oe(!1),(h===K.CAP_END||h===K.CAP_ALL)&&oe(!0),Be._ComputeSides(_,S,R,M,I,a.frontUVs,a.backUVs);const le=new Be;return le.indices=R,le.positions=S,le.normals=M,le.uvs=I,g&&(le.colors=A),le}function Y1(a,e={},t){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,j1(e).applyToMesh(i,e.updatable),i}let Rx=!1;function Nw(){Rx||(Rx=!0,Be.CreateCylinder=j1,K.CreateCylinder=(a,e,t,i,s,r,o,c,h)=>((o===void 0||!(o instanceof Me))&&(o!==void 0&&(h=c||K.DEFAULTSIDE,c=o),o=r,r=1),Y1(a,{height:e,diameterTop:t,diameterBottom:i,tessellation:s,subdivisions:r,sideOrientation:h,updatable:c},o)))}function K1(a){const e=[],t=[],i=[],s=[],r=a.diameter||1,o=a.thickness||.5,c=(a.tessellation||16)|0,h=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,f=c+1;for(let d=0;d<=c;d++){const g=d/c,p=d*Math.PI*2/c-Math.PI/2,x=se.Translation(r/2,0,0).multiply(se.RotationY(p));for(let b=0;b<=c;b++){const T=1-b/c,R=b*Math.PI*2/c+Math.PI,S=Math.cos(R),M=Math.sin(R);let I=new E(S,M,0),A=I.scale(o/2);const D=new Ue(g,T);A=E.TransformCoordinates(A,x),I=E.TransformNormal(I,x),t.push(A.x,A.y,A.z),i.push(I.x,I.y,I.z),s.push(D.x,D.y);const C=(d+1)%f,k=(b+1)%f;e.push(d*f+b),e.push(d*f+k),e.push(C*f+b),e.push(d*f+k),e.push(C*f+k),e.push(C*f+b)}}Be._ComputeSides(h,t,e,i,s,a.frontUVs,a.backUVs);const _=new Be;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function Z1(a,e={},t){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,K1(e).applyToMesh(i,e.updatable),i}let Ax=!1;function zw(){Ax||(Ax=!0,Be.CreateTorus=K1,K.CreateTorus=(a,e,t,i,s,r,o)=>Z1(a,{diameter:e,thickness:t,tessellation:i,sideOrientation:o,updatable:r},s))}function Q1(a){const e=[],t=[],i=[],s=[],r=a.radius||2,o=a.tube||.5,c=a.radialSegments||32,h=a.tubularSegments||32,f=a.p||2,_=a.q||3,d=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,g=T=>{const R=Math.cos(T),S=Math.sin(T),M=_/f*T,I=Math.cos(M),A=r*(2+I)*.5*R,D=r*(2+I)*S*.5,C=r*Math.sin(M)*.5;return new E(A,D,C)};let p,x;for(p=0;p<=c;p++){const R=p%c/c*2*f*Math.PI,S=g(R),M=g(R+.01),I=M.subtract(S);let A=M.add(S);const D=E.Cross(I,A);for(A=E.Cross(D,I),D.normalize(),A.normalize(),x=0;x<h;x++){const k=x%h/h*2*Math.PI,H=-o*Math.cos(k),L=o*Math.sin(k);t.push(S.x+H*A.x+L*D.x),t.push(S.y+H*A.y+L*D.y),t.push(S.z+H*A.z+L*D.z),s.push(p/c),s.push(x/h)}}for(p=0;p<c;p++)for(x=0;x<h;x++){const T=(x+1)%h,R=p*h+x,S=(p+1)*h+x,M=(p+1)*h+T,I=p*h+T;e.push(I),e.push(S),e.push(R),e.push(I),e.push(M),e.push(S)}Be.ComputeNormals(t,e,i),Be._ComputeSides(d,t,e,i,s,a.frontUVs,a.backUVs);const b=new Be;return b.indices=e,b.positions=t,b.normals=i,b.uvs=s,b}function $1(a,e={},t){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Q1(e).applyToMesh(i,e.updatable),i}let Mx=!1;function Vw(){Mx||(Mx=!0,Be.CreateTorusKnot=Q1,K.CreateTorusKnot=(a,e,t,i,s,r,o,c,h,f)=>$1(a,{radius:e,tube:t,radialSegments:i,tubularSegments:s,p:r,q:o,sideOrientation:f,updatable:h},c))}class Gw extends Lt{constructor(e,t){super(e,t.getScene()),this._indexInSourceMe
vendor: 6,918 bytes, line 161
161shInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice();for(const i of t.getAnimationRanges())i!=null&&this.createAnimationRange(i.name,i.from,i.to);if(this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),!t.skeleton&&!t.morphTargetManager&&t.hasBoundingInfo){const i=t.getBoundingInfo();this.buildBoundingInfo(i.minimum,i.maximum)}else this.refreshBoundingInfo(!0,!0);this._syncSubMeshes()}getClassName(){return"InstancedMesh"}get lightSources(){return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){return this._sourceMesh.receiveShadows}set receiveShadows(e){this._sourceMesh?.receiveShadows!==e&&me.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){return this._sourceMesh.material}set material(e){this._sourceMesh?.material!==e&&me.Warn("Setting material on an instanced mesh has no effect")}get visibility(){return this._sourceMesh.visibility}set visibility(e){this._sourceMesh?.visibility!==e&&me.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){return this._sourceMesh.skeleton}set skeleton(e){this._sourceMesh?.skeleton!==e&&me.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){return this._sourceMesh.renderingGroupId}set renderingGroupId(e){!this._sourceMesh||e===this._sourceMesh.renderingGroupId||me.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){return this._sourceMesh.getTotalIndices()}get sourceMesh(){return this._sourceMesh}get geometry(){return this._sourceMesh._geometry}createInstance(e){return this._sourceMesh.createInstance(e)}isReady(e=!1){return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,i){return this._sourceMesh.getVerticesData(e,t,i)}copyVerticesData(e,t){this._sourceMesh.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._sourceMesh.getVertexBuffer(e,t)}setVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,s),this.sourceMesh}updateVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,s),this.sourceMesh}setIndices(e,t=null){return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){return this._sourceMesh.getIndices()}get _positions(){return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getData(i,null,F.PositionKind),s),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||me.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){if(this._currentLOD&&this._currentLOD!==this._sourceMesh&&this._currentLOD.billboardMode!==qi.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new se);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,fe.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(fe.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){return!0}getLOD(e){if(!e)return this;const t=this.sourceMesh.getLODLevels();if(!t||t.length===0)this._currentLOD=this.sourceMesh;else{const i=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,i.boundingSphere)}return this._currentLOD}_preActivateForIntermediateRendering(e){return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e<this._sourceMesh.subMeshes.length;e++)this._sourceMesh.subMeshes[e].clone(this,this._sourceMesh);return this}_generatePointsArray(){return this._sourceMesh._generatePointsArray()}_updateBoundingInfo(){return this.hasBoundingInfo?this.getBoundingInfo().update(this.worldMatrixFromCache):this.buildBoundingInfo(this.absolutePosition,this.absolutePosition,this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}clone(e,t=null,i,s){const r=(s||this._sourceMesh).createInstance(e);if(n_.DeepCopy(this,r,["name","subMeshes","uniqueId","parent","lightSources","receiveShadows","material","visibility","skeleton","sourceMesh","isAnInstance","facetNb","isFacetDataEnabled","isBlocked","useBones","hasInstances","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","hasBoundingInfo","geometry"],[]),t&&(r.parent=t),!i)for(let o=0;o<this.getScene().meshes.length;o++){const c=this.getScene().meshes[o];c.parent===this&&c.clone(c.name,r)}return r.computeWorldMatrix(!0),this.onClonedObservable.notifyObservers(r),r}dispose(e,t=!1){this._sourceMesh.removeInstance(this),super.dispose(e,t)}_serializeAsParent(e){super._serializeAsParent(e),e.parentId=this._sourceMesh.uniqueId,e.parentInstanceIndex=this._indexInSourceMe
161shInstanceArray}instantiateHierarchy(e=null,t,i){const s=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0,t&&t.newSourcedMesh);s&&i&&i(this,s);for(const r of this.getChildTransformNodes(!0))r.instantiateHierarchy(s,t,i);return s}}class Hw{constructor(){this._defines={},this._currentRank=32,this._maxRank=-1,this._mesh=null}unBindMesh(){this._mesh=null}addFallback(e,t){this._defines[e]||(e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)}addCPUSkinningFallback(e,t){this._mesh=t,e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e)}get hasMoreFallbacks(){return this._currentRank<=this._maxRank}reduce(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;const i=this._mesh.getScene();for(let s=0;s<i.meshes.length;s++){const r=i.meshes[s];if(!r.material){!this._mesh.material&&r.computeBonesUsingShaders&&r.numBoneInfluencers>0&&(r.computeBonesUsingShaders=!1);continue}if(!(!r.computeBonesUsingShaders||r.numBoneInfluencers===0)){if(r.material.getEffect()===t)r.computeBonesUsingShaders=!1;else if(r.subMeshes){for(const o of r.subMeshes)if(o.effect===t){r.computeBonesUsingShaders=!1;break}}}}}else{const i=this._defines[this._currentRank];if(i)for(let s=0;s<i.length;s++)e=e.replace("#define "+i[s],"");this._currentRank++}return e}}class Ww extends wi{constructor(e,t,i=!0,s=!1){super(e,t,void 0,s),this._normalMatrix=new se,this._storeEffectOnSubMeshes=i}getEffect(){return this._storeEffectOnSubMeshes?this._activeEffect:super.getEffect()}isReady(e,t){return e?!this._storeEffectOnSubMeshes||!e.subMeshes||e.subMeshes.length===0?!0:this.isReadyForSubMesh(e,e.subMeshes[0],t):!1}_isReadyForSubMesh(e){const t=e.materialDefines;return!!(!this.checkReadyOnEveryCall&&e.effect&&t&&t._renderId===this.getScene().getRenderId())}bindOnlyWorldMatrix(e){this._activeEffect.setMatrix("world",e)}bindOnlyNormalMatrix(e){this._activeEffect.setMatrix("normalMatrix",e)}bind(e,t){t&&this.bindForSubMesh(e,t,t.subMeshes[0])}_afterBind(e,t=null,i){super._afterBind(e,t,i),this.getScene()._cachedEffect=t,i?i._drawWrapper._forceRebindOnNextCall=!1:this._drawWrapper._forceRebindOnNextCall=!1}_mustRebind(e,t,i,s=1){return i._drawWrapper._forceRebindOnNextCall||e.isCachedMaterialInvalid(this,t,s)}dispose(e,t,i){this._activeEffect=void 0,super.dispose(e,t,i)}}const Sx=new WeakMap;function Xw(a){const e=a.getVertexBuffers();if(!e)return null;let t=Sx.get(a);if(!t)t=new Map,Sx.set(a,t);else{let i=!1;for(const s in e)if(!t.has(s)){i=!0;break}if(!i)return t}for(const i in e){const s=e[i];if(s){const r=s.byteOffset,o=s.byteStride,c=s.type,h=s.normalized;t.set(i,{offset:r,stride:o,type:c,normalized:h})}}return t}function qw(a,e){e.forEach((t,i)=>{const s=`vp_${i}_info`;a.setFloat4(s,t.offset,t.stride,t.type,t.normalized?1:0)})}const od={effect:null,subMesh:null};class Eh extends Ww{constructor(e,t,i,s={},r=!0){super(e,t,r),this._textures={},this._internalTextures={},this._textureArrays={},this._externalTextures={},this._floats={},this._ints={},this._uints={},this._floatsArrays={},this._colors3={},this._colors3Arrays={},this._colors4={},this._colors4Arrays={},this._vectors2={},this._vectors3={},this._vectors4={},this._quaternions={},this._quaternionsArrays={},this._matrices={},this._matrixArrays={},this._matrices3x3={},this._matrices2x2={},this._vectors2Arrays={},this._vectors3Arrays={},this._vectors4Arrays={},this._uniformBuffers={},this._textureSamplers={},this._storageBuffers={},this._cachedWorldViewMatrix=new se,this._cachedWorldViewProjectionMatrix=new se,this._multiview=!1,this._vertexPullingMetadata=null,this._materialHelperNeedsPreviousMatrices=!1,this._shaderPath=i,this._options={needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],externalTextures:[],samplerObjects:[],storageBuffers:[],defines:[],useClipPlane:!1,...s}}get shaderPath(){return this._shaderPath}set shaderPath(e){this._shaderPath=e}get options(){return this._options}get isMultiview(){return this._multiview}getClassName(){return"ShaderMaterial"}needAlphaBlending(){return this.alpha<1||this._options.needAlphaBlending}needAlphaTesting(){return this._options.needAlphaTesting}_checkUniform(e){this._options.uniforms.indexOf(e)===-1&&this._options.uniforms.push(e)}setTexture(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._textures[e]=t,this}setInternalTexture(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._internalTextures[e]=t,this}removeTexture(e){delete this._textures[e]}setTextureArray(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._checkUniform(e),this._textureArrays[e]=t,this}setExternalTexture(e,t){return this._options.externalTextures.indexOf(e)===-1&&this._options.externalTextures.push(e),this._externalTextures[e]=t,this}setFloat(e,t){return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){return this._checkUniform(e),this._ints[e]=t,this}setUInt(e,t){return this._checkUniform(e),this._uints[e]=t,this}setFloats(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){return this._checkUniform(e),this._colors3[e]=t,this}setColor3Array(e,t){return this._checkUniform(e),this._colors3Arrays[e]=t.reduce((i,s)=>(i.push(s.r,s.g,s.b),i),[]),this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setColor4Array(e,t){return this._checkUniform(e),this._colors4Arrays[e]=t.reduce((i,s)=>(i.push(s.r,s.g,s.b,s.a),i),[]),this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setQuaternion(e,t){return this._checkUniform(e),this._quaternions[e]=t,this}setQuaternionArray(e,t){return this._checkUniform(e),this._quaternionsArrays[e]=t.reduce((i,s)=>(s.toArray(i,i.length),i),[]),this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}setMatrices(e,t){this._checkUniform(e);const i=new Float32Array(t.length*16);for(let s=0;s<t.length;s++)t[s].copyToArray(i,s*16);return this._matrixArrays[e]=i,this}setMatrix3x3(e,t){return this._checkUniform(e),this._matrices3x3[e]=t,this}setMatrix2x2(e,t){return this._checkUniform(e),this._matrices2x2[e]=t,this}setArray2(e,t){return this._checkUniform(e),this._vectors2Arrays[e]=t,this}setArray3(e,t){return this._checkUniform(e),this._vectors3Arrays[e]=t,this}setArray4(e,t){return this._checkUniform(e),this._vectors4Arrays[e]=t,this}setUniformBuffer(e,t){return this._options.uniformBuffers.indexOf(e)===-1&&this._options.uniformBuffers.push(e),this._uniformBuffers[e]=t,this}setTextureSampler(e,t){return this._options.samplerObjects.indexOf(e)===-1&&this._options.samplerObjects.push(e),this._textureSamplers[e]=t,this}setStorageBuffer(e,t){return this._options.storageBuffers.indexOf(e)===-1&&this._options.storageBuffers.push(e),this._storageBuffers[e]=t,this}setDefine(e,t){const i=e.trimEnd()+" ",s=this.options.defines.findIndex(r=>r===e||r.startsWith(i));return s>=0&&this.options.defines.splice(s,1),(typeof t!="boolean"||t)&&this.options.defines.push(i+t),this}isReadyForSubMesh(e,t,i){return this.isReady(e,i,t)}isReady(e,t,i){const s=i&&this._storeEffectOnSubMeshes;if(this.isFrozen){const D=s?i._drawWrapper:this._drawWrapper;if(D.effect&&D._wasPreviouslyReady&&D._wasPreviouslyUsingInstances===t)return!0}const r=this.getScene(),o=r.getEngine(),c=[],h=[];let f=null,_=this._shaderPath,d=this._options.uniforms,g=this._options.uniformBuffers,p=this._options.samplers;o.getCaps().multiview&&r.activeCamera&&r.activeCamera.outputRenderTarget&&r.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,c.push("#define MULTIVIEW"),d.indexOf("viewProjection")!==-1&&d.indexOf("viewProjectionR")===-1&&d.push("viewProjectionR"));for(let D=0;D<this._options.defines.length;D++){const C=this._options.defines[D].indexOf("#define")===0?this._options.defines[D]:`#define ${this._options.defines[D]}`;c.push(C)}for(let D=0;D<this._options.attributes.length;D++)h.push(this._options.attributes[D]);if(e&&e.isVerticesDataPresent(F.ColorKind)&&(h.indexOf(F.ColorKind)===-1&&h.push(F.ColorKind),c.push("#define VERTEXCOLOR")),t&&(c.push("#define INSTANCES"),uw(h,this._materialHelperNeedsPreviousMatrices),e?.hasThinInstances&&(c.push("#define THIN_INSTANCES"),e&&e.isVerticesDataPresent(F.ColorInstanceKind)&&(h.push(F.ColorInstanceKind),c.push("#define INSTANCESCOLOR")))),e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton){h.push(F.MatricesIndicesKind),h.push(F.MatricesWeightsKind),e.numBoneInfluencers>4&&(h.push(F.MatricesIndicesExtraKind),h.push(F.MatricesWeightsExtraKind)
161);const D=e.skeleton;c.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),f=new Hw,f.addCPUSkinningFallback(0,e),D.isUsingTextureForMatrices?(c.push("#define BONETEXTURE"),d.indexOf("boneTextureInfo")===-1&&d.push("boneTextureInfo"),this._options.samplers.indexOf("boneSampler")===-1&&this._options.samplers.push("boneSampler")):(c.push("#define BonesPerMesh "+(D.bones.length+1)),d.indexOf("mBones")===-1&&d.push("mBones"))}else c.push("#define NUM_BONE_INFLUENCERS 0");let x=0;const b=e?e.morphTargetManager:null;if(b){const D=c.indexOf("#define UV1")!==-1,C=c.indexOf("#define UV2")!==-1,k=c.indexOf("#define TANGENT")!==-1,H=c.indexOf("#define NORMAL")!==-1,L=c.indexOf("#define VERTEXCOLOR")!==-1;x=cw(b,c,h,e,!0,H,k,D,C,L),b.isUsingTextureForTargets&&(d.indexOf("morphTargetTextureIndices")===-1&&d.push("morphTargetTextureIndices"),this._options.samplers.indexOf("morphTargets")===-1&&this._options.samplers.push("morphTargets")),x>0&&(d=d.slice(),d.push("morphTargetInfluences"),d.push("morphTargetCount"),d.push("morphTargetTextureInfo"),d.push("morphTargetTextureIndices"))}else c.push("#define NUM_MORPH_INFLUENCERS 0");if(e){const D=e.bakedVertexAnimationManager;D&&D.isEnabled&&(c.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),d.indexOf("bakedVertexAnimationSettings")===-1&&d.push("bakedVertexAnimationSettings"),d.indexOf("bakedVertexAnimationTextureSizeInverted")===-1&&d.push("bakedVertexAnimationTextureSizeInverted"),d.indexOf("bakedVertexAnimationTime")===-1&&d.push("bakedVertexAnimationTime"),this._options.samplers.indexOf("bakedVertexAnimationTexture")===-1&&this._options.samplers.push("bakedVertexAnimationTexture"),t&&h.push("bakedVertexAnimationSettingsInstanced"))}for(const D in this._textures)if(!this._textures[D].isReady())return!1;for(const D in this._internalTextures)if(!this._internalTextures[D].isReady)return!1;e&&this.needAlphaTestingForMesh(e)&&c.push("#define ALPHATEST"),this._options.useClipPlane!==!1&&(nw(d),rw(this,r,c)),r.fogEnabled&&e?.applyFog&&r.fogMode!==Me.FOGMODE_NONE&&(c.push("#define FOG"),d.indexOf("view")===-1&&d.push("view"),d.indexOf("vFogInfos")===-1&&d.push("vFogInfos"),d.indexOf("vFogColor")===-1&&d.push("vFogColor")),this._useLogarithmicDepth&&(c.push("#define LOGARITHMICDEPTH"),d.indexOf("logarithmicDepthConstant")===-1&&d.push("logarithmicDepthConstant"));const T=i?i.getRenderingMesh():e;if(T&&this.useVertexPulling){const D=T.geometry;D&&(this._vertexPullingMetadata=Xw(D),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((k,H)=>{d.push(`vp_${H}_info`)})),c.push("#define USE_VERTEX_PULLING");const C=T.geometry?.getIndexBuffer();C&&!T.isUnIndexed&&(c.push("#define VERTEX_PULLING_USE_INDEX_BUFFER"),C.is32Bits&&c.push("#define VERTEX_PULLING_INDEX_BUFFER_32BITS"))}this.customShaderNameResolve&&(d=d.slice(),g=g.slice(),p=p.slice(),_=this.customShaderNameResolve(this.name,d,g,p,c,h));const R=s?i._getDrawWrapper(void 0,!0):this._drawWrapper,S=R?.effect??null,M=R?.defines??null,I=c.join(`
162`);let A=S;return M!==I&&(A=o.createEffect(_,{attributes:h,uniformsNames:d,uniformBuffersNames:g,samplers:p,defines:I,fallbacks:f,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:x},shaderLanguage:this._options.shaderLanguage,extraInitializationsAsync:this._options.extraInitializationsAsync},o),s?i.setEffect(A,I,this._materialContext):R&&R.setEffect(A,I),this._onEffectCreatedObservable&&(od.effect=A,od.subMesh=i??e?.subMeshes[0]??null,this._onEffectCreatedObservable.notifyObservers(od))),R._wasPreviouslyUsingInstances=!!t,A?.isReady()?(S!==A&&r.resetCachedMaterial(),R._wasPreviouslyReady=!0,!0):!1}bindOnlyWorldMatrix(e,t){const i=t??this.getEffect();if(!i)return;const s=this._options.uniforms;s.indexOf("world")!==-1&&i.setMatrix("world",e);const r=this.getScene();s.indexOf("worldView")!==-1&&(e.multiplyToRef(r.getViewMatrix(),this._cachedWorldViewMatrix),i.setMatrix("worldView",this._cachedWorldViewMatrix)),s.indexOf("worldViewProjection")!==-1&&(e.multiplyToRef(r.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),i.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)),s.indexOf("view")!==-1&&i.setMatrix("view",r.getViewMatrix())}bindForSubMesh(e,t,i){this.bind(e,t,i._drawWrapperOverride?.effect,i)}bind(e,t,i,s){const r=s&&this._storeEffectOnSubMeshes,o=i??(r?s.effect:this.getEffect());if(!o)return;const c=this.getScene();this._activeEffect=o,this.bindOnlyWorldMatrix(e,i);const h=this._options.uniformBuffers;let f=!1;if(o&&h&&h.length>0&&c.getEngine().supportsUniformBuffers)for(let d=0;d<h.length;++d)switch(h[d]){case"Mesh":t&&(t.getMeshUniformBuffer().bindToEffect(o,"Mesh"),t.transferToEffect(e));break;case"Scene":E1(o,c.getSceneUniformBuffer()),c.finalizeSceneUbo(),f=!0;break}const _=t&&r?this._mustRebind(c,o,s,t.visibility):c.getCachedMaterial()!==this;if(o&&_){!f&&this._options.uniforms.indexOf("view")!==-1&&o.setMatrix("view",c.getViewMatrix()),!f&&this._options.uniforms.indexOf("projection")!==-1&&o.setMatrix("projection",c.getProjectionMatrix()),!f&&this._options.uniforms.indexOf("viewProjection")!==-1&&(o.setMatrix("viewProjection",c.getTransformMatrix()),this._multiview&&o.setMatrix("viewProjectionR",c._transformMatrixR)),c.activeCamera&&this._options.uniforms.indexOf("cameraPosition")!==-1&&o.setVector3("cameraPosition",c.activeCamera.globalPosition),dw(t,o),aw(o,this,c),this._vertexPullingMetadata&&qw(o,this._vertexPullingMetadata),this._useLogarithmicDepth&&ow(r?s.materialDefines:o.defines,o,c),t&&lw(c,t,o);let d;for(d in this._textures)o.setTexture(d,this._textures[d]);for(d in this._internalTextures)o._bindTexture(d,this._internalTextures[d]);for(d in this._textureArrays)o.setTextureArray(d,this._textureArrays[d]);for(d in this._ints)o.setInt(d,this._ints[d]);for(d in this._uints)o.setUInt(d,this._uints[d]);for(d in this._floats)o.setFloat(d,this._floats[d]);for(d in this._floatsArrays)o.setArray(d,this._floatsArrays[d]);for(d in this._colors3)o.setColor3(d,this._colors3[d]);for(d in this._colors3Arrays)o.setArray3(d,this._colors3Arrays[d]);for(d in this._colors4){const T=this._colors4[d];o.setFloat4(d,T.r,T.g,T.b,T.a)}for(d in this._colors4Arrays)o.setArray4(d,this._colors4Arrays[d]);for(d in this._vectors2)o.setVector2(d,this._vectors2[d]);for(d in this._vectors3)o.setVector3(d,this._vectors3[d]);for(d in this._vectors4)o.setVector4(d,this._vectors4[d]);for(d in this._quaternions)o.setQuaternion(d,this._quaternions[d]);for(d in this._matrices)o.setMatrix(d,this._matrices[d]);for(d in this._matrixArrays)o.setMatrices(d,this._matrixArrays[d]);for(d in this._matrices3x3)o.setMatrix3x3(d,this._matrices3x3[d]);for(d in this._matrices2x2)o.setMatrix2x2(d,this._matrices2x2[d]);for(d in this._vectors2Arrays)o.setArray2(d,this._vectors2Arrays[d]);for(d in this._vectors3Arrays)o.setArray3(d,this._vectors3Arrays[d]);for(d in this._vectors4Arrays)o.setArray4(d,this._vectors4Arrays[d]);for(d in this._quaternionsArrays)o.setArray4(d,this._quaternionsArrays[d]);for(d in this._uniformBuffers){const T=this._uniformBuffers[d].getBuffer();T&&o.bindUniformBuffer(T,d)}const g=c.getEngine(),p=g.setExternalTexture;if(p)for(d in this._externalTextures)p.call(g,d,this._externalTextures[d]);const x=g.setTextureSampler;if(x)for(d in this._textureSamplers)x.call(g,d,this._textureSamplers[d]);
vendor: 3,779 bytes, line 162
162const b=g.setStorageBuffer;if(b)for(d in this._storageBuffers)b.call(g,d,this._storageBuffers[d])}if(o&&t&&(_||!this.isFrozen)){fw(t,o),t.morphTargetManager&&t.morphTargetManager.isUsingTextureForTargets&&t.morphTargetManager._bind(o);const d=t.bakedVertexAnimationManager;if(d&&d.isEnabled){const g=r?s._drawWrapper:this._drawWrapper;t.bakedVertexAnimationManager?.bind(o,!!g._wasPreviouslyUsingInstances)}}this._afterBind(t,o,s)}getActiveTextures(){const e=super.getActiveTextures();for(const t in this._textures)e.push(this._textures[t]);for(const t in this._textureArrays){const i=this._textureArrays[t];for(let s=0;s<i.length;s++)e.push(i[s])}return e}hasTexture(e){if(super.hasTexture(e))return!0;for(const i in this._textures)if(this._textures[i]===e)return!0;const t=e.getInternalTexture();for(const i in this._internalTextures)if(this._internalTextures[i]===t)return!0;for(const i in this._textureArrays){const s=this._textureArrays[i];for(let r=0;r<s.length;r++)if(s[r]===e)return!0}return!1}clone(e){const t=Rt.Clone(()=>new Eh(e,this.getScene(),this._shaderPath,this._options,this._storeEffectOnSubMeshes),this);t.name=e,t.id=e,typeof t._shaderPath=="object"&&(t._shaderPath={...t._shaderPath}),this._options={...this._options};const i=Object.keys(this._options);for(const s of i){const r=this._options[s];Array.isArray(r)&&(this._options[s]=r.slice(0))}this.stencil.copyTo(t.stencil);for(const s in this._textures)t.setTexture(s,this._textures[s]);for(const s in this._internalTextures)t.setInternalTexture(s,this._internalTextures[s]);for(const s in this._textureArrays)t.setTextureArray(s,this._textureArrays[s]);for(const s in this._externalTextures)t.setExternalTexture(s,this._externalTextures[s]);for(const s in this._ints)t.setInt(s,this._ints[s]);for(const s in this._uints)t.setUInt(s,this._uints[s]);for(const s in this._floats)t.setFloat(s,this._floats[s]);for(const s in this._floatsArrays)t.setFloats(s,this._floatsArrays[s]);for(const s in this._colors3)t.setColor3(s,this._colors3[s]);for(const s in this._colors3Arrays)t._colors3Arrays[s]=this._colors3Arrays[s];for(const s in this._colors4)t.setColor4(s,this._colors4[s]);for(const s in this._colors4Arrays)t._colors4Arrays[s]=this._colors4Arrays[s];for(const s in this._vectors2)t.setVector2(s,this._vectors2[s]);for(const s in this._vectors3)t.setVector3(s,this._vectors3[s]);for(const s in this._vectors4)t.setVector4(s,this._vectors4[s]);for(const s in this._quaternions)t.setQuaternion(s,this._quaternions[s]);for(const s in this._quaternionsArrays)t._quaternionsArrays[s]=this._quaternionsArrays[s];for(const s in this._matrices)t.setMatrix(s,this._matrices[s]);for(const s in this._matrixArrays)t._matrixArrays[s]=this._matrixArrays[s].slice();for(const s in this._matrices3x3)t.setMatrix3x3(s,this._matrices3x3[s]);for(const s in this._matrices2x2)t.setMatrix2x2(s,this._matrices2x2[s]);for(const s in this._vectors2Arrays)t.setArray2(s,this._vectors2Arrays[s]);for(const s in this._vectors3Arrays)t.setArray3(s,this._vectors3Arrays[s]);for(const s in this._vectors4Arrays)t.setArray4(s,this._vectors4Arrays[s]);for(const s in this._uniformBuffers)t.setUniformBuffer(s,this._uniformBuffers[s]);for(const s in this._textureSamplers)t.setTextureSampler(s,this._textureSamplers[s]);for(const s in this._storageBuffers)t.setStorageBuffer(s,this._storageBuffers[s]);return t}dispose(e,t,i){if(t){let s;for(s in this._textures)this._textures[s].dispose();for(s in this._internalTextures)this._internalTextures[s].dispose();for(s in this._textureArrays){const r=this._textureArrays[s];for(let o=0;o<r.length;o++)r[o].dispose()}}this._textures={},this._internalTextures={},super.dispose(e,t,i)}serialize(){const e=Rt.Serialize(this);e.customType="BABYLON.ShaderMaterial",e.uniqueId=this.uniqueId,e.o
162ptions=this._options,e.shaderPath=this._shaderPath,e.storeEffectOnSubMeshes=this._storeEffectOnSubMeshes;let t;e.stencil=this.stencil.serialize(),e.textures={};for(t in this._textures)e.textures[t]=this._textures[t].serialize();e.textureArrays={};for(t in this._textureArrays){e.textureArrays[t]=[];const i=this._textureArrays[t];for(let s=0;s<i.length;s++)e.textureArrays[t].push(i[s].serialize())}e.ints={};for(t in this._ints)e.ints[t]=this._ints[t];e.uints={};for(t in this._uints)e.uints[t]=this._uints[t];e.floats={};for(t in this._floats)e.floats[t]=this._floats[t];e.floatsArrays={};for(t in this._floatsArrays)e.floatsArrays[t]=this._floatsArrays[t];e.colors3={};for(t in this._colors3){const i=this._colors3[t];e.colors3[t]=[i.r,i.g,i.b]}e.colors3Arrays={};for(t in this._colors3Arrays)e.colors3Arrays[t]=this._colors3Arrays[t];e.colors4={};for(t in this._colors4){const i=this._colors4[t];e.colors4[t]=[i.r,i.g,i.b,i.a]}e.colors4Arrays={};for(t in this._colors4Arrays)e.colors4Arrays[t]=this._colors4Arrays[t];e.vectors2={};for(t in this._vectors2){const i=this._vectors2[t];e.vectors2[t]=[i.x,i.y]}e.vectors3={};for(t in this._vectors3){const i=this._vectors3[t];e.vectors3[t]=[i.x,i.y,i.z]}e.vectors4={};for(t in this._vectors4){const i=this._vectors4[t];e.vectors4[t]=[i.x,i.y,i.z,i.w]}e.quaternions={};for(t in this._quaternions)e.quaternions[t]=this._quaternions[t].asArray();e.matrices={};for(t in this._matrices)e.matrices[t]=this._matrices[t].asArray();e.matrixArray={};for(t in this._matrixArrays)e.matrixArray[t]=this._matrixArrays[t];e.matrices3x3={};for(t in this._matrices3x3)e.matrices3x3[t]=this._matrices3x3[t];e.matrices2x2={};for(t in this._matrices2x2)e.matrices2x2[t]=this._matrices2x2[t];e.vectors2Arrays={};for(t in this._vectors2Arrays)e.vectors2Arrays[t]=this._vectors2Arrays[t];e.vectors3Arrays={};for(t in this._vectors3Arrays)e.vectors3Arrays[t]=this._vectors3Arrays[t];e.vectors4Arrays={};for(t in this._vectors4Arrays)e.vectors4Arrays[t]=this._vectors4Arrays[t];e.quaternionsArrays={};for(t in this._quaternionsArrays)e.quaternionsArrays[t]=this._quaternionsArrays[t];return e}}Eh.SnippetUrl="https://snippet.babylonjs.com";var Ex,Cx;class zn extends K{_isShaderMaterial(e){return e?e.getClassName()==="ShaderMaterial":!1}constructor(e,t=null,i=null,s=null,r,o,c,h){super(e,t,i,s,r),this.useVertexColor=o,this.useVertexAlpha=c,this.color=new lt(1,1,1),this.alpha=1,this._shaderLanguage=0,this._ownsMaterial=!1,s&&(this.color=s.color.clone(),this.alpha=s.alpha,this.useVertexColor=s.useVertexColor,this.useVertexAlpha=s.useVertexAlpha),this.intersectionThreshold=.1;const f=[],_={attributes:[F.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:f,useClipPlane:null,shaderLanguage:0};if(this.useVertexAlpha?_.defines.push("#define VERTEXALPHA"):_.needAlphaBlending=!1,this.useVertexColor?(_.defines.push("#define VERTEXCOLOR"),_.attributes.push(F.ColorKind)):(_.uniforms.push("color"),this._color4=new dt),h)this.material=h;else{this.getScene().getEngine().isWebGPU&&!zn.ForceGLSL&&(this._shaderLanguage=1),_.shaderLanguage=this._shaderLanguage,_.extraInitializationsAsync=async()=>{this._shaderLanguage===1?await Promise.all([Ji(()=>import("./color.vertex-DEegDpve.js"),[]),Ji(()=>import("./color.fragment-B-uimA1Y.js"),[])]):await Promise.all([Ji(()=>import("./color.vertex-DQVsBiJI.js"),[]),Ji(()=>import("./color.fragment-D0AyYolq.js"),[])])};const g=new Eh("colorShader",this.getScene(),"color",_,!1);g.doNotSerialize=!0,this._ownsMaterial=!0,this._setInternalMaterial(g)}}getClassName(){return"LinesMesh"}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){const t=this.material;if(t===e)return;const i=t&&this._ownsMaterial;this._ownsMaterial=!1,this._setInternalMaterial(e),i&&t?.dispose()}_setInternalMaterial(e){this._setMaterial(e),this.material&&(this.material.fillMode=wi.LineListDrawMode,this.material.disableLighting=!0)}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;const i=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,i):this._geometry._bind(t,i,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this.material)){const{r:s,g:r,b:o}=this.color;this._color4.set(s,r,o,this.alpha),this.material.setColor4("color",this._color4)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const s=this.getScene().getEngine();
162return this._unIndexed?s.drawArraysType(wi.LineListDrawMode,e.verticesStart,e.verticesCount,i):s.drawElementsType(wi.LineListDrawMode,e.indexStart,e.indexCount,i),this}dispose(e,t=!1,i){i||(this._ownsMaterial?this.material?.dispose(!1,!1,!0):t&&this.material?.dispose(!1,!1,!0)),super.dispose(e)}clone(e,t=null,i){if(t&&t._addToSceneRootNodes===void 0){const s=t;return s.source=this,new zn(e,this.getScene(),s.parent,s.source,s.doNotCloneChildren)}return new zn(e,this.getScene(),t,this,i)}createInstance(e){const t=new J1(e,this);if(this.instancedBuffers){t.instancedBuffers={};for(const i in this.instancedBuffers)t.instancedBuffers[i]=this.instancedBuffers[i]}return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){const i=new zn(e.name,t);return i.color=lt.FromArray(e.color),i.alpha=e.alpha,i}}zn.ForceGLSL=!1;class J1 extends Gw{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}(Ex=zn.prototype).enableEdgesRendering??(Ex.enableEdgesRendering=He("LinesMesh","enableEdgesRendering"));(Cx=J1.prototype).enableEdgesRendering??(Cx.enableEdgesRendering=He("InstancedLinesMesh","enableEdgesRendering"));function eT(a){const e=[],t=[],i=a.lines,s=a.colors,r=[];let o=0;for(let h=0;h<i.length;h++){const f=i[h];for(let _=0;_<f.length;_++){const{x:d,y:g,z:p}=f[_];if(t.push(d,g,p),s){const x=s[h],{r:b,g:T,b:R,a:S}=x[_];r.push(b,T,R,S)}_>0&&(e.push(o-1),e.push(o)),o++}}const c=new Be;return c.indices=e,c.positions=t,s&&(c.colors=r),c}function tT(a){const e=a.dashSize||3,t=a.gapSize||1,i=a.dashNb||200,s=a.points,r=[],o=[],c=E.Zero();let h=0,f,_,d=0,g;for(g=0;g<s.length-1;g++)s[g+1].subtractToRef(s[g],c),h+=c.length();const p=h/i,x=e*p/(e+t);for(g=0;g<s.length-1;g++){s[g+1].subtractToRef(s[g],c),f=Math.floor(c.length()/p),c.normalize();for(let T=0;T<f;T++)_=p*T,r.push(s[g].x+_*c.x,s[g].y+_*c.y,s[g].z+_*c.z),r.push(s[g].x+(_+x)*c.x,s[g].y+(_+x)*c.y,s[g].z+(_+x)*c.z),o.push(d,d+1),d+=2}const b=new Be;return b.positions=r,b.indices=o,b}function iT(a,e,t=null){const i=e.instance,s=e.lines,r=e.colors;if(i){const f=i.getVerticesData(F.PositionKind);let _,d;r&&(_=i.getVerticesData(F.ColorKind));let g=0,p=0;for(let x=0;x<s.length;x++){const b=s[x];for(let T=0;T<b.length;T++)f[g]=b[T].x,f[g+1]=b[T].y,f[g+2]=b[T].z,r&&_&&(d=r[x],_[p]=d[T].r,_[p+1]=d[T].g,_[p+2]=d[T].b,_[p+3]=d[T].a,p+=4),g+=3}return i.updateVerticesData(F.PositionKind,f,!1,!1),r&&_&&i.updateVerticesData(F.ColorKind,_,!1,!1),i.refreshBoundingInfo(),i}const o=!!r,c=new zn(a,t,null,void 0,void 0,o,e.useVertexAlpha,e.material);return eT(e).applyToMesh(c,e.updatable),c}function sT(a,e,t=null){const i=e.colors?[e.colors]:null;return iT(a,{lines:[e.points],updatable:e.updatable,instance:e.instance,colors:i,useVertexAlpha:e.useVertexAlpha,material:e.material},t)}function nT(a,e,t=null){const i=e.points,s=e.instance,r=e.gapSize||1,o=e.dashSize||3;if(s){const f=_=>{const d=E.Zero(),g=_.length/6;let p=0,x,b,T=0,R,S;for(R=0;R<i.length-1;R++)i[R+1].subtractToRef(i[R],d),p+=d.length();const M=p/g,I=s._creationDataStorage.dashSize,A=s._creationDataStorage.gapSize,D=I*M/(I+A);for(R=0;R<i.length-1;R++)for(i[R+1].subtractToRef(i[R],d),x=Math.floor(d.length()/M),d.normalize(),S=0;S<x&&T<_.length;)b=M*S,_[T]=i[R].x+b*d.x,_[T+1]=i[R].y+b*d.y,_[T+2]=i[R].z+b*d.z,_[T+3]=i[R].x+(b+D)*d.x,_[T+4]=i[R].y+(b+D)*d.y,_[T+5]=i[R].z+(b+D)*d.z,T+=6,S++;for(;T<_.length;)_[T]=i[R].x,_[T+1]=i[R].y,_[T+2]=i[R].z,T+=3};return(e.dashNb||e.dashSize||e.gapSize||e.useVertexAlpha||e.material)&&me.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."),s.updateMeshPositions(f,!1),s}const c=new zn(a,t,null,void 0,void 0,void 0,e.useVertexAlpha,e.material);return tT(e).applyToMesh(c,e.updatable),c._creationDataStorage=new C1,c._creationDataStorage.dashSize=o,c._creationDataStorage.gapSize=r,c}let Dx=!1;function jw(){Dx||(Dx=!0,Be.CreateLineSystem=eT,Be.CreateDashedLines=tT,K.CreateLines=(a,e,t=null,i=!1,s=null)=>sT(a,{points:e,updatable:i,instance:s},t),K.CreateDashedLines=(a,e,t,i,s,r=null,o,c)=>nT(a,{points:e,dashSize:t,gapSize:i,dashNb:s,updatable:o,instance:c},r))}class Yw extends Ue{constructor(e,t){super(e.x,e.y),this.index=t}}class ld{constructor(){this.elements=[]}add(e){const t=[];for(const i of e){const s=new Yw(i,this.elements.length);t.push(s),this.elements.push(s)}return t}computeBounds(){const e=new Ue(this.elements[0].x,this.elements[0].y),t=new Ue(this.elements[0].x,this.elements[0].y);for(const i of this.elements)i.x<e.x?e.x=i.x:i.x>t.x&&(t.x=i.x),i.y<e.y?e.y=i.y:i.y>t.y&&(t.y=i.y);return{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class Kw{_addToepoint(e){for(const t of e)this._epoints.push(t.x,t.y)}constructor(e,t,i,s=earcut){this._points=new ld,this._outlinepoints=new ld,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=s,this._name=e,this._scene=i||ft.LastCreatedScene;let r;t instanceof Th?r=t.getPoints():r=t,this._addToepoint(r),this._points.add(r),this._outlinepoints.add(r),typeof this.bjsEarcut>"u"&&me.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);const t=new ld;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,i=2){const s=new K(this._name,this._scene),r=this.buildVertexData(t,i);return s.setVerticesData(F.PositionKind,r.positions,e),s.setVerticesData(F.NormalKind,r.normals,e),s.setVerticesData(F.UVKind,r.uvs,e),s.setIndices(r.indices),s}buildVertexData(e=0,t=2){const i=new Be,s=[],r=[],o=[],c=this._points.computeBounds();for(const _ of this._points.elements)s.push(0,1,0),r.push(_.x,0,_.y),o.push((_.x-c.min.x)/c.width,(_.y-c.min.y)/c.height);const h=[],f=this.bjsEarcut(this._epoints,this._eholes,2);for(let _=0;_<f.length;_++)h.push(f[_]);if(e>0){const _=r.length/3;for(const g of this._points.elements)s.push(0,-1,0),r.push(g.x,-e,g.y),o.push(1-(g.x-c.min.x)/c.width,1-(g.y-c.min.y)/c.height);const d=h.length;for(let g=0;g<d;g+=3){const p=h[g+0],x=h[g+1],b=h[g+2];h.push(b+_),h.push(x+_),h.push(p+_)}this._addSide(r,s,o,h,c,this._outlinepoints,e,!1,t);for(const g of this._holes)this._addSide(r,s,o,h,c,g,e,!0,t)}return i.indices=h,i.positions=r,i.normals=s,i.uvs=o,i}_addSide(e,t,i,s,r,o,c,h,f){let _=e.length/3,d=0;for(let g=0;g<o.elements.length;g++){const p=o.elements[g],x=o.elements[(g+1)%o.elements.length];e.push(p.x,0,p.y),e.push(p.x,-c,p.y),e.push(x.x,0,x.y),e.push(x.x,-c,x.y);const b=o.elements[(g+o.elements.length-1)%o.elements.length],T=o.elements[(g+2)%o.elements.length];let R=new E(-(x.y-p.y),0,x.x-p.x),S=new E(-(p.y-b.y),0,p.x-b.x),M=new E(-(T.y-x.y),0,T.x-x.x);h||(R=R.scale(-1),S=S.scale(-1),M=M.scale(-1));const I=R.normalizeToNew();let A=S.normalizeToNew(),D;const C=E.Dot(A,I);C>f?C<Bt-1?A=new E(p.x,0,p.y).subtract(new E(x.x,0,x.y)).normalize():A=S.add(R).normalize():A=I;const k=E.Dot(M,R);k>f?k<Bt-1?D=new E(x.x,0,x.y).subtract(new E(p.x,0,p.y)).normalize():D=M.add(R).normalize():D=I,i.push(d/r.width,0),i.push(d/r.width,1),d+=R.length(),i.push(d/r.width,0),i.push(d/r.width,1),t.push(A.x,A.y,A.z),t.push(A.x,A.y,A.z),t.push(D.x,D.y,D.z),t.pu
162sh(D.x,D.y,D.z),h?(s.push(_),s.push(_+2),s.push(_+1),s.push(_+1),s.push(_+2),s.push(_+3)):(s.push(_),s.push(_+1),s.push(_+2),s.push(_+1),s.push(_+3),s.push(_+2)),_+=4}}}function rT(a,e,t,i,s,r,o){const c=t||new Array(3),h=i,f=[],_=o||!1;for(let H=0;H<3;H++)c[H]===void 0&&(c[H]=new it(0,0,1,1)),h&&h[H]===void 0&&(h[H]=new dt(1,1,1,1));const d=a.getVerticesData(F.PositionKind),g=a.getVerticesData(F.NormalKind),p=a.getVerticesData(F.UVKind),x=a.getIndices(),b=d.length/9;let T,R,S,M,I=0;const A=[0];if(_)for(let H=b;H<d.length/3;H+=4)R=d[3*(H+2)]-d[3*H],S=d[3*(H+2)+2]-d[3*H+2],M=Math.sqrt(R*R+S*S),I+=M,A.push(I);let D,C=0;for(let H=0;H<g.length;H+=3)Math.abs(g[H+1])<.001&&(C=1),Math.abs(g[H+1]-1)<.001&&(C=0),Math.abs(g[H+1]+1)<.001&&(C=2),D=H/3,C===1?(T=D-b,T%4<1.5?_?p[2*D]=c[C].x+(c[C].z-c[C].x)*A[Math.floor(T/4)]/I:p[2*D]=c[C].x:_?p[2*D]=c[C].x+(c[C].z-c[C].x)*A[Math.floor(T/4)+1]/I:p[2*D]=c[C].z,T%2===0?p[2*D+1]=c[C].w:p[2*D+1]=c[C].y):(p[2*D]=(1-p[2*D])*c[C].x+p[2*D]*c[C].z,p[2*D+1]=(1-p[2*D+1])*c[C].y+p[2*D+1]*c[C].w),h&&f.push(h[C].r,h[C].g,h[C].b,h[C].a);Be._ComputeSides(e,d,x,g,p,s,r);const k=new Be;if(k.indices=x,k.positions=d,k.normals=g,k.uvs=p,h){const H=e===Be.DOUBLESIDE?f.concat(f):f;k.colors=H}return k}function a_(a,e,t=null,i=earcut){e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation);const s=e.shape,r=e.holes||[],o=e.depth||0,c=e.smoothingThreshold||2,h=[];let f;for(let x=0;x<s.length;x++)h[x]=new Ue(s[x].x,s[x].z);h[0].equalsWithEpsilon(h[h.length-1],1e-8)&&h.pop();const d=new Kw(a,h,t||ft.LastCreatedScene,i);for(let x=0;x<r.length;x++){f=[];for(let b=0;b<r[x].length;b++)f.push(new Ue(r[x][b].x,r[x][b].z));d.addHole(f)}const g=d.build(!1,o,c);return g._originalBuilderSideOrientation=e.sideOrientation,rT(g,e.sideOrientation,e.faceUV,e.faceColors,e.frontUVs,e.backUVs,e.wrap).applyToMesh(g,e.updatable),g}function o_(a,e,t=null,i=earcut){return a_(a,e,t,i)}let Ix=!1;function Zw(){Ix||(Ix=!0,Be.CreatePolygon=rT,K.CreatePolygon=(a,e,t,i,s,r,o=earcut)=>a_(a,{shape:e,holes:i,updatable:s,sideOrientation:r},t,o),K.ExtrudePolygon=(a,e,t,i,s,r,o,c=earcut)=>o_(a,{shape:e,holes:s,depth:t,updatable:r,sideOrientation:o},i,c))}function aT(a,e,t=null){const i=e.path,s=e.shape,r=e.scale||1,o=e.rotation||0,c=e.cap===0?0:e.cap||K.NO_CAP,h=e.updatable,f=K._GetDefaultSideOrientation(e.sideOrientation),_=e.instance||null,d=e.invertUV||!1,g=e.closeShape||!1,p=e.closePath||!1,x=e.capFunction||null;return lT(a,s,i,r,o,null,null,p,g,c,!1,t,!!h,f,_,d,e.frontUVs||null,e.backUVs||null,e.firstNormal||null,!!e.adjustFrame,x)}function oT(a,e,t=null){const i=e.path,s=e.shape,r=E.Zero(),o=(S,M)=>{const I=e.scaleFunction?.(S,M)??1;return r.copyFromFloats(I,I,I)},c=e.rotationFunction||(()=>0),h=e.closePath||e.ribbonCloseArray||!1,f=e.closeShape||e.ribbonClosePath||!1,_=e.cap===0?0:e.cap||K.NO_CAP,d=e.updatable,g=e.firstNormal||null,p=e.adjustFrame||!1,x=K._GetDefaultSideOrientation(e.sideOrientation),b=e.instance,T=e.invertUV||!1,R=e.capFunction||null;return lT(a,s,i,null,null,e.scaleVectorFunction??o,c,h,f,_,!0,t,!!d,x,b||null,T,e.frontUVs||null,e.backUVs||null,g,p,R||null)}function lT(a,e,t,i,s,r,o,c,h,f,_,d,g,p,x,b,T,R,S,M,I){const A=(J,te,ae,B,$,z,X,q,G,j,w)=>{const O=ae.getTangents(),U=ae.getNormals(),W=ae.getBinormals(),oe=ae.getDistances();if(w){for(let ke=0;ke<O.length;ke++)if(O[ke].x==0&&O[ke].y==0&&O[ke].z==0&&O[ke].copyFrom(O[ke-1]),U[ke].x==0&&U[ke].y==0&&U[ke].z==0&&U[ke].copyFrom(U[ke-1]),W[ke].x==0&&W[ke].y==0&&W[ke].z==0&&W[ke].copyFrom(W[ke-1]),ke>0){let ut=O[ke-1];E.Dot(ut,O[ke])<0&&O[ke].scaleInPlace(-1),ut=U[ke-1],E.Dot(ut,U[ke])<0&&U[ke].scaleInPlace(-1),ut=W[ke-1],E.Dot(ut,W[ke])<0&&W[ke].scaleInPlace(-1)}}let le=0;const be=()=>$!==null?$:E.OneReadOnly,Fe=j&&q?q:()=>z!==null?z:0,Y=j&&X?X:be;let ue=G===K.NO_CAP||G===K.CAP_END?0:2;const de=fe.Matrix[0];for(let ke=0;ke<te.length;ke++){const ut=[],Gt=Fe(ke,oe[ke]),Ot=Y(ke,oe[ke]);se.RotationAxisToRef(O[ke],le,de);for(let pt=0;pt<J.length;pt++){const Nt=O[ke].scale(J[pt].z).add(U[ke].scale(J[pt].x)).add(W[ke].scale(J[pt].y)),Ft=E.Zero();E.TransformCoordinatesToRef(Nt,de,Ft),Ft.multiplyInPlace(Ot).addInPlace(te[ke]),ut[pt]=Ft}B[ue]=ut,le+=Gt,ue++}const qe=I||(ke=>{const ut=Array(),Gt=E.Zero();let Ot;for(Ot=0;Ot<ke.length;Ot++)Gt.addInPlace(ke[Ot]);for(Gt.scaleInPlace(1/ke.length),Ot=0;Ot<ke.length;Ot++)ut.push(Gt);return ut});switch(G){case K.NO_CAP:break;case K.CAP_START:B[0]=qe(B[2]),B[1]=B[2];break;case K.CAP_END:B[ue]=B[ue-1],B[ue+1]=qe(B[ue-1]);break;case K.CAP_ALL:B[0]=qe(B[2]),B[1]=B[2],B[ue]=B[ue-1],B[ue+1]=qe(B[ue-1]);break}return B},D=i!==null?new E(i,i,i):null;let C;if(x){const J=x._creationDataStorage;return S?J.path3D.update(t,S):J.path3D.update(t),C=A(e,t,J.path3D,J.pathArray,D,s,r,o,J.cap,_,M),x=ta("",{pathArray:C,closeArray:!1,closePath:!1,offset:0,updatable:!1,sideOrientation:0,instance:x},d||void 0),x}
162const k=S?new hl(t,S):new hl(t),H=new Array;f=f<0||f>3?0:f,C=A(e,t,k,H,D,s,r,o,f,_,M);const L=ta(a,{pathArray:C,closeArray:c,closePath:h,updatable:g,sideOrientation:p,invertUV:b,frontUVs:T||void 0,backUVs:R||void 0},d);return L._creationDataStorage.pathArray=C,L._creationDataStorage.path3D=k,L._creationDataStorage.cap=f,L}let wx=!1;function Qw(){wx||(wx=!0,K.ExtrudeShape=(a,e,t,i,s,r,o=null,c,h,f)=>{const _={shape:e,path:t,scale:i,rotation:s,cap:r===0?0:r||K.NO_CAP,sideOrientation:h,instance:f,updatable:c};return aT(a,_,o)},K.ExtrudeShapeCustom=(a,e,t,i,s,r,o,c,h,f,_,d)=>{const g={shape:e,path:t,scaleFunction:i,rotationFunction:s,ribbonCloseArray:r,ribbonClosePath:o,cap:c===0?0:c||K.NO_CAP,sideOrientation:_,instance:d,updatable:f};return oT(a,g,h)})}function cT(a,e,t=null){const i=e.arc?e.arc<=0||e.arc>1?1:e.arc:1,s=e.closed===void 0?!0:e.closed,r=e.shape,o=e.radius||1,c=e.tessellation||64,h=e.clip||0,f=e.updatable,_=K._GetDefaultSideOrientation(e.sideOrientation),d=e.cap||K.NO_CAP,g=Math.PI*2,p=[],x=e.invertUV||!1;let b,T;const R=g/c*i;let S,M;for(b=0;b<=c-h;b++){for(M=[],(d==K.CAP_START||d==K.CAP_ALL)&&(M.push(new E(0,r[0].y,0)),M.push(new E(Math.cos(b*R)*r[0].x*o,r[0].y,Math.sin(b*R)*r[0].x*o))),T=0;T<r.length;T++)S=new E(Math.cos(b*R)*r[T].x*o,r[T].y,Math.sin(b*R)*r[T].x*o),M.push(S);(d==K.CAP_END||d==K.CAP_ALL)&&(M.push(new E(Math.cos(b*R)*r[r.length-1].x*o,r[r.length-1].y,Math.sin(b*R)*r[r.length-1].x*o)),M.push(new E(0,r[r.length-1].y,0))),p.push(M)}return ta(a,{pathArray:p,closeArray:s,sideOrientation:_,updatable:f,invertUV:x,frontUVs:e.frontUVs,backUVs:e.backUVs},t)}let Px=!1;function $w(){Px||(Px=!0,K.CreateLathe=(a,e,t,i,s,r,o)=>cT(a,{shape:e,radius:t,tessellation:i,sideOrientation:o,updatable:r},s))}function hT(a){const e=[],t=[],i=[],s=[],r=a.width!==void 0?a.width:a.size!==void 0?a.size:1,o=a.height!==void 0?a.height:a.size!==void 0?a.size:1,c=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,h=r/2,f=o/2;t.push(-h,-f,0),i.push(0,0,-1),s.push(0,0),t.push(h,-f,0),i.push(0,0,-1),s.push(1,0),t.push(h,f,0),i.push(0,0,-1),s.push(1,1),t.push(-h,f,0),i.push(0,0,-1),s.push(0,1),e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),Be._ComputeSides(c,t,e,i,s,a.frontUVs,a.backUVs);const _=new Be;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function uT(a,e={},t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,hT(e).applyToMesh(i,e.updatable),e.sourcePlane&&(i.translate(e.sourcePlane.normal,-e.sourcePlane.d),i.setDirection(e.sourcePlane.normal.scale(-1))),i}let Ox=!1;function Jw(){Ox||(Ox=!0,Be.CreatePlane=hT,K.CreatePlane=(a,e,t,i,s)=>uT(a,{size:e,width:e,height:e,sideOrientation:s,updatable:i},t))}function fT(a,e,t=null){const i=e.path;let s=e.instance,r=1;e.radius!==void 0?r=e.radius:s&&(r=s._creationDataStorage.radius);const o=e.tessellation||64,c=e.radiusFunction||null;let h=e.cap||K.NO_CAP;const f=e.invertUV||!1,_=e.updatable,d=K._GetDefaultSideOrientation(e.sideOrientation);e.arc=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1;const g=(R,S,M,I,A,D,C,k)=>{const H=S.getTangents(),L=S.getNormals(),J=S.getDistances(),ae=Math.PI*2/A*k,$=D||(()=>I);let z,X,q,G;const j=fe.Matrix[0];let w=C===K.NO_CAP||C===K.CAP_END?0:2;for(let U=0;U<R.length;U++){X=$(U,J[U]),z=Array(),q=L[U];for(let W=0;W<A;W++)se.RotationAxisToRef(H[U],ae*W,j),G=z[W]?z[W]:E.Zero(),E.TransformCoordinatesToRef(q,j,G),G.scaleInPlace(X).addInPlace(R[U]),z[W]=G;M[w]=z,w++}const O=(U,W)=>{const oe=Array();for(let le=0;le<U;le++)oe.push(R[W]);return oe};switch(C){case K.NO_CAP:break;case K.CAP_START:M[0]=O(A,0),M[1]=M[2].slice(0);break;case K.CAP_END:M[w]=M[w-1].slice(0),M[w+1]=O(A,R.length-1);break;case K.CAP_ALL:M[0]=O(A,0),M[1]=M[2].slice(0),M[w]=M[w-1].slice(0),M[w+1]=O(A,R.length-1);break}return M};let p,x;if(s){const R=s._creationDataStorage,S=e.arc||R.arc;return p=R.path3D.update(i),x=g(i,p,R.pathArray,r,R.tessellation,c,R.cap,S),s=ta("",{pathArray:x,instance:s}),R.path3D=p,R.pathArray=x,R.arc=S,R.radius=r,s}p=new hl(i);const b=new Array;h=h<0||h>3?0:h,x=g(i,p,b,r,o,c,h,e.arc);const T=ta(a,{pathArray:x,closePath:!0,closeArray:!1,updatable:_,sideOrientation:d,invertUV:f,frontUVs:e.frontUVs,backUVs:e.backUVs},t);return T._creationDataStorage.pathArray=x,T._creationDataStorage.path3D=p,T._creationDataStorage.tessellation=o,T._creationDataStorage.cap=h,T._creationDataStorage.arc=e.arc,T._creationDataStorage.radius=r,T}let Fx=!1;function eP(){Fx||(Fx=!0,K.CreateTube=(a,e,t,i,s,r,o,c,h,f)=>
162fT(a,{path:e,radius:t,tessellation:i,radiusFunction:s,arc:1,cap:r,updatable:c,sideOrientation:h,instance:f},o))}function dT(a){const e=[];e[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},e[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},e[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},e[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},e[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},e[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},e[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},e[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},e[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},e[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},e[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},e[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},e[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},e[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},e[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.9
16269981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};const t=a.type&&(a.type<0||a.type>=e.length)?0:a.type||0,i=a.size,s=a.sizeX||i||1,r=a.sizeY||i||1,o=a.sizeZ||i||1,c=a.custom||e[t],h=c.face.length,f=a.faceUV||new Array(h),_=a.faceColors,d=a.flat===void 0?!0:a.flat,g=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,p=[],x=[],b=[],T=[],R=[];let S=0,M=0;const I=[];let A,D,C,k,H,L,J,te;if(d)for(D=0;D<h;D++)_&&_[D]===void 0&&(_[D]=new dt(1,1,1,1)),f&&f[D]===void 0&&(f[D]=new it(0,0,1,1));if(d)for(D=0;D<h;D++){const B=c.face[D].length;for(H=2*Math.PI/B,L=.5*Math.tan(H/2),J=.5,A=0;A<B;A++)p.push(c.vertex[c.face[D][A]][0]*s,c.vertex[c.face[D][A]][1]*r,c.vertex[c.face[D][A]][2]*o),I.push(S),S++,C=f[D].x+(f[D].z-f[D].x)*(.5+L),k=f[D].y+(f[D].w-f[D].y)*(J-.5),T.push(C,k),te=L*Math.cos(H)-J*Math.sin(H),J=L*Math.sin(H)+J*Math.cos(H),L=te,_&&R.push(_[D].r,_[D].g,_[D].b,_[D].a);for(A=0;A<B-2;A++)x.push(I[0+M],I[A+2+M],I[A+1+M]);M+=B}else{for(A=0;A<c.vertex.length;A++)p.push(c.vertex[A][0]*s,c.vertex[A][1]*r,c.vertex[A][2]*o),T.push(0,0);for(D=0;D<h;D++)for(A=0;A<c.face[D].length-2;A++)x.push(c.face[D][0],c.face[D][A+2],c.face[D][A+1])}Be.ComputeNormals(p,x,b),Be._ComputeSides(g,p,x,b,T,a.frontUVs,a.backUVs);const ae=new Be;return ae.positions=p,ae.indices=x,ae.normals=b,ae.uvs=T,_&&d&&(ae.colors=R),ae}function l_(a,e={},t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,dT(e).applyToMesh(i,e.updatable),i}let Bx=!1;function tP(){Bx||(Bx=!0,Be.CreatePolyhedron=dT,K.CreatePolyhedron=(a,e,t)=>l_(a,e,t))}function _T(a){const e=a.sideOrientation||Be.DEFAULTSIDE,t=a.radius||1,i=a.flat===void 0?!0:a.flat,s=(a.subdivisions||4)|0,r=a.radiusX||t,o=a.radiusY||t,c=a.radiusZ||t,h=(1+Math.sqrt(5))/2,f=[-1,h,-0,1,h,0,-1,-h,0,1,-h,0,0,-1,-h,0,1,-h,0,-1,h,0,1,h,h,0,1,h,0,-1,-h,0,1,-h,0,-1],_=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],d=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],g=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],p=138/1024,x=239/1024,b=60/1024,T=26/1024,R=-40/1024,S=20/1024,M=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],I=[],A=[],D=[],C=[];let k=0;const H=new Array(3),L=new Array(3);let J;for(J=0;J<3;J++)H[J]=E.Zero(),L[J]=Ue.Zero();for(let ae=0;ae<20;ae++){for(J=0;J<3;J++){const $=_[3*ae+J];H[J].copyFromFloats(f[3*d[$]],f[3*d[$]+1],f[3*d[$]+2]),H[J].normalize(),L[J].copyFromFloats(g[2*$]*p+b+M[ae]*R,g[2*$+1]*x+T+M[ae]*S)}const B=($,z,X,q)=>{const G=E.Lerp(H[0],H[2],z/s),j=E.Lerp(H[1],H[2],z/s),w=s===z?H[2]:E.Lerp(G,j,$/(s-z));w.normalize();let O;if(i){const le=E.Lerp(H[0],H[2],q/s),be=E.Lerp(H[1],H[2],q/s);O=E.Lerp(le,be,X/(s-q))}else O=new E(w.x,w.y,w.z);O.x/=r,O.y/=o,O.z/=c,O.normalize();const U=Ue.Lerp(L[0],L[2],z/s),W=Ue.Lerp(L[1],L[2],z/s),oe=s===z?L[2]:Ue.Lerp(U,W,$/(s-z));A.push(w.x*r,w.y*o,w.z*c),D.push(O.x,O.y,O.z),C.push(oe.x,oe.y),I.push(k),k++};for(let $=0;$<s;$++)for(let z=0;z+$<s;z++)B(z,$,z+1/3,$+1/3),B(z+1,$,z+1/3,$+1/3),B(z,$+1,z+1/3,$+1/3),z+$+1<s&&(B(z+1,$,z+2/3,$+2/3),B(z+1,$+1,z+2/3,$+2/3),B(z,$+1,z+2/3,$+2/3))}Be._ComputeSides(e,A,I,D,C,a.frontUVs,a.backUVs);const te=new Be;
162return te.indices=I,te.positions=A,te.normals=D,te.uvs=C,te}function mT(a,e={},t=null){const i=new K(a,t);return e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,_T(e).applyToMesh(i,e.updatable),i}let Lx=!1;function iP(){Lx||(Lx=!0,Be.CreateIcoSphere=_T,K.CreateIcoSphere=(a,e,t)=>mT(a,e,t))}const sP=new E(1,0,0),nP=new E(-1,0,0),rP=new E(0,1,0),aP=new E(0,-1,0),oP=new E(0,0,1),lP=new E(0,0,-1);class _h{constructor(e=E.Zero(),t=E.Up(),i=Ue.Zero(),s=0,r=0,o=null,c=null,h=null,f=null){this.position=e,this.normal=t,this.uv=i,this.vertexIdx=s,this.vertexIdxForBones=r,this.localPositionOverride=o,this.localNormalOverride=c,this.matrixIndicesOverride=h,this.matrixWeightsOverride=f}clone(){return new _h(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,this.localPositionOverride?.slice(),this.localNormalOverride?.slice(),this.matrixIndicesOverride?.slice(),this.matrixWeightsOverride?.slice())}}function gT(a,e,t){const i=!!e.skeleton,s=!!e.morphTargetManager?.numTargets,r=t.localMode||i,o=e.getIndices(),c=i||s?e.getPositionData(!0,!0):e.getVerticesData(F.PositionKind),h=i||s?e.getNormalsData(!0,!0):e.getVerticesData(F.NormalKind),f=r?i?e.getVerticesData(F.PositionKind):c:null,_=r?i?e.getVerticesData(F.NormalKind):h:null,d=e.getVerticesData(F.UVKind),g=i?e.getVerticesData(F.MatricesIndicesKind):null,p=i?e.getVerticesData(F.MatricesWeightsKind):null,x=i?e.getVerticesData(F.MatricesIndicesExtraKind):null,b=i?e.getVerticesData(F.MatricesWeightsExtraKind):null,T=t.position||E.Zero();let R=t.normal||E.Up();const S=t.size||E.One(),M=t.angle||0;if(!R){const X=new E(0,0,1),q=e.getScene().activeCamera,G=E.TransformCoordinates(X,q.getWorldMatrix());R=q.globalPosition.subtract(G)}const I=-Math.atan2(R.z,R.x)-Math.PI/2,A=Math.sqrt(R.x*R.x+R.z*R.z),D=Math.atan2(R.y,A),C=new Be;C.indices=[],C.positions=[],C.normals=[],C.uvs=[],C.matricesIndices=i?[]:null,C.matricesWeights=i?[]:null,C.matricesIndicesExtra=x?[]:null,C.matricesWeightsExtra=b?[]:null;let k=0;const H=(X,q)=>{const G=new _h;if(!o||!c||!h)return G;const j=o[X];if(G.vertexIdx=j*3,G.vertexIdxForBones=j*4,G.position=new E(c[j*3],c[j*3+1],c[j*3+2]),E.TransformCoordinatesToRef(G.position,q,G.position),G.normal=new E(h[j*3],h[j*3+1],h[j*3+2]),E.TransformNormalToRef(G.normal,q,G.normal),t.captureUVS&&d){const w=d[j*2+1];G.uv=new Ue(d[j*2],w)}return G},L=[0,0,0,0],J=(X,q)=>{if(X.length===0)return X;const G=.5*Math.abs(E.Dot(S,q)),j=(U,W,oe,le)=>{for(let be=0;be<le;++be)if(U[oe+be]===W)return oe+be;return-1},w=(U,W)=>{const oe=E.GetClipFactor(U.position,W.position,q,G);let le=L,be=L;if(g&&p){const Pe=U.matrixIndicesOverride?0:U.vertexIdxForBones,ei=U.matrixIndicesOverride??g,Xt=U.matrixWeightsOverride??p,ai=W.matrixIndicesOverride?0:W.vertexIdxForBones,Kt=W.matrixIndicesOverride??g,Zt=W.matrixWeightsOverride??p;le=[0,0,0,0],be=[0,0,0,0];let At=0;for(let Dt=0;Dt<4;
162++Dt)if(Xt[Pe+Dt]>0){const zt=j(Kt,ei[Pe+Dt],ai,4);le[At]=ei[Pe+Dt],be[At]=Md(Xt[Pe+Dt],zt>=0?Zt[zt]:0,oe),At++}for(let Dt=0;Dt<4&&At<4;++Dt){const zt=Kt[ai+Dt];j(ei,zt,Pe,4)===-1&&(le[At]=zt,be[At]=Md(0,Zt[ai+Dt],oe),At++)}const ti=be[0]+be[1]+be[2]+be[3];be[0]/=ti,be[1]/=ti,be[2]/=ti,be[3]/=ti}const Ee=U.localPositionOverride?U.localPositionOverride[0]:f?.[U.vertexIdx]??0,Fe=U.localPositionOverride?U.localPositionOverride[1]:f?.[U.vertexIdx+1]??0,Y=U.localPositionOverride?U.localPositionOverride[2]:f?.[U.vertexIdx+2]??0,ue=W.localPositionOverride?W.localPositionOverride[0]:f?.[W.vertexIdx]??0,de=W.localPositionOverride?W.localPositionOverride[1]:f?.[W.vertexIdx+1]??0,we=W.localPositionOverride?W.localPositionOverride[2]:f?.[W.vertexIdx+2]??0,qe=U.localNormalOverride?U.localNormalOverride[0]:_?.[U.vertexIdx]??0,ke=U.localNormalOverride?U.localNormalOverride[1]:_?.[U.vertexIdx+1]??0,ut=U.localNormalOverride?U.localNormalOverride[2]:_?.[U.vertexIdx+2]??0,Gt=W.localNormalOverride?W.localNormalOverride[0]:_?.[W.vertexIdx]??0,Ot=W.localNormalOverride?W.localNormalOverride[1]:_?.[W.vertexIdx+1]??0,pt=W.localNormalOverride?W.localNormalOverride[2]:_?.[W.vertexIdx+2]??0,Nt=qe+(Gt-qe)*oe,Ft=ke+(Ot-ke)*oe,$e=ut+(pt-ut)*oe,ie=Math.sqrt(Nt*Nt+Ft*Ft+$e*$e);return new _h(E.Lerp(U.position,W.position,oe),E.Lerp(U.normal,W.normal,oe).normalize(),Ue.Lerp(U.uv,W.uv,oe),-1,-1,f?[Ee+(ue-Ee)*oe,Fe+(de-Fe)*oe,Y+(we-Y)*oe]:null,_?[Nt/ie,Ft/ie,$e/ie]:null,le,be)};let O=null;X.length>3&&(O=[]);for(let U=0;U<X.length;U+=3){let W=null,oe=null,le=null,be=null;const Ee=E.Dot(X[U].position,q)-G,Fe=E.Dot(X[U+1].position,q)-G,Y=E.Dot(X[U+2].position,q)-G,ue=Ee>0,de=Fe>0,we=Y>0;switch((ue?1:0)+(de?1:0)+(we?1:0)){case 0:X.length>3?(O.push(X[U]),O.push(X[U+1]),O.push(X[U+2])):O=X;break;case 1:if(O=O??new Array,ue&&(W=X[U+1],oe=X[U+2],le=w(X[U],W),be=w(X[U],oe)),de){W=X[U],oe=X[U+2],le=w(X[U+1],W),be=w(X[U+1],oe),O.push(le),O.push(oe.clone()),O.push(W.clone()),O.push(oe.clone()),O.push(le.clone()),O.push(be);break}we&&(W=X[U],oe=X[U+1],le=w(X[U+2],W),be=w(X[U+2],oe)),W&&oe&&le&&be&&(O.push(W.clone()),O.push(oe.clone()),O.push(le),O.push(be),O.push(le.clone()),O.push(oe.clone()));break;case 2:O=O??new Array,ue||(W=X[U].clone(),oe=w(W,X[U+1]),le=w(W,X[U+2]),O.push(W),O.push(oe),O.push(le)),de||(W=X[U+1].clone(),oe=w(W,X[U+2]),le=w(W,X[U]),O.push(W),O.push(oe),O.push(le)),we||(W=X[U+2].clone(),oe=w(W,X[U]),le=w(W,X[U+1]),O.push(W),O.push(oe),O.push(le));break}}return O},te=e instanceof K?e:null,ae=te?._thinInstanceDataStorage.matrixData,B=te?.thinInstanceCount||1,$=fe.Matrix[0];$.copyFrom(se.IdentityReadOnly);for(let X=0;X<B;++X){if(te?.hasThinInstances&&ae){const U=X*16;$.setRowFromFloats(0,ae[U+0],ae[U+1],ae[U+2],ae[U+3]),$.setRowFromFloats(1,ae[U+4],ae[U+5],ae[U+6],ae[U+7]),$.setRowFromFloats(2,ae[U+8],ae[U+9],ae[U+10],ae[U+11]),$.setRowFromFloats(3,ae[U+12],ae[U+13],ae[U+14],ae[U+15])}const q=se.RotationYawPitchRoll(I,D,M).multiply(se.Translation(T.x,T.y,T.z)),G=se.Invert(q),j=e.getWorldMatrix(),w=$.multiply(j).multiply(G),O=new Array(3);for(let U=0;U<o.length;U+=3){let W=O;if(W[0]=H(U,w),W[1]=H(U+1,w),W[2]=H(U+2,w),!(t.cullBackFaces&&-W[0].normal.z<=0&&-W[1].normal.z<=0&&-W[2].normal.z<=0)&&(W=J(W,sP),!!W&&(W=J(W,nP),!!W&&(W=J(W,rP),!!W&&(W=J(W,aP),!!W&&(W=J(W,oP),!!W&&(W=J(W,lP),!!W)))))))for(let oe=0;oe<W.length;oe++){const le=W[oe];if(C.indices.push(k),r?(le.localPositionOverride?(C.positions[k*3]=le.localPositionOverride[0],C.positions[k*3+1]=le.localPositionOverride[1],C.positions[k*3+2]=le.localPositionOverride[2]):f&&(C.positions[k*3]=f[le.vertexIdx],C.positions[k*3+1]=f[le.vertexIdx+1],C.positions[k*3+2]=f[le.vertexIdx+2]),le.localNormalOverride?(C.normals[k*3]=le.localNormalOverride[0],C.normals[k*3+1]=le.localNormalOverride[1],C.normals[k*3+2]=le.localNormalOverride[2]):_&&(C.normals[k*3]=_[le.vertexIdx],C.normals[k*3+1]=_[le.vertexIdx+1],C.normals[k*3+2]=_[le.vertexIdx+2])):(le.position.toArray(C.positions,k*3),le.normal.toArray(C.normals,k*3)),C.matricesIndices&&C.matricesWeights&&(le.matrixIndicesOverride?(C.matricesIndices[k*4]=le.matrixIndicesOverride[0],C.matricesIndices[k*4+1]=le.matrixIndicesOverride[1],C.matricesIndices[k*4+2]=le.matrixIndicesOverride[2],C.matricesIndices[k*4+3]=le.matrixIndicesOverride[3]):(g&&(C.matricesIndices[k*4]=g[le.vertexIdxForBones],C.matricesIndices[k*4+1]=g[le.vertexIdxForBones+1],C.matricesIndices[k*4+2]=g[le.vertexIdxForBones+2],C.matricesIndices[k*4+3]=g[le.vertexIdxForBones+3]),x&&C.matricesIndicesExtra&&(C.matricesIndicesExtra[k*4]=x[le.vertexIdxForBones],C.matricesIndicesExtra[k*4+1]=x[le.vertexIdxForBones+1],C.matricesIndicesExtra[k*4+2]=x[le.vertexIdxForBones+2],C.matricesIndicesExtra[k*4+3]=x[le.vertexIdxForBones+3])),le.matrixWeightsOverride?(C.matricesWeights[k*4]=le.matrixWeightsOverride[0],C.matricesWeights[k*4+1]=le.matrixWeightsOverride[1],C.matricesWeights[k*4+2]=le.matrixWeightsOverride[2],C.matricesWeights[k*4+3]=le.matrixWeightsOverride[3]):(p&&(C.matricesWeights[k*4]=p[le.vertexIdxForBones],C.matricesWeights[k*4+1]=p[le.vertexIdxForBones+1],C.matricesWeights[k*4+2]=p[le.vertexIdxForBones+2],C.matricesWeights[k*4+3]=p[le.vertexIdxForBones+3]),b&&C.matricesWeightsExtra&&(C.matricesWeightsExtra[k*4]=b[le.vertexIdxForBones],C.matricesWeightsExtra[k*4+1]=b[le.vertexIdxForBones+1],C.matricesWeightsExtra[k*4+2]=b[le.vertexIdxForBones+2],C.matricesWeightsExtra[k*4+3]=b[le.vertexIdxForBones+3]))),t.captureUVS)le.uv.toArray(C.uvs,k*2);
162else{C.uvs.push(.5+le.position.x/S.x);const be=.5+le.position.y/S.y;C.uvs.push(be)}k++}}}C.indices.length===0&&(C.indices=null),C.positions.length===0&&(C.positions=null),C.normals.length===0&&(C.normals=null),C.uvs.length===0&&(C.uvs=null),C.matricesIndices?.length===0&&(C.matricesIndices=null),C.matricesWeights?.length===0&&(C.matricesWeights=null),C.matricesIndicesExtra?.length===0&&(C.matricesIndicesExtra=null),C.matricesWeightsExtra?.length===0&&(C.matricesWeightsExtra=null);const z=new K(a,e.getScene());return C.applyToMesh(z),r?(z.skeleton=e.skeleton,z.parent=e):(z.position=T.clone(),z.rotation=new E(D,I,M)),z.computeWorldMatrix(!0),z.refreshBoundingInfo(!0,!0),z}let Ux=!1;function cP(){Ux||(Ux=!0,K.CreateDecal=(a,e,t,i,s,r)=>gT(a,e,{position:t,normal:i,size:s,angle:r}))}function pT(a={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){const e=Math.max(a.subdivisions?a.subdivisions:2,1)|0,t=Math.max(a.tessellation?a.tessellation:16,3)|0,i=Math.max(a.height?a.height:1,0),s=Math.max(a.radius?a.radius:.25,0),r=Math.max(a.capSubdivisions?a.capSubdivisions:6,1)|0,o=t,c=e,h=Math.max(a.radiusTop?a.radiusTop:s,0),f=Math.max(a.radiusBottom?a.radiusBottom:s,0),_=i-(h+f),d=0,g=2*Math.PI,p=Math.max(a.topCapSubdivisions?a.topCapSubdivisions:r,1),x=Math.max(a.bottomCapSubdivisions?a.bottomCapSubdivisions:r,1),b=Math.acos((f-h)/i);let T=[];const R=[],S=[],M=[];let I=0;const A=[],D=_*.5,C=Math.PI*.5;let k,H;const L=E.Zero(),J=E.Zero(),te=Math.cos(b),ae=Math.sin(b),B=new Ue(h*ae,D+h*te).subtract(new Ue(f*ae,-D+f*te)).length(),$=h*b+B+f*(C-b);let z=0;for(H=0;H<=p;H++){const j=[],w=C-b*(H/p);z+=h*b/p;const O=Math.cos(w),U=Math.sin(w),W=O*h;for(k=0;k<=o;k++){const oe=k/o,le=oe*g+d,be=Math.sin(le),Ee=Math.cos(le);J.x=W*be,J.y=D+U*h,J.z=W*Ee,R.push(J.x,J.y,J.z),L.set(O*be,U,O*Ee),S.push(L.x,L.y,L.z),M.push(oe,1-z/$),j.push(I),I++}A.push(j)}const X=i-h-f+te*h-te*f,q=ae*(f-h)/X;for(H=1;H<=c;H++){const j=[];z+=B/c;const w=ae*(H*(f-h)/c+h);for(k=0;k<=o;k++){const O=k/o,U=O*g+d,W=Math.sin(U),oe=Math.cos(U);J.x=w*W,J.y=D+te*h-H*X/c,J.z=w*oe,R.push(J.x,J.y,J.z),L.set(W,q,oe).normalize(),S.push(L.x,L.y,L.z),M.push(O,1-z/$),j.push(I),I++}A.push(j)}for(H=1;H<=x;H++){const j=[],w=C-b-(Math.PI-b)*(H/x);z+=f*b/x;const O=Math.cos(w),U=Math.sin(w),W=O*f;for(k=0;k<=o;k++){const oe=k/o,le=oe*g+d,be=Math.sin(le),Ee=Math.cos(le);J.x=W*be,J.y=-D+U*f,J.z=W*Ee,R.push(J.x,J.y,J.z),L.set(O*be,U,O*Ee),S.push(L.x,L.y,L.z),M.push(oe,1-z/$),j.push(I),I++}A.push(j)}for(k=0;k<o;k++)for(H=0;H<p+c+x;H++){const j=A[H][k],w=A[H+1][k],O=A[H+1][k+1],U=A[H][k+1];T.push(j),T.push(w),T.push(U),T.push(w),T.push(O),T.push(U)}if(T=T.reverse(),a.orientation&&!a.orientation.equals(E.Up())){const j=new se;a.orientation.clone().scale(Math.PI*.5).cross(E.Up()).toQuaternion().toRotationMatrix(j);const w=E.Zero();for(let O=0;O<R.length;O+=3)w.set(R[O],R[O+1],R[O+2]),E.TransformCoordinatesToRef(w.clone(),j,w),R[O]=w.x,R[O+1]=w.y,R[O+2]=w.z}const G=new Be;return G.positions=R,G.normals=S,G.uvs=M,G.indices=T,G}function yT(a,e={orientation:E.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6,updatable:!1},t=null){const i=new K(a,t);return pT(e).applyToMesh(i,e.updatable),i}let kx=!1;function hP(){kx||(kx=!0,K.CreateCapsule=(a,e,t)=>yT(a,e,t),Be.CreateCapsule=pT)}class Yt{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),me.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),me.Warn("y is not an integer, floor(y) used"))}clone(){return new Yt(this.x,this.y)}rotate60About(e){const t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){const t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),me.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),me.Warn("n not an integer only floor(n) used"));const i=this.x;return this.x=e-i-this.y,this.y=t+i,this}rotateNeg120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),me.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),me.Warn("n is not an integer,   floor(n) used"));const i=this.x;return this.x=this.y-t,this.y=e+t-i-this.y,this}toCartesianOrigin(e,t){const i=E.Zero();return i.x=e.x+2*this.x*t+this.y*t,i.y=e.y+Math.sqrt(3)*this.y*t,i}static Zero(){return new Yt(0,0)}}class bT{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new Fd("icosahedron","Regular",[[0,di,-1],[-di,1,0],[-1,0,-di],[1,0,-di],[di,1,0],[0,di,1],[-1,0,di],[-di,-1,0],[0,-di,-1],[di,-1,0],[1,0,di],[0,-di,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,
1626]])}setIndices(){let e=12;const t={},i=this.m,s=this.n;let r=i;s!==0&&(r=Sd(i,s));const o=i/r,c=s/r;let h,f,_,d,g;const p=Yt.Zero(),x=new Yt(i,s),b=new Yt(-s,i+s),T=Yt.Zero(),R=Yt.Zero(),S=Yt.Zero();let M=[],I,A,D,C;const k=[],H=this.vertByDist,L=(J,te,ae,B)=>{I=J+"|"+ae,A=te+"|"+B,I in t||A in t?I in t&&!(A in t)?t[A]=t[I]:A in t&&!(I in t)&&(t[I]=t[A]):(t[I]=e,t[A]=e,e++),H[ae][0]>2?k[t[I]]=[-H[ae][0],H[ae][1],t[I]]:k[t[I]]=[M[H[ae][0]],H[ae][1],t[I]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let J=0;J<20;J++){if(M=this.IDATA.face[J],_=M[2],d=M[1],g=M[0],D=p.x+"|"+p.y,I=J+"|"+D,I in t||(t[I]=_,k[_]=[M[H[D][0]],H[D][1]]),D=x.x+"|"+x.y,I=J+"|"+D,I in t||(t[I]=d,k[d]=[M[H[D][0]],H[D][1]]),D=b.x+"|"+b.y,I=J+"|"+D,I in t||(t[I]=g,k[g]=[M[H[D][0]],H[D][1]]),h=this.IDATA.edgematch[J][0],f=this.IDATA.edgematch[J][1],f==="B")for(let te=1;te<r;te++)R.x=i-te*(o+c),R.y=s+te*o,S.x=-te*c,S.y=te*(o+c),D=R.x+"|"+R.y,C=S.x+"|"+S.y,L(J,h,D,C);if(f==="O")for(let te=1;te<r;te++)S.x=-te*c,S.y=te*(o+c),T.x=te*o,T.y=te*c,D=S.x+"|"+S.y,C=T.x+"|"+T.y,L(J,h,D,C);if(h=this.IDATA.edgematch[J][2],f=this.IDATA.edgematch[J][3],f&&f==="A")for(let te=1;te<r;te++)T.x=te*o,T.y=te*c,R.x=i-(r-te)*(o+c),R.y=s+(r-te)*o,D=T.x+"|"+T.y,C=R.x+"|"+R.y,L(J,h,D,C);for(let te=0;te<this.vertices.length;te++)D=this.vertices[te].x+"|"+this.vertices[te].y,I=J+"|"+D,I in t||(t[I]=e++,H[D][0]>2?k[t[I]]=[-H[D][0],H[D][1],t[I]]:k[t[I]]=[M[H[D][0]],H[D][1],t[I]])}this.closestTo=k,this.vecToidx=t}calcCoeffs(){const e=this.m,t=this.n,i=Math.sqrt(3)/3,s=e*e+t*t+e*t;this.coau=(e+t)/s,this.cobu=-t/s,this.coav=-i*(e-t)/s,this.cobv=i*(2*e+t)/s}createInnerFacets(){const e=this.m,t=this.n;for(let i=0;i<t+e+1;i++)for(let s=this.min[i];s<this.max[i]+1;s++)s<this.max[i]&&s<this.max[i+1]+1&&this.innerFacets.push(["|"+s+"|"+i,"|"+s+"|"+(i+1),"|"+(s+1)+"|"+i]),i>0&&s<this.max[i-1]&&s+1<this.max[i]+1&&this.innerFacets.push(["|"+s+"|"+i,"|"+(s+1)+"|"+i,"|"+(s+1)+"|"+(i-1)])}edgeVecsABOB(){const e=this.m,t=this.n,i=new Yt(-t,e+t);for(let s=1;s<e+t;s++){const r=new Yt(this.min[s],s),o=new Yt(this.min[s-1],s-1),c=new Yt(this.min[s+1],s+1),h=r.clone(),f=o.clone(),_=c.clone();h.rotate60About(i),f.rotate60About(i),_.rotate60About(i);const d=new Yt(this.max[h.y],h.y),g=new Yt(this.max[h.y-1],h.y-1),p=new Yt(this.max[h.y-1]-1,h.y-1);(h.x!==d.x||h.y!==d.y)&&(h.x!==g.x?(this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([r,g,p]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([r,p,d])):h.y===_.y?(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([r,o,g]),this.vertexTypes.push([1,0,1]),this.isoVecsABOB.push([r,g,c])):(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([r,o,g]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([r,g,d])))}}mapABOBtoOBOA(){const e=new Yt(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let s=0;s<3;s++)e.x=this.isoVecsABOB[t][s].x,e.y=this.isoVecsABOB[t][s].y,this.vertexTypes[t][s]===0&&e.rotateNeg120(this.m,this.n),i.push(e.clone());this.isoVecsOBOA.push(i)}}mapABOBtoBAOA(){const e=new Yt(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let s=0;s<3;s++)e.x=this.isoVecsABOB[t][s].x,e.y=this.isoVecsABOB[t][s].y,this.vertexTypes[t][s]===1&&e.rotate120(this.m,this.n),i.push(e.clone());this.isoVecsBAOA.push(i)}}MapToFace(e,t){const i=this.IDATA.face[e],s=i[2],r=i[1],o=i[0],c=E.FromArray(this.IDATA.vertex[s]),h=E.FromArray(this.IDATA.vertex[r]),f=E.FromArray(this.IDATA.vertex[o]),_=h.subtract(c),d=f.subtract(c),g=_.scale(this.coau).add(d.scale(this.cobu)),p=_.scale(this.coav).add(d.scale(this.cobv));let x,b;for(let T=0;T<this.cartesian.length;T++)b=g.scale(this.cartesian[T].x).add(p.scale(this.cartesian[T].y)).add(c),b.x,b.y,b.z,x=e+"|"+this.vertices[T].x+"|"+this.vertices[T].y,t.vertex[this.vecToidx[x]]=[b.x,b.y,b.z]}build(e,t){const i=[],s=Yt.Zero(),r=new Yt(e,t),o=new Yt(-t,e+t);i.push(s,r,o);for(let A=t;A<e+1;A++)for(let D=0;D<e+1-A;D++)i.push(new Yt(D,A));if(t>0){const A=Sd(e,t),D=e/A,C=t/A;for(let H=1;H<A;H++)i.push(new Yt(H*D,H*C)),i.push(new Yt(-H*C,H*(D+C))),i.push(new Yt(e-H*(D+C),t+H*D));const k=e/t;for(let H=1;H<t;H++)for(let L=0;L<H*k;L++)i.push(new Yt(L,H)),i.push(new Yt(L,H).rotate120(e,t)),i.push(new Yt(L,H).rotateNeg120(e,t))}i.sort((A,D)=>A.x-D.x),i.sort((A,D)=>A.y-D.y);const c=new Array(e+t+1),h=new Array(e+t+1);for(let A=0;A<c.length;A++)c[A]=1/0,h[A]=-1/0;let f,_;const d=i.length;for(let A=0;A<d;A++)_=i[A].x,f=i[A].y,c[f]=Math.min(_,c[f]),h[f]=Math.max(_,h[f]);const g=(A,D)=>{const C=A.clone();
162return D==="A"&&C.rotateNeg120(e,t),D==="B"&&C.rotate120(e,t),C.x<0?C.y:C.x+C.y},p=[],x=[],b=[],T=[],R={},S=[];let M=-1,I=-1;for(let A=0;A<d;A++)p[A]=i[A].toCartesianOrigin(new Yt(0,0),.5),x[A]=g(i[A],"O"),b[A]=g(i[A],"A"),T[A]=g(i[A],"B"),x[A]===b[A]&&b[A]===T[A]?(M=3,I=x[A]):x[A]===b[A]?(M=4,I=x[A]):b[A]===T[A]?(M=5,I=b[A]):T[A]===x[A]&&(M=6,I=x[A]),x[A]<b[A]&&x[A]<T[A]&&(M=2,I=x[A]),b[A]<x[A]&&b[A]<T[A]&&(M=1,I=b[A]),T[A]<b[A]&&T[A]<x[A]&&(M=0,I=T[A]),S.push([M,I,i[A].x,i[A].y]);S.sort((A,D)=>A[2]-D[2]),S.sort((A,D)=>A[3]-D[3]),S.sort((A,D)=>A[1]-D[1]),S.sort((A,D)=>A[0]-D[0]);for(let A=0;A<S.length;A++)R[S[A][2]+"|"+S[A][3]]=[S[A][0],S[A][1],A];return this.m=e,this.n=t,this.vertices=i,this.vertByDist=R,this.cartesian=p,this.min=c,this.max=h,this}}class Fd{constructor(e,t,i,s){this.name=e,this.category=t,this.vertex=i,this.face=s}}class Ch extends Fd{innerToData(e,t){for(let i=0;i<t.innerFacets.length;i++)this.face.push(t.innerFacets[i].map(s=>t.vecToidx[e+s]))}mapABOBtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s<t.isoVecsABOB.length;s++){const r=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===0?r.push(e+"|"+t.isoVecsABOB[s][o].x+"|"+t.isoVecsABOB[s][o].y):r.push(i+"|"+t.isoVecsABOB[s][o].x+"|"+t.isoVecsABOB[s][o].y);this.face.push([t.vecToidx[r[0]],t.vecToidx[r[1]],t.vecToidx[r[2]]])}}mapOBOAtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s<t.isoVecsOBOA.length;s++){const r=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===1?r.push(e+"|"+t.isoVecsOBOA[s][o].x+"|"+t.isoVecsOBOA[s][o].y):r.push(i+"|"+t.isoVecsOBOA[s][o].x+"|"+t.isoVecsOBOA[s][o].y);this.face.push([t.vecToidx[r[0]],t.vecToidx[r[1]],t.vecToidx[r[2]]])}}mapBAOAtoDATA(e,t){const i=t.IDATA.edgematch[e][2];for(let s=0;s<t.isoVecsBAOA.length;s++){const r=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===1?r.push(e+"|"+t.isoVecsBAOA[s][o].x+"|"+t.isoVecsBAOA[s][o].y):r.push(i+"|"+t.isoVecsBAOA[s][o].x+"|"+t.isoVecsBAOA[s][o].y);this.face.push([t.vecToidx[r[0]],t.vecToidx[r[1]],t.vecToidx[r[2]]])}}orderData(e){const t=[];for(let o=0;o<13;o++)t[o]=[];const i=e.closestTo;for(let o=0;o<i.length;o++)i[o][0]>-1?i[o][1]>0&&t[i[o][0]].push([o,i[o][1]]):t[12].push([o,i[o][0]]);const s=[];for(let o=0;o<12;o++)s[o]=o;let r=12;for(let o=0;o<12;o++){t[o].sort((c,h)=>c[1]-h[1]);for(let c=0;c<t[o].length;c++)s[t[o][c][0]]=r++}for(let o=0;o<t[12].length;o++)s[t[12][o][0]]=r++;for(let o=0;o<this.vertex.length;o++)this.vertex[o].push(s[o]);this.vertex.sort((o,c)=>o[3]-c[3]);for(let o=0;o<this.vertex.length;o++)this.vertex[o].pop();for(let o=0;o<this.face.length;o++)for(let c=0;c<this.face[o].length;c++)this.face[o][c]=s[this.face[o][c]];this.sharedNodes=t[12].length,this.poleNodes=this.vertex.length-this.sharedNodes}setOrder(e,t){const i=[],s=[];let r=t.pop();s.push(r);let o=this.face[r].indexOf(e);o=(o+2)%3;let c=this.face[r][o];i.push(c);let h=0;for(;t.length>0;)r=t[h],this.face[r].indexOf(c)>-1?(o=(this.face[r].indexOf(c)+1)%3,c=this.face[r][o],i.push(c),s.push(r),t.splice(h,1),h=0):h++;return this.adjacentFaces.push(i),s}toGoldbergPolyhedronData(){const e=new Fd("GeoDual","Goldberg",[],[]);e.name="GD dual";const t=this.vertex.length,i=new Array(t);for(let f=0;f<t;f++)i[f]=[];for(let f=0;f<this.face.length;f++)for(let _=0;_<3;_++)i[this.face[f][_]].push(f);let s,r,o,c,h;this.adjacentFaces=[];for(let f=0;f<i.length;f++){e.face[f]=this.setOrder(f,i[f].concat([]));for(const _ of i[f]){s=0,r=0,o=0,c=this.face[_];for(let d=0;d<3;d++)h=this.vertex[c[d]],s+=h[0],r+=h[1],o+=h[2];e.vertex[_]=[s/3,r/3,o/3]}}return e}static BuildGeodesicData(e){const t=new Ch("Geodesic-m-n","Geodesic",[[0,di,-1],[-di,1,0],[-1,0,-di],[1,0,-di],[di,1,0],[0,di,1],[-1,0,di],[-di,-1,0],[0,-di,-1],[di,-1,0],[1,0,di],[0,-di,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;s<e.IDATA.face.length;s++)e.MapToFace(s,t),t.innerToData(s,e),e.IDATA.edgematch[s][1]==="B"&&t.mapABOBtoDATA(s,e),e.IDATA.edgematch[s][1]==="O"&&t.mapOBOAtoDATA(s,e),e.IDATA.edgematch[s][3]==="A"&&t.mapBAOAtoDATA(s,e);t.orderData(e);const i=1;return t.vertex=t.vertex.map(function(s){const r=s[0],o=s[1],c=s[2],h=Math.sqrt(r*r+o*o+c*c);return s[0]*=i/h,s[1]*=i/h,s[2]*=i/h,s}),t}}function uP(a,e,t=null){let i=e.m||1;i!==Math.floor(i)&&(i=Math.floor(i),me.Warn("m not an integer only floor(m) used"));let s=e.n||0;if(s!==Math.floor(s)&&(s=Math.floor(s),me.Warn("n not an integer only floor(n) used")),s>i){const f=s;s=i,i=f,me.Warn("n > m therefore m and n swapped")}const r=new bT;r.build(i,s);const c={custom:Ch.BuildGeodesicData(r),size:e.size,sizeX:e.sizeX,sizeY:e.sizeY,sizeZ:e.sizeZ,faceUV:e.faceUV,faceColors:e.faceColors,flat:e.flat,updatable:e.updatable,sideOrientation:e.sideOrientation,frontUVs:e.frontUVs,backUVs:e.backUVs};return l_(a,c,t)}class c_ extends K{constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return t===void 0?(e>this.goldbergData.nbUnsharedFaces-1&&(me.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(me.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(me.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let i=0;i<e.length;i++){const s=e[i][0],r=e[i][1],o=e[i][2];for(let c=s;c<r+1;c++)this.goldbergData.faceColors[c]=o}const t=[];for(let i=0;i<12;i++)for(let s=0;s<5;s++)t.push(this.goldbergData.faceColors[i].r,this.goldbergData.faceColors[i].g,this.goldbergData.faceColors[i].b,this.goldbergData.faceColors[i].a);for(let i=12;i<this.goldbergData.faceColors.length;i++)for(let s=0;s<6;s++)t.push(this.goldbergData.faceColors[i].r,this.goldbergData.faceColors[i].g,this.goldbergData.faceColors[i].b,this.goldbergData.faceColors[i].a);return t}setGoldbergFaceColors(e){const t=this._changeGoldbergFaceColors(e);this.setVerticesData(F.ColorKind,t)}updateGoldbergFaceColors(e){const t=this._changeGoldbergFaceColors(e);this.updateVerticesData(F.ColorKind,t)}_changeGoldbergFaceUVs(e){const t=this.getVerticesData(F.UVKind);for(let i=0;i<e.length;i++){const s=e[i][0],r=e[i][1],o=e[i][2],c=e[i][3],h=e[i][4],f=[],_=[];let d,g;for(let p=0;p<5;p++)d=o.x+c*Math.cos(h+p*Math.PI/2.5),g=o.y+c*Math.sin(h+p*Math.PI/2.5),d<0&&(d=0),d>1&&(d=1),f.push(d,g);for(let p=0;p<6;p++)d=o.x+c*Math.cos(h+p*Math.PI/3),g=o.y+c*Math.sin(h+p*Math.PI/3),d<0&&(d=0),d>1&&(d=1),_.push(d,g);for(let p=s;p<Math.min(12,r+1);p++)for(let x=0;x<5;x++)t[10*p+2*x]=f[2*x],t[10*p+2*x+1]=f[2*x+1];for(let p=Math.max(12,s);p<r+1;p++)for(let x=0;x<6;x++)t[12*p-24+2*x]=_[2*x],t[12*p-23+2*x]=_[2*x+1]}return t}setGoldbergFaceUVs(e){const t=this._changeGoldbergFaceUVs(e);this.setVerticesData(F.UVKind,t)}updateGoldbergFaceUVs(e){const t=this._changeGoldbergFaceUVs(e);this.updateVerticesData(F.UVKind,t)}placeOnGoldbergFaceAt(e,t,i){const s=E.RotationFromAxis(this.goldbergData.faceXaxis[t],this.goldbergData.faceYaxis[t],this.goldbergData.faceZaxis[t]);e.rotation=s,e.position=this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(i.x)).add(this.goldbergData.faceYaxis[t].scale(i.y)).add(this.goldbergData.faceZaxis[t].scale(i.z))}serialize(e){super.serialize(e),e.type="GoldbergMesh";const t={};if(t.adjacentFaces=this.goldbergData.adjacentFaces,t.nbSharedFaces=this.goldbergData.nbSharedFaces,t.nbUnsharedFaces=this.goldbergData.nbUnsharedFaces,t.nbFaces=this.goldbergData.nbFaces,t.nbFacesAtPole=this.goldbergData.nbFacesAtPole,this.goldbergData.faceColors){t.faceColors=[];for(const i of this.goldbergData.faceColors)t.faceColors.push(i.asArray())}if(this.goldbergData.faceCenters){t.faceCenters=[];for(const i of this.goldbergData.faceCenters)t.faceCenters.push(i.asArray())}if(this.goldbergData.faceZaxis){t.faceZaxis=[];for(const i of this.goldbergData.faceZaxis)t.faceZaxis.push(i.asArray())}if(this.goldbergData.faceYaxis){t.faceYaxis=[];for(const i of this.goldbergData.faceYaxis)t.faceYaxis.push(i.asArray())}if(this.goldbergData.faceXaxis){t.faceXaxis=[];for(const i of this.goldbergData.faceXaxis)t.faceXaxis.push(i.asArray())}e.goldbergData=t}static Parse(e,t){const i=e.goldbergData;i.faceColors=i.faceColors.map(r=>dt.FromArray(r)),i.faceCenters=i.faceCenters.map(r=>E.FromArray(r)),i.faceZaxis=i.faceZaxis.map(r=>E.FromArray(r)),i.faceXaxis=i.faceXaxis.map(r=>E.FromArray(r)),i.faceYaxis=i.faceYaxis.map(r=>E.FromArray(r));
162const s=new c_(e.name,t);return s.goldbergData=i,s}}function fP(a,e){const t=a.size,i=a.sizeX||t||1,s=a.sizeY||t||1,r=a.sizeZ||t||1,o=a.sideOrientation===0?0:a.sideOrientation||Be.DEFAULTSIDE,c=[],h=[],f=[],_=[];let d=1/0,g=-1/0,p=1/0,x=-1/0;for(let R=0;R<e.vertex.length;R++)d=Math.min(d,e.vertex[R][0]*i),g=Math.max(g,e.vertex[R][0]*i),p=Math.min(p,e.vertex[R][1]*s),x=Math.max(x,e.vertex[R][1]*s);let b=0;for(let R=0;R<e.face.length;R++){const S=e.face[R],M=E.FromArray(e.vertex[S[0]]),I=E.FromArray(e.vertex[S[2]]),A=E.FromArray(e.vertex[S[1]]),D=I.subtract(M),C=A.subtract(M),k=E.Cross(C,D).normalize();for(let H=0;H<S.length;H++){f.push(k.x,k.y,k.z);const L=e.vertex[S[H]];c.push(L[0]*i,L[1]*s,L[2]*r);const J=(L[1]*s-p)/(x-p);_.push((L[0]*i-d)/(g-d),J)}for(let H=0;H<S.length-2;H++)h.push(b,b+H+2,b+H+1);b+=S.length}Be._ComputeSides(o,c,h,f,_);const T=new Be;return T.positions=c,T.indices=h,T.normals=f,T.uvs=_,T}function dP(a,e,t=null){const i=e.size,s=e.sizeX||i||1,r=e.sizeY||i||1,o=e.sizeZ||i||1;let c=e.m||1;c!==Math.floor(c)&&(c=Math.floor(c),me.Warn("m not an integer only floor(m) used"));let h=e.n||0;if(h!==Math.floor(h)&&(h=Math.floor(h),me.Warn("n not an integer only floor(n) used")),h>c){const x=h;h=c,c=x,me.Warn("n > m therefore m and n swapped")}const f=new bT;f.build(c,h);const _=Ch.BuildGeodesicData(f),d=_.toGoldbergPolyhedronData(),g=new c_(a,t);e.sideOrientation=K._GetDefaultSideOrientation(e.sideOrientation),g._originalBuilderSideOrientation=e.sideOrientation,fP(e,d).applyToMesh(g,e.updatable),g.goldbergData.nbSharedFaces=_.sharedNodes,g.goldbergData.nbUnsharedFaces=_.poleNodes,g.goldbergData.adjacentFaces=_.adjacentFaces,g.goldbergData.nbFaces=g.goldbergData.nbSharedFaces+g.goldbergData.nbUnsharedFaces,g.goldbergData.nbFacesAtPole=(g.goldbergData.nbUnsharedFaces-12)/12;for(let x=0;x<_.vertex.length;x++)g.goldbergData.faceCenters.push(E.FromArray(_.vertex[x])),g.goldbergData.faceCenters[x].x*=s,g.goldbergData.faceCenters[x].y*=r,g.goldbergData.faceCenters[x].z*=o,g.goldbergData.faceColors.push(new dt(1,1,1,1));for(let x=0;x<d.face.length;x++){const b=d.face[x],T=E.FromArray(d.vertex[b[0]]),R=E.FromArray(d.vertex[b[2]]),S=E.FromArray(d.vertex[b[1]]),M=R.subtract(T),I=S.subtract(T),A=E.Cross(I,M).normalize(),D=E.Cross(I,A).normalize();g.goldbergData.faceXaxis.push(I.normalize()),g.goldbergData.faceYaxis.push(A),g.goldbergData.faceZaxis.push(D)}return g}class _P{constructor(e){this._paths=[],this._tempPaths=[],this._holes=[],this._resolution=e}moveTo(e,t){this._currentPath=new Th(e,t),this._tempPaths.push(this._currentPath)}lineTo(e,t){this._currentPath.addLineTo(e,t)}quadraticCurveTo(e,t,i,s){this._currentPath.addQuadraticCurveTo(e,t,i,s,this._resolution)}bezierCurveTo(e,t,i,s,r,o){this._currentPath.addBezierCurveTo(e,t,i,s,r,o,this._resolution)}extractHoles(){for(const e of this._tempPaths)e.area()>0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){const e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}function mP(a,e,t,i,s,r){const o=r.glyphs[a]||r.glyphs["?"];if(!o)return null;const c=new _P(s);if(o.o){const h=o.o.split(" ");for(let f=0,_=h.length;f<_;)switch(h[f++]){case"m":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i;c.moveTo(g,p);break}case"l":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i;c.lineTo(g,p);break}case"q":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i,x=parseInt(h[f++])*e+t,b=parseInt(h[f++])*e+i;c.quadraticCurveTo(x,b,g,p);break}case"b":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i,x=parseInt(h[f++])*e+t,b=parseInt(h[f++])*e+i,T=parseInt(h[f++])*e+t,R=parseInt(h[f++])*e+i;c.bezierCurveTo(x,b,T,R,g,p);break}}}return c.extractHoles(),{offsetX:o.ha*e,shapePath:c}}function gP(a,e,t,i){const s=Array.from(a),r=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,c=[];let h=0,f=0;for(let _=0;_<s.length;_++){const d=s[_];if(d===`
163`)h=0,f-=o;else{const g=mP(d,r,h,f,t,i);g&&(h+=g.offsetX,c.push(g.shapePath))}}return c}function pP(a,e,t,i={size:50,resolution:8,depth:1},s=null,r=earcut){const o=gP(e,i.size||50,i.resolution||8,t),c=[];let h=0;for(const _ of o){if(!_.paths.length)continue;const d=_.holes.slice();for(const g of _.paths){const p=[],x=[],b=g.getPoints();for(const S of b)x.push(new E(S.x,0,S.y));const T=d.slice();for(const S of T){const M=S.getPoints();let I=!1;for(const D of M)if(g.isPointInside(D)){I=!0;break}if(!I)continue;const A=[];for(const D of M)A.push(new E(D.x,0,D.y));p.push(A),d.splice(d.indexOf(S),1)}if(!p.length&&d.length)for(const S of d){const M=S.getPoints(),I=[];for(const A of M)I.push(new E(A.x,0,A.y));p.push(I)}const R=o_(a,{shape:x,holes:p.length?p:void 0,depth:i.depth||1,faceUV:i.faceUV||i.perLetterFaceUV?.(h),faceColors:i.faceColors||i.perLetterFaceColors?.(h),sideOrientation:K._GetDefaultSideOrientation(i.sideOrientation||K.DOUBLESIDE)},s,r);c.push(R),h++}}const f=K.MergeMeshes(c,!0,!0);if(f){const _=f.getBoundingInfo().boundingBox;f.position.x+=-(_.minimumWorld.x+_.maximumWorld.x)/2,f.position.y+=-(_.minimumWorld.y+_.maximumWorld.y)/2,f.position.z+=-(_.minimumWorld.z+_.maximumWorld.z)/2+_.extendSize.z,f.name=a;const d=new qi("pivot",s);d.rotation.x=-Math.PI/2,f.parent=d,f.bakeCurrentTransformIntoVertices(),f.parent=null,d.dispose()}return f}const Nx={CreateBox:N1,CreateTiledBox:Rw,CreateSphere:H1,CreateDisc:w1,CreateIcoSphere:mT,CreateRibbon:ta,CreateCylinder:Y1,CreateTorus:Z1,CreateTorusKnot:$1,
163CreateLineSystem:iT,CreateLines:sT,CreateDashedLines:nT,ExtrudeShape:aT,ExtrudeShapeCustom:oT,CreateLathe:cT,CreateTiledPlane:Tw,CreatePlane:uT,CreateGround:B1,CreateTiledGround:L1,CreateGroundFromHeightMap:U1,CreatePolygon:a_,ExtrudePolygon:o_,CreateTube:fT,CreatePolyhedron:l_,CreateGeodesic:uP,CreateGoldberg:dP,CreateDecal:gT,CreateCapsule:yT,CreateText:pP};yw();bw();vw();Aw();Mw();Nw();zw();Vw();jw();Zw();Qw();$w();Jw();z1();xw();eP();tP();iP();cP();hP();kw();async function yP(a,e){const t=new Me(a);t.clearColor=new dt(.025,.028,.027,0),new x1("archive-camera",new E(0,0,-10),t).setTarget(E.Zero());const s=[new E(-7,-3.8,0),new E(-4.9,-2.2,0),new E(-2.2,-2.8,0),new E(.6,-.5,0),new E(3.8,-1.1,0),new E(7,3.6,0)],r=Nx.CreateLines("timeline-ribbon",{points:s,updatable:!1},t);r.color=new lt(.82,.16,.12),r.alpha=.21,[[-7.5,-2.7,6.5,-2.7],[-7.5,.8,6.6,.8],[-5.2,-4.2,-5.2,4.2],[3.4,-4.2,3.4,4.2]].forEach(([f,_,d,g],p)=>{const x=Nx.CreateLines(`rule-${p}`,{points:[new E(f,_,0),new E(d,g,0)]},t);x.color=new lt(.4,.47,.49),x.alpha=.08});let c=0;const h=t.onBeforeRenderObservable.add(()=>{c+=t.getEngine().getDeltaTime()/1e3,r.position.y=Math.sin(c*.22)*.16});return{scene:t,dispose:()=>{t.onBeforeRenderObservable.remove(h),t.dispose()}}}function bP(){const a=Te.useRef(null),e=Te.useRef(!1);return Te.useEffect(()=>{const t=a.current;if(!t||e.current)return;e.current=!0;const i=new De(t,!0,{preserveDrawingBuffer:!1,stencil:!1});let s=!1,r=()=>{};yP(i).then(c=>{if(s){c.dispose();return}r=c.dispose,i.runRenderLoop(()=>c.scene.render())});const o=()=>i.resize();return window.addEventListener("resize",o),()=>{s=!0,window.removeEventListener("resize",o),i.stopRenderLoop(),r(),i.dispose(),e.current=!1}},[]),ne.jsx("canvas",{"data-loc":"client/src/components/GameCanvas.tsx:44",ref:a,"aria-hidden":"true",className:"archive-canvas"})}const Bd={revolucionario:0,conservador:0,expansionista:0,vitima:0,dominancia:0},Yr={revolucionario:{label:"Revolucionário",short:"REV",tone:"red"},conservador:{label:"Conservador",short:"CON",tone:"paper"},expansionista:{label:"Expansionista",short:"EXP",tone:"blue"},vitima:{label:"Vítima",short:"VIT",tone:"grey"},dominancia:{label:"Dominância",short:"DOM",tone:"gold"}},Xc=[{id:1,number:"I",title:"A Era das Revoluções",years:"1789–1848",short:"Revoluções"},{id:2,number:"II",title:"A Era do Capital",years:"1848–1875",short:"Capital"},{id:3,number:"III",title:"A Era dos Impérios",years:"1875–1914",short:"Impérios"},{id:4,number:"IV",title:"A Era dos Extremos",years:"1914–1991",short:"Extremos"}],el=[{id:1,era:1,year:"1789",place:"Paris, França",prompt:"A ordem do Antigo Regime vacila. Diante da multidão e dos cadern
163os de queixas, qual papel você escolhe assumir?",context:"A Revolução Francesa abre uma crise política que ecoará muito além de Paris.",choices:[{label:"Organizar uma seção popular",detail:"Transformar queixas dispersas em ação coletiva.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:1,dominancia:1},chronicle:"Em Paris, você ajudou a transformar a queixa popular em organização."},{label:"Defender uma constituição limitada",detail:"Trocar o absolutismo por direitos, propriedade e lei.",effects:{revolucionario:1,conservador:2,expansionista:0,vitima:0,dominancia:2},chronicle:"Você apostou numa constituição para conter tanto o rei quanto a rua."},{label:"Seguir as vozes do campo",detail:"Priorizar pão, terra e sobrevivência sobre os discursos da capital.",effects:{revolucionario:2,conservador:0,expansionista:0,vitima:3,dominancia:0},chronicle:"Você fez da fome e da terra a medida concreta da revolução."}]},{id:2,era:1,year:"1817",place:"Manchester, Grã-Bretanha",prompt:"As fábricas multiplicam riqueza e miséria. Um proprietário reduz salários após uma crise: como você reage?",context:"A industrialização britânica reorganiza trabalho, cidade e relações de classe.",choices:[{label:"Criar uma associação de trabalhadores",detail:"Unir ofícios para negociar e resistir à disciplina fabril.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:2,dominancia:0},chronicle:"Em Manchester, você converteu a oficina em espaço de solidariedade."},{label:"Pedir reforma gradual",detail:"Defender regras de segurança sem romper a ordem industrial.",effects:{revolucionario:1,conservador:2,expansionista:0,vitima:1,dominancia:1},chronicle:"Você exigiu limites para a fábrica, mas preservou sua estrutura."},{label:"Aceitar a competição por trabalho",detail:"Buscar promoção individual mesmo quando outros ficam para trás.",effects:{revolucionario:0,conservador:1,expansionista:1,vitima:1,dominancia:3},chronicle:"Você procurou poder individual dentro da nova disciplina industrial."}]},{id:3,era:1,year:"1848",place:"Viena, Império Austríaco",prompt:"Barricadas atravessam a Europa. A notícia de uma insurreição chega à sua cidade: qual futuro você sustenta?",context:"As revoluções de 1848 combinam demandas liberais, nacionais e sociais, mas enfrentam forte reação.",choices:[{label:"Erguer uma barricada",detail:"Apoiar soberania popular e medidas sociais imediatas.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:2,dominancia:1},chronicle:"Em 1848, você escolheu a barricada como linguagem política."},{label:"Negociar uma monarquia constitucional",detail:"Aceitar reformas para evitar uma ruptura mais profunda.",effects:{revolucionario:1,conservador:3,expansionista:0,vitima:0,dominancia:1},chronicle:"Você negociou direitos limitados em vez de uma ruptura total."},{label:"Proteger a administração imperial",detail:"Restabelecer a ordem e conter a agitação em nome da estabilidade.",effects:{revolucionario:0,conservador:2,expansionista:1,vitima:0,dominancia:3},chronicle:"Você trabalhou para que o império sobrevivesse às ruas."}]},{id:4,era:2,year:"1851",place:"Londres, Grã-Bretanha",prompt:"A Exposição Universal celebra máquinas e mercadorias. O que sua passagem por ela revela sobre o futuro?",context:"A expansão industrial e comercial apresenta o capitalismo como horizonte de modernidade.",choices:[{label:"Investigar as mãos invisíveis da produção",detail:"Perguntar quem fabrica, quem lucra e quem permanece sem voz.",effects:{revolucionario:2,conservador:0,expansionista:0,vitima:2,dominancia:0},chronicle:"Na vitrine do progresso, você procurou as mãos que a exposição escondia."},{label:"Celebrar a técnica e o livre comércio",detail:"Acreditar que circulação de mercadorias é sinônimo de avanço geral.",effects:{revolucionario:0,conservador:1,expansionista:3,vitima:0,dominancia:2},chronicle:"Você viu no comércio mundial uma promessa de expansão e comando."},{label:"Valorizar a ordem doméstica",detail:"Defender hierarquias familiares e sociais contra a velocidade da cidade.",effects:{revolucionario:0,conservador:3,expansionista:0,vitima:1,dominancia:1},chronicle:"Você procurou abrigo nas hierarquias que a cidade industrial abalava."}]},{id:5,era:2,year:"1864",place:"Londres, Associação Internacional dos Trabalhadores",prompt:"Delegados discutem como atravessar fronteiras sem apagar diferenças locais. Qual princípio guia sua intervenção?",context:"A organização internacional do trabalho tenta responder a um c
163apitalismo cada vez mais conectado.",choices:[{label:"Solidariedade entre trabalhadores",detail:"Construir alianças sem entregar as decisões a uma única direção.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:1,dominancia:0},chronicle:"Você defendeu que a solidariedade cruzasse fronteiras sem apagar vozes locais."},{label:"Disciplina por um centro forte",detail:"Unificar a estratégia sob uma liderança capaz de vencer.",effects:{revolucionario:2,conservador:0,expansionista:1,vitima:0,dominancia:3},chronicle:"Você preferiu uma estratégia centralizada para dar força ao movimento."},{label:"Cooperação limitada entre nações",detail:"Apoiar reformas, mantendo deveres e lealdades nacionais como prioridade.",effects:{revolucionario:0,conservador:2,expansionista:1,vitima:0,dominancia:1},chronicle:"Você aceitou a cooperação, desde que a nação permanecesse acima dela."}]},{id:6,era:2,year:"1871",place:"Paris, França",prompt:"Após guerra e cerco, Paris experimenta uma comuna. Você precisa decidir como defender a cidade e seu experimento político.",context:"A Comuna de Paris se torna uma referência decisiva para debates sobre república, classe e poder popular.",choices:[{label:"Ampliar clubes e delegados revogáveis",detail:"Fazer do autogoverno a própria defesa da cidade.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:2,dominancia:0},chronicle:"Você apostou em delegados revogáveis e assembleias para sustentar a Comuna."},{label:"Concentrar o comando militar",detail:"Priorizar defesa eficiente, mesmo com menos deliberação pública.",effects:{revolucionario:1,conservador:1,expansionista:0,vitima:1,dominancia:3},chronicle:"Você concentrou o comando para tentar salvar a cidade sitiada."},{label:"Buscar conciliação com Versalhes",detail:"Evitar um desfecho sangrento mediante concessões políticas.",effects:{revolucionario:0,conservador:3,expansionista:0,vitima:1,dominancia:1},chronicle:"Você procurou uma saída negociada antes que a violência fechasse o cerco."}]},{id:7,era:3,year:"1884",place:"Berlim, Conferência sobre a África",prompt:"Potências europeias discutem territórios africanos sem representantes africanos à mesa. O que você faz diante desse mapa?",context:"A corrida imperialista combina diplomacia, comércio, violência e administração colonial.",choices:[{label:"Denunciar a partilha e apoiar resistências",detail:"Recusar que povos e territórios sejam tratados como mercadoria diplomática.",effects:{revolucionario:2,conservador:0,expansionista:0,vitima:3,dominancia:0},chronicle:"Você recusou que um mapa europeu decidisse a vida de povos africanos."},{label:"Defender zonas de influência comercial",detail:"Organizar mercados e rotas em nome de eficiência e acesso.",effects:{revolucionario:0,conservador:1,expansionista:3,vitima:1,dominancia:2},chronicle:"Você tratou a partilha como um cálculo de mercados, rotas e vantagens."},{label:"Administrar uma colônia com paternalismo",detail:"Prometer ordem e obras, preservando o controle externo.",effects:{revolucionario:0,conservador:2,expansionista:2,vitima:1,dominancia:3},chronicle:"Você revestiu a dominação colonial de ordem, obras e tutela."}]},{id:8,era:3,year:"1905",place:"São Petersburgo, Império Russo",prompt:"Uma marcha de trabalhadores é reprimida e a confiança no czar racha. Onde você coloca sua energia?",context:"A Revolução de 1905 expõe as tensões sociais e políticas do Império Russo antes de 1917.",choices:[{label:"Formar um soviete",detail:"Criar coordenação coletiva entre trabalhadores, bairros e grevistas.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:2,dominancia:0},chronicle:"Após a repressão, você ajudou a transformar a greve em conselho coletivo."},{label:"Exigir uma Duma com poderes limitados",detail:"Converter a crise em reforma parlamentar sob a coroa.",effects:{revolucionario:1,conservador:3,expansionista:0,vitima:1,dominancia:1},chronicle:"Você buscou limitar o czarismo por uma representação cuidadosamente contida."},{label:"Restaurar a autoridade imperial",detail:"Usar censura e força para impedir que a crise se espalhe.",effects:{revolucionario:0,conservador:2,expansionista:1,vitima:0,dominancia:3}
163,chronicle:"Você escolheu a força imperial para impedir que a crise ganhasse o país."}]},{id:9,era:3,year:"1913",place:"Dacar, África Ocidental Francesa",prompt:"Ferrovias e impostos redesenham a região. Uma comunidade pede ajuda para responder ao poder colonial: qual caminho você propõe?",context:"Infraestrutura colonial integra territórios ao mercado imperial, frequentemente por meio de extração e coerção.",choices:[{label:"Organizar petição e boicote",detail:"Unir vilas para enfrentar impostos e trabalho forçado.",effects:{revolucionario:2,conservador:0,expansionista:0,vitima:3,dominancia:0},chronicle:"Você transformou a ferrovia colonial em motivo de organização e recusa."},{label:"Negociar cargos locais",detail:"Obter proteção parcial aceitando participar da administração.",effects:{revolucionario:0,conservador:2,expansionista:1,vitima:1,dominancia:2},chronicle:"Você procurou margem de manobra dentro de uma administração que não escolheu."},{label:"Acelerar a exportação",detail:"Apostar que a integração ao império trará ganhos para os mais adaptáveis.",effects:{revolucionario:0,conservador:1,expansionista:3,vitima:1,dominancia:2},chronicle:"Você apostou na exportação, mesmo quando ela aprofundava dependências."}]},{id:10,era:4,year:"1914",place:"Europa em guerra",prompt:"A mobilização geral transforma vizinhos em inimigos. O apelo da pátria chega a todos: como você responde?",context:"A Primeira Guerra Mundial inaugura a catástrofe que Hobsbawm situa no início do “breve século XX”.",choices:[{label:"Defender a paz entre povos",detail:"Manter vínculos internacionais mesmo sob pressão nacionalista.",effects:{revolucionario:2,conservador:0,expansionista:0,vitima:2,dominancia:0},chronicle:"Em 1914, você recusou que a pátria transformasse solidariedade em inimizade."},{label:"Alistar-se para defender a nação",detail:"Aceitar o sacrifício como dever diante da guerra.",effects:{revolucionario:0,conservador:2,expansionista:1,vitima:2,dominancia:1},chronicle:"Você aceitou o chamado nacional, carregando consigo o custo da guerra."},{label:"Planejar ganhos territoriais",detail:"Tratar a guerra como chance de reposicionar seu Estado no mundo.",effects:{revolucionario:0,conservador:1,expansionista:3,vitima:0,dominancia:3},chronicle:"Você enxergou na guerra a chance de ampliar território e influência."}]},{id:11,era:4,year:"1933",place:"Berlim, Alemanha",prompt:"Crise, desemprego e violência política pressionam a sociedade. Como você reage quando direitos e liberdades são colocados em risco?",context:"A crise do entre-guerras abre caminho para autoritarismos, perseguições e resistências em escala continental.",choices:[{label:"Construir uma frente antifascista",detail:"Aproximar grupos diferentes para defender liberdades e trabalhadores.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:2,dominancia:0},chronicle:"Diante do fascismo, você procurou construir uma frente de defesa coletiva."}
163,{label:"Recolher-se e preservar a família",detail:"Evitar exposição pública diante de ameaças crescentes.",effects:{revolucionario:0,conservador:2,expansionista:0,vitima:3,dominancia:0},chronicle:"Você buscou sobreviver em silêncio quando a esfera pública se fechava."},{label:"Apoiar a ordem autoritária",detail:"Aceitar a suspensão de direitos em troca de promessa de estabilidade.",effects:{revolucionario:0,conservador:2,expansionista:1,vitima:0,dominancia:3},chronicle:"Você trocou direitos pela promessa de ordem e controle."}]},{id:12,era:4,year:"1989",place:"Berlim, mundo em transição",prompt:"Muros caem e certezas do século se desfazem. Ao fechar a crônica, que pergunta você deixa aberta?",context:"O fim da Guerra Fria não encerra os conflitos sobre desigualdade, poder, nacionalismo e memória.",choices:[{label:"Como tornar a igualdade uma prática?",detail:"Reabrir a questão social sem ignorar os limites das experiências passadas.",effects:{revolucionario:3,conservador:0,expansionista:0,vitima:1,dominancia:0},chronicle:"Ao fim do século, você deixou aberta a tarefa de reinventar a igualdade."},{label:"Como preservar instituições comuns?",detail:"Procurar garantias, direitos e regras para uma transição incerta.",effects:{revolucionario:0,conservador:3,expansionista:0,vitima:1,dominancia:1},chronicle:"Você terminou o percurso defendendo instituições comuns diante da incerteza."},{label:"Quem controlará a nova ordem global?",detail:"Observar mercados e blocos de poder em busca de novas posições de força.",effects:{revolucionario:0,conservador:1,expansionista:3,vitima:0,dominancia:3},chronicle:"Você fechou a crônica perguntando quem dominaria a próxima ordem global."}]}],xP={1:{context:"Em 1789, a crise fiscal da monarquia francesa se combinou com a carestia e com reivindicações políticas. As seções parisienses e outros espaços locais ajudaram a transformar petições e queixas em participação política, enquanto diferentes grupos disputavam o significado de “nação” e de “direitos”.",hobsbawmLens:"Para Hobsbawm, a Revolução Francesa é uma das faces da “dupla revolução”: ela rompe o Antigo Regime ao mesmo tempo que abre caminho para novas relações de propriedade e cidadania.",choiceNotes:["Organizar uma seção popular destaca a ação coletiva urbana: pessoas antes afastadas do governo passaram a pressionar diretamente as decisões políticas.","Uma constituição limitada expressa o projeto liberal de restringir o absolutismo, preservando, porém, a propriedade e uma participação política mais controlada.","Dar prioridade ao campo lembra que a revolução não se resumia aos discursos de Paris: pão, impostos e acesso à terra moldavam a experiência de milhões de camponeses."]},2:{context:"A industrialização britânica concentrou trabalhadores em cidades e fábricas, submetendo ritmos de vida a jornadas longas, salários instáveis e regras impostas pelos proprietários. A criação de associações e sindicatos respondeu a esse novo desequilíbrio entre quem possuía os meios de produção e quem dependia de vender sua força de trabalho.",hobsbawmLens:"Hobsbawm relaciona a industrialização à formação de novas classes e identidades políticas; não é apenas uma mudança técnica, mas uma reorganização da vida social.",choiceNotes:["Uma associação de trabalhadores desloca a negociação do indivíduo isolado para a ação coletiva, uma das bases do movimento operário moderno.","A reforma gradual procura reduzir riscos e abusos sem contestar a propriedade privada da fábrica, posição frequente em correntes liberais reformistas.","A competição individual reconhece a possibilidade de ascensão para poucos, mas evidencia como a disciplina fabril também separava trabalhadores entre vencedores e perdedores."]},3:{context:"As revoluções de 1848 se espalharam de forma incomum por cidades europeias, reunindo liberais, republicanos, nacionalistas, trabalhadores e socialistas. Suas reivindicações nem sempre coincidiam: alguns queriam constituições; outros, direitos sociais ou autonomia nacional; e a contrarrevolução recuperou espaço em muitos lugares.",hobsbawmLens:"Essa simultaneidade e diversidade mostram por que Hobsbawm trata 1848 como um ponto de inflexão entre revoluções liberais e demandas sociais de classe mais explícitas.",choiceNotes:["Erguer uma barricada representa a tentativa de usar o espaço urbano e a mobilização popular para impor mudanças imediatas, apesar do risco de repressão.","A monarquia constitucional procura conciliar direitos e continuidade institucional, aceitando que a mudança política tenha limites definidos por elites e parlamentos.","Proteger a administração imperial expressa a lógica da restauração: governos podem ceder primeiro e depois recuperar controle usando burocracia, exército e alianças sociais."]},4:{context:"A Exposição Universal de Londres, em 1851, apresentou máquinas e mercadorias como símbolos de progresso. Essa vitrine, porém, escondia as relações de trabalho, extração de matérias-primas e impérios comerciais que sustentavam a produção em larga escala.",hobsbawmLens:"Na Era do Capital, Hobsbawm chama atenção para a confiança burguesa no crescimento, mas também para os contrastes sociais que esse crescimento produziu.",choiceNotes:["Investigar a produção aproxima o olhar da história social: cada mercadoria depen
163de de trabalhadores, recursos e relações de poder que uma exposição tende a deixar invisíveis.","Celebrar técnica e livre comércio capta o entusiasmo de setores que viam a expansão dos mercados como sinal de civilização e modernidade.","Valorizar a ordem doméstica revela uma reação cultural à cidade industrial, quando transformações no trabalho e na família pareciam ameaçar hierarquias antigas."]},5:{context:"A Associação Internacional dos Trabalhadores, criada em Londres em 1864, tentou articular organizações operárias de diferentes países. Seus debates incluíam greve, organização política, autonomia local e centralização, revelando que “internacionalismo” não eliminava divergências estratégicas.",hobsbawmLens:"A escala internacional do capitalismo levava movimentos de trabalhadores a pensar além da nação, um tema decisivo na história social do século XIX.",choiceNotes:["A solidariedade entre trabalhadores ressalta que salários e condições de trabalho podiam ser usados para colocar grupos nacionais uns contra os outros.","A disciplina de um centro forte privilegia coordenação e rapidez; historicamente, ela também abre o debate sobre representação, autonomia e concentração de poder.","Uma cooperação limitada preserva o peso dos Estados nacionais, lembrando que identidades e interesses nacionais continuaram fortes mesmo entre reformadores sociais."]},6:{context:"A Comuna de Paris nasceu em 1871, após derrota francesa na guerra contra a Prússia e meses de cerco. Durante poucas semanas, parisienses experimentaram formas de governo municipal e popular antes de uma repressão violenta pelas forças de Versalhes.",hobsbawmLens:"Para muitas correntes socialistas, a Comuna se tornou um laboratório histórico: ela colocava, de forma concreta, a pergunta sobre como trabalhadores poderiam exercer poder político.",choiceNotes:["Clubes e delegados revogáveis apontam para uma ideia de democracia direta e controle permanente sobre representantes, central na memória política da Comuna.","Concentrar o comando militar mostra o dilema entre participação ampla e sobrevivência diante de uma guerra; eficiência e democracia podem entrar em tensão.","Buscar conciliação evidencia que revoluções não ocorrem fora de correlações de força: negociar pode salvar vidas, mas também pode limitar ou desmontar o experimento político."]},7:{context:"A Conferência de Berlim de 1884–1885 formalizou regras entre potências europeias para a ocupação colonial na África, sem representação dos povos africanos. A partilha não foi apenas diplomática: envolveu violência, extração, trabalho coercitivo e resistências em múltiplas regiões.",hobsbawmLens:"A Era dos Impérios conecta capital, tecnologia, Estado e poder militar; a expansão europeia precisa ser lida também a partir dos custos impostos às sociedades colonizadas.",choiceNotes:["Denunciar a partilha e apoiar resistências devolve agência aos povos colonizados, que não foram espectadores passivos da expansão imperial.","Defender zonas de influência comercial reproduz a linguagem de mercados e rotas usada para justificar uma dominação que tinha consequências sociais e territoriais profundas.","O paternalismo administrativo promete “ordem” ou “progresso”, mas mantém decisões fundamentais sob controle externo e transforma desigualdade política em tutela."]},8:{context:"A Revolução Russa de 1905 foi desencadeada por tensões sociais, derrota na guerra contra o Japão e repressão a uma manifestação em São Petersburgo. Greves, conselhos de trabalhadores e reivindicações de reforma pressionaram o czarismo, que concedeu uma Duma, mas preservou grande parte de seu poder.",hobsbawmLens:"1905 antecipa questões que voltariam em 1917: organização de massas, limites da reforma, repressão estatal e disputa sobre quem pode representar a sociedade.",choiceNotes:["Formar um soviete enfatiza a criação de instituições nascidas da luta social, capazes de coordenar trabalhadores sem depender inicialmente da estrutura estatal existente.","Exigir uma Duma limitada expressa uma aposta constitucional: pressionar por representação sem abolir a coroa, num cenário em que concessões podiam ser revertidas.","Restaurar a autoridade imperial mostra como regimes ameaçados mobilizam censura, polícia e exército para reconstituir uma ordem hierárquica."]}
163,9:{context:"No império colonial francês, ferrovias, impostos e novas regras administrativas conectavam territórios africanos aos circuitos de exportação. Embora fossem apresentadas como infraestrutura e modernização, essas medidas frequentemente reorganizavam terras, trabalho e circulação de riquezas em favor do poder colonial.",hobsbawmLens:"Uma leitura social do império pergunta quem define a infraestrutura, quem recebe seus benefícios e quem arca com seus custos — não trata ferrovias como objetos neutros.",choiceNotes:["Petição e boicote mostram formas de resistência que combinavam organização local e enfrentamento de políticas coloniais sem depender necessariamente de uma guerra aberta.","Negociar cargos locais pode abrir proteção parcial ou espaço de mediação, mas também revela a assimetria de uma administração cujas regras vinham de fora.","Acelerar a exportação assume a lógica imperial de integrar regiões ao mercado mundial, ainda que a riqueza gerada não seja controlada por quem produz localmente."]},10:{context:"A Primeira Guerra Mundial transformou rivalidades entre Estados, impérios e alianças numa guerra de escala inédita. A mobilização de soldados e economias tornou a experiência nacional muito poderosa, mas também gerou perseguições, luto em massa e movimentos contrários ao conflito.",hobsbawmLens:"Hobsbawm inicia o “breve século XX” em 1914 porque a guerra destrói a confiança no progresso contínuo e inaugura décadas de catástrofes, revoluções e crises.",choiceNotes:["Defender a paz entre povos retoma o internacionalismo que resistia à ideia de que trabalhadores deveriam matar trabalhadores em nome de rivalidades estatais.","Alistar-se para defender a nação ajuda a compreender a força do patriotismo e do dever, sem apagar que essa decisão era atravessada por pressão social e desigualdades.","Planejar ganhos territoriais explicita a dimensão expansionista da guerra: fronteiras, colônias e influência eram objetivos de elites políticas e militares."]},11:{context:"A crise econômica, o desemprego e a polarização política do entre-guerras favoreceram a ascensão de regimes fascistas. Na Alemanha, a destruição de direitos, a perseguição a opositores e o racismo de Estado não foram efeitos secundários: constituíram elementos centrais do novo poder.",hobsbawmLens:"A Era dos Extremos exige observar como crises sociais podem abrir espaço para soluções autoritárias que prometem ordem enquanto eliminam pluralismo e perseguem grupos inteiros.",choiceNotes:["Uma frente antifascista mostra a tentativa de articular grupos com diferenças reais em defesa de direitos, sindicatos, eleições e proteção contra a violência política.","Recolher-se para preservar a família revela uma experiência comum sob autoritarismo: o medo e a vulnerabilidade reduzem o espaço de ação, embora não suspendam as consequências do regime.","Apoiar a ordem autoritária evidencia o custo político de trocar direitos por segurança;
163 a promessa de estabilidade pode legitimar perseguição e concentração de poder."]},12:{context:"Em 1989, mudanças aceleradas na Europa Oriental e a queda do Muro de Berlim simbolizaram o colapso de uma ordem bipolar. O fim da Guerra Fria não resolveu conflitos sobre desigualdade, nacionalismo, democracia ou poder econômico; ele reorganizou os termos dessas disputas.",hobsbawmLens:"O encerramento de *A Era dos Extremos* recusa leituras triunfalistas simples: o século termina, mas seus problemas sociais e políticos continuam abertos.",choiceNotes:["Perguntar como praticar igualdade leva o jogador a diferenciar ideais emancipatórios das formas históricas concretas — e limitadas — pelas quais eles foram tentados.","Preservar instituições comuns valoriza direitos e regras coletivas, mas convida a discutir se elas são acessíveis e responsivas às desigualdades da transição.","Indagar quem controla a nova ordem global desloca o olhar para mercados, Estados e organismos internacionais que passam a dis
163putar influência após 1989."]}},cd={revolucionario:{title:"A Centelha Coletiva",subtitle:"Você fez da organização uma resposta à desigualdade.",analysis:"Sua rota insistiu que estruturas históricas podem ser contestadas quando sujeitos coletivos entram em cena."},conservador:{title:"A Guardiã da Continuidade",subtitle:"Você procurou reforma, regra e estabilidade em tempos de ruptura.",analysis:"Sua rota apostou em instituições e negociações para limitar os custos da transformação histórica."},expansionista:{title:"O Cartógrafo da Expansão",subtitle:"Você leu o mundo por redes, mercados e fronteiras em movimento.",analysis:"Sua rota acompanhou como comércio, guerra e infraestrutura projetam poder para além de seus lugares de origem."},vitima:{title:"A Memória dos Vencidos",subtitle:"Você manteve a experiência dos atingidos no centro da história.",analysis:"Sua rota não aceita que progresso e ordem sejam avaliados sem contar os custos humanos que deixam para trás."},dominancia:{title:"A Estrategista da Dominação",subtitle:"Você priorizou capacidade de comando nas encruzilhadas do tempo.",analysis:"Sua rota revela como poder, centralização e controle podem orientar decisões mesmo quando prometem proteção."}},vP=[{label:"University College Oxford — The Age of Revolution",href:"https://www.univ.ox.ac.uk/book/the-age-of-revolution-europe-1789-1848/"},{label:"Libcom — The Age of… series",href:"https://libcom.org/article/age-series-eric-hobsbawm"}],TP="/manus-storage/eras-hobsbawm-texture_35af8ac3.jpg",RP="/manus-storage/eras-hobsbawm-cover_b3ba217c.jpg",AP="/manus-storage/eras-hobsbawm-reference_15503c31.jpg",Kc=Object.keys(Yr);function MP(a,e){return Kc.reduce((t,i)=>(t[i]=a[i]+e[i],t),{...Bd})}function SP(){const a=new URLSearchParams(window.location.search).has("demo"),[e,t]=Te.useState(a?"play":"intro"),[i,s]=Te.useState(0),[r,o]=Te.useState({...Bd}),[c,h]=Te.useState([]),[f,_]=Te.useState([]),[d,g]=Te.useState(null),[p,x]=Te.useState(!0),[b,T]=Te.useState(!1),R=el[i],S=Xc[R?.era-1]??Xc[0],M=Math.round(i/el.length*100),I=c.map(L=>L+1).join("").padEnd(el.length,"–"),A=R?xP[R.id]:null,D=Te.useMemo(()=>Kc.reduce((L,J)=>r[J]>r[L]?J:L,"revolucionario"),[r]);function C(){t("play"),s(0),o({...Bd}),h([]),_([]),g(null),T(!1)}function k(){T(!1),g(null),i===el.length-1?t("result"):s(L=>L+1)}function H(L){if(d!==null)return;const J=R.choices[L];g(L),o(te=>MP(te,J.effects)),h(te=>[...te,L]),_(te=>[...te,J.chronicle]),window.setTimeout(()=>{p?T(!0):k()},310)}return ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:83",className:"game-shell",style:{backgroundImage:`url(${TP})`},children:[ne.jsx(bP,{"data-loc":"client/src/pages/Home.tsx:84"}),ne.jsxs("header",{"data-loc":"client/src/pages/Home.tsx:85",className:"masthead",children:[ne.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:86",className:"brand-lockup",type:"button",onClick:()=>t("intro"),"aria-label":"Voltar à abertura do jogo",children:[ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:87",className:"brand-mark archive-mark","aria-hidden":"true",children:[ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:87",className:"book-page left"}),ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:87",className:"book-spine"}),ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:87",className:"book-page right"}),ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:87",className:"ascending-line"}),ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:87",className:"turning-star",children:"☆"})]}),ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:88",className:"brand-copy",children:[ne.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:88",children:"ERAS"}),ne.jsx("em",{"data-loc":"client/src/pages/Home.tsx:88",children:"de Hobsbawm"})]})]}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:90",className:"masthead-meta",children:[ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:91",children:[ne.jsx(dC,{"data-loc":"client/src/pages/Home.tsx:91",size:14,"aria-hidden":"true"})," JOGO DE HISTÓRIA SOCIAL"]}),ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:92",className:"desktop-only",children:"12 decisões · 4 eras · 531.441 rotas"})]})]}),e==="intro"&&ne.jsxs("main",{"data-loc":"client/src/pages/Home.tsx:97",className:"intro-layout","aria-labelledby":"intro-title",children:[ne.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:98",className:"intro-copy",children:[ne.jsxs("p",{"data-loc":"client/src/pages/Home.tsx:99",className:"eyebrow",children:[ne.jsx(yC,{"data-loc":"client/src/pages/Home.tsx:99",size:15,"aria-hidden":"true"})," UMA CRÔNICA INTERATIVA"]}),ne.jsx("h1",{"data-loc":"client/src/pages/Home.tsx:100",id:"intro-title",children:"A história não é uma linha reta."}),ne.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:101",className:"eyebrow intro-seo-heading",children:"Jogo de história social pelas quatro eras de Eric Hobsbawm"}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:102",className:"intro-lede",children:"Atravesse as quatro eras de Eric J. Hobsbawm. Em cada encruzilhada, sua decisão cria uma rota própria entre revoluções, capital, impérios e extremos."}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:103",className:"intro-actions",children:[ne.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:104",className:"primary-action",type:"button",onClick:C,children:[ne.jsx(gC,{"data-loc":"client/src/pages/Home.tsx:104",size:17,fill:"currentColor","aria-hidden":"true"})," Abrir a crônica ",ne.jsx(Kf,{"data-loc":"client/src/pages/Home.tsx:104",size:17,"aria-hidden":"true"})]}),ne.jsxs("p",{"data-loc":"client/src/pages/Home.tsx:105",children:[ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:105",children:"3 escolhas"})," em cada uma das ",ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:105",children:"12 decisões"}),".",ne.jsx("br",{"data-loc":"client/src/pages/Home.tsx:105"}),"Sua sequência de escolhas forma uma entre ",ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:105",children:"531.441"})," histórias possíveis."]})]}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:107",className:"teacher-mode-setup",children:[ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:108",children:[ne.jsx(Zf,{"data-loc":"client/src/pages/Home.tsx:108",size:18,"aria-hidden":"true"}),ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:108",children:[ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:108",children:"Modo Professor"}),ne.jsx("small",{"data-loc":"client/src/pages/Home.tsx:108",children:"Mostra uma leitura histórica após cada escolha."})]})]}),ne.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:109",className:`teacher-toggle ${p?"active":""}`,type:"button",onClick:()=>x(L=>!L),"aria-pressed":p,children:[ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:110","aria-hidden":"true",children:ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:110"})}),p?"ATIVO":"PAUSADO"]})]}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:113",className:"era-index","aria-label":"As quatro eras do jogo",children:Xc.map(L=>ne.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:115",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:116",children:L.number}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:117",children:[ne.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:117",children:L.short}),ne.jsx("small",{"data-loc":"client/src/pages/Home.tsx:117",children:L.years})]})]},L.id))})]}),ne.jsx("aside",{"data-loc":"client/src/pages/Home.tsx:122",className:"cover-panel",style:{backgroundImage:`linear-gradient(90deg, rgba(24,25,23,.96) 0%, rgba(24,25,23,.65) 38%, rgba(24,25,23,.06) 100%), url(${RP})`},children:ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:123",className:"cover-caption",children:[ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:123",children:["1789 ",ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:123"})," 1991"]}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:123",children:"“Os historiadores não podem evitar ser pessoas de seu tempo.”"})]})}),ne.jsxs("footer",{"data-loc":"client/src/pages/Home.tsx:125",className:"intro-footer",children:[ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:125",children:[ne.jsx(wy,{"data-loc":"client/src/pages/Home.tsx:125",size:15,"aria-hidden":"true"})," Material didático inspirado na série ",ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:125",children:"Age of…"})]}),ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:125",children:"Use as escolhas para interpretar processos — não como gabarito."})]})]}),e==="play"&&R&&ne.jsxs("main",{"data-loc":"client/src/pages/Home.tsx:130",className:"play-layout","aria-labelledby":"question-title",children:[ne.jsxs("aside",{"data-loc":"client/src/pages/Home.tsx:131",className:"era-rail","aria-label":"Linha do tempo das eras",children:[ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:132",className:"rail-label",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:132",children:"TRAJETÓRIA"}),ne.jsxs("b",{"data-loc":"client/src/pages/Home.tsx:132",children:[String(i+1).padStart(2,"0"),"/12"]})]}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:133",className:"era-stops",children:Xc.map(L=>{const J=L.id===S.id,te=L.id<S.id;return ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:137",className:`era-stop ${J?"active":""} ${te?"done":""}`,children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:137",children:L.number}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:137",children:[ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:137",children:L.short}),ne.jsx("small",{"data-loc":"client/src/pages/Home.tsx:137",children:L.years})]})]},L.id)})}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:140",className:"route-stamp",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:140",children:"ROTA"}),ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:140",children:I})]})]}),ne.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:142",className:"decision-stage",children:[ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:143",className:"reference-wash",style:{backgroundImage:`url(${AP})`},"aria-hidden":"true"}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:144",className:"stage-head",children:[ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:145",children:[ne.jsxs("p",{"data-loc":"client/src/pages/Home.tsx:145",className:"eyebrow",children:["ERA ",S.number," · ",S.years]}),ne.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:145",children:S.title})]}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:146",className:"stage-tools",children:[ne.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:147",className:`teacher-toggle compact ${p?"active":""}`,type:"button",onClick:()=>x(L=>!L),"aria-pressed":p,children:[ne.jsx(Zf,{"data-loc":"client/src/pages/Home.tsx:148",size:14,"aria-hidden":"true"})," Professor ",ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:148","aria-hidden":"true",children:ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:148"})})]}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:150",className:"location-tag",children:[ne.jsx(pC,{"data-loc":"client/src/pages/Home.tsx:150",size:16,"aria-hidden":"true"}),ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:150",children:[ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:150",children:R.year}),R.place]})]})]})]}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:153",className:"progress-rule",children:ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:153",style:{width:`${M}%`}})}),ne.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:154",className:"question-card",children:[ne.jsxs("p",{"data-loc":"client/src/pages/Home.tsx:155",className:"question-number",children:["ENCRUZILHADA ",String(R.id).padStart(2,"0")]}),ne.jsx("h1",{"data-loc":"client/src/pages/Home.tsx:156",id:"question-title",children:R.prompt}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:157",className:"question-context",children:R.context})]}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:159",className:"choice-list","aria-label":"Três escolhas possíveis",children:R.choices.map((L,J)=>ne.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:161",type:"button",className:`choice-card ${d===J?"selected":""}`,onClick:()=>H(J),disabled:d!==null,children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:162",className:"choice-letter",children:String.fromCharCode(65+J)}),ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:163",className:"choice-copy",children:[ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:163",children:L.label}),ne.jsx("small",{"data-loc":"client/src/pages/Home.tsx:163",children:L.detail})]}),ne.jsx(Kf,{"data-loc":"client/src/pages/Home.tsx:164",className:"choice-arrow",size:18,"aria-hidden":"true"})]},L.label))}),b&&d!==null&&A&&ne.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:169",className:"teacher-panel","aria-live":"polite","aria-label":"Explicação do Modo Professor",children:[ne.jsxs("header",{"data-loc":"client/src/pages/Home.tsx:170",className:"teacher-panel-head",children:[ne.jsxs("p",{"data-loc":"client/src/pages/Home.tsx:170",children:[ne.jsx(Zf,{"data-loc":"client/src/pages/Home.tsx:170",size:16,"aria-hidden":"true"})," MODO PROFESSOR"]}),ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:170",children:["APÓS A ESCOLHA ",String.fromCharCode(65+d)]})]}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:171",className:"teacher-panel-title",children:[ne.jsx(mC,{"data-loc":"client/src/pages/Home.tsx:171",size:22,"aria-hidden":"true"}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:171",children:[ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:171",children:"LEITURA HISTÓRICA DA ENCRUZILHADA"}),ne.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:171",children:"O que estava em disputa?"})]})]}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:172",className:"teacher-context",children:A.context}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:173",className:"teacher-lens",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:173",children:"LENTE DE HOBSBAWM"}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:173",children:A.hobsbawmLens})]}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:174",className:"teacher-choice-note",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:174",children:"SUA ESCOLHA EM PERSPECTIVA"}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:174",children:A.choiceNotes[d]})]}),ne.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:175",className:"teacher-continue",type:"button",onClick:k,children:[i===el.length-1?"Ver leitura final da rota":`Avançar para a encruzilhada ${String(i+2).padStart(2,"0")}`," ",ne.jsx(Kf,{"data-loc":"client/src/pages/Home.tsx:175",size:17,"aria-hidden":"true"})]})]})]}),ne.jsxs("aside",{"data-loc":"client/src/pages/Home.tsx:179",className:"stats-dock","aria-label":"Medidores da rota",children:[ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:180",className:"stats-title",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:180",children:"LEITURA DA ROTA"}),ne.jsx(_C,{"data-loc":"client/src/pages/Home.tsx:180",size:14,"aria-hidden":"true"})]}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:181",children:"Os medidores registram as tensões que suas escolhas acumulam."}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:182",className:"stat-list",children:Kc.map(L=>ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:183",className:`stat-row ${Yr[L].tone}`,children:[ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:183",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:183",children:Yr[L].short}),ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:183",children:r[L]})]}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:183",className:"meter",children:ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:183",style:{width:`${Math.min(r[L]/36*100,100)}%`}})}),ne.jsx("small",{"data-loc":"client/src/pages/Home.tsx:183",children:Yr[L].label})]},L))})]})]}),e==="result"&&ne.jsxs("main",{"data-loc":"client/src/pages/Home.tsx:190",className:"result-layout","aria-labelledby":"result-title",children:[ne.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:191",className:"result-intro",children:[ne.jsxs("p",{"data-loc":"client/src/pages/Home.tsx:192
163",className:"eyebrow",children:[ne.jsx(wy,{"data-loc":"client/src/pages/Home.tsx:192",size:15,"aria-hidden":"true"})," SUA LEITURA DO SÉCULO"]}),ne.jsx("h1",{"data-loc":"client/src/pages/Home.tsx:193",id:"result-title",children:cd[D].title}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:194",className:"result-subtitle",children:cd[D].subtitle}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:195",className:"result-analysis",children:cd[D].analysis}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:196",className:"route-summary",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:196",children:"ROTA CONCLUÍDA"}),ne.jsx("b",{"data-loc":"client/src/pages/Home.tsx:196",children:c.map(L=>L+1).join("")}),ne.jsx("small",{"data-loc":"client/src/pages/Home.tsx:196",children:"12 decisões · uma entre 531.441 possibilidades"})]}),ne.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:197",className:"primary-action",type:"button",onClick:C,children:[ne.jsx(Lv,{"data-loc":"client/src/pages/Home.tsx:197",size:17,"aria-hidden":"true"})," Reabrir a crônica"]})]}),ne.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:199",className:"result-ledger",children:[ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:200",className:"ledger-heading",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:200",children:"O BALANÇO DA ROTA"}),ne.jsxs("b",{"data-loc":"client/src/pages/Home.tsx:200",children:[Yr[D].label.toUpperCase()," EM DESTAQUE"]})]}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:201",className:"result-bars",children:Kc.map(L=>ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:202",className:`result-stat ${Yr[L].tone}`,children:[ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:202",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:202",children:Yr[L].label}),ne.jsxs("b",{"data-loc":"client/src/pages/Home.tsx:202",children:[r[L],ne.jsx("small",{"data-loc":"client/src/pages/Home.tsx:202",children:"pts."})]})]}),ne.jsx("div",{"data-loc":"client/src/pages/Home.tsx:202",className:"result-meter",children:ne.jsx("i",{"data-loc":"client/src/pages/Home.tsx:202",style:{width:`${Math.min(r[L]/36*100,100)}%`}})})]},L))}),ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:204",className:"chronicle-list",children:[ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:204",children:"CRÔNICA DA SUA PASSAGEM"}),f.map((L,J)=>ne.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:204",children:[ne.jsx("span",{"data-loc":"client/src/pages/Home.tsx:204",children:String(J+1).padStart(2,"0")}),ne.jsx("p",{"data-loc":"client/src/pages/Home.tsx:204",children:L})]},`${L}-${J}`))]})]}),ne.jsxs("footer",{"data-loc":"client/src/pages/Home.tsx:206",className:"sources-footer",children:["Recortes das eras: ",vP.map((L,J)=>ne.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:206",children:[J>0&&" · ",ne.jsx("a",{"data-loc":"client/src/pages/Home.tsx:206",href:L.href,target:"_blank",rel:"noreferrer",children:L.label})]},L.href))]})]})]})}function EP(){return ne.jsx(xC,{"data-loc":"client/src/App.tsx:9",children:ne.jsx(TC,{"data-loc":"client/src/App.tsx:10",defaultTheme:"dark",children:ne.jsxs(cC,{"data-loc":"client/src/App.tsx:11",children:[ne.jsx(yM,{"data-loc":"client/src/App.tsx:12"}),ne.jsx(SP,{"data-loc":"client/src/App.tsx:13"})]})})})}NA.createRoot(document.getElementById("root")).render(ne.jsx(EP,{"data-loc":"client/src/main.tsx:5"}));export{Ve as A,rh as B,_i as C,A1 as D,dI as E,Wi as F,Ed as G,is as I,lh as L,se as M,Ae as O,an as P,l1 as R,nh as S,mI as T,E as V,DI as _,me as a,Md as b,je as c,Z as d,Ki as e,fe as f,Rt as g,Yc as h,he as i,_t as j,Ji as k,pi as l,ds as m,Ue as n,Rd as o,pr as p,tI as q,Vc as r,pe as s,PP as t,TI as u,sh as v,lt as w,zD as x,FP as y,yi as z};

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.