1var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=e=>{let n={};for(var r in e)t(n,r,{get:e[r],enumerable:!0});return n},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pen
1ding`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()}
vendor: 7,229 bytes, line 1
1,e.version=`19.2.3`})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=h();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.3`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=p(),n=h(),r=_();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var M=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function L(e){return{current:e}}function ie(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function R(e,t){re++,ne[re]=e.current,e.current=t}var ae=L(null),oe=L(null),se=L(null),ce=L(null);function z(e,t){switch(R(se,t),R(oe,e),R(ae,null),t.nodeType){case 9:case 11:e=(e
vendor: 21,376 bytes, lines 1-8
1=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ie(ae),R(ae,e)}function le(){ie(ae),ie(oe),ie(se)}function ue(e){e.memoizedState!==null&&R(ce,e);var t=ae.current,n=Jd(t,e.type);t!==n&&(R(oe,e),R(ae,n))}function de(e){oe.current===e&&(ie(ae),ie(oe)),ce.current===e&&(ie(ce),ip._currentValue=I)}var fe,B;function pe(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,B=-1<e.stack.indexOf(` 2 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 3`+fe+e+B}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` 4`),l=s.split(` 5`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` 6`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?pe(n):``}function V(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return e.child!==t&&t!==null?pe(`Suspense Fallback`):pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return pe(`Activity`);default:return``}}function H(e){try{var t=``,n=null;do t+=V(e,n),n=e,e=e.return;while(e);return t}catch(e){return` 7Error generating stack: `+e.message+` 8`+e.stack}}var U=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,Re=4194304;function ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function W(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 He(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Me(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=F.p;return e===0?(e=window.event,e===void 0?32:bp(e.type)):e}function Qe(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,G=`__reactContainer$`+$e,nt=`__reactEvents$`+$e,rt=`__reactListeners$`+$e,it=`__reactHandles$`+$e,at=`__reactResources$`+$e,ot=`__reactMarker$`+$e;function st(e){delete e[et],delete e[tt],delete e[nt],delete e[rt],delete e[it]}function ct(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[G]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[et])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function lt(e){if(e=e[et]||e[G]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ut(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function dt(e){var t=e[at];return t||=e[at]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ft(e){e[ot]=!0}var pt=new Set,mt={};function ht(e,t){gt(e,t),gt(e+`Capture`,t)}function gt(e,t){for(mt[e]=t,e=0;e<t.length;e++)pt.add(t[e])}var _t=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),vt={},yt={};function bt(e){return U.call(yt,e)?!0:U.call(vt,e)?!1:_t.test(e)?yt[e]=!0:(vt[e]=!0,!1)}function xt(e,t,n){if(bt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function St(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Ct(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Tt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Et(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dt(e){if(!e._valueTracker){var t=Tt(e)?`checked`:`value`;e._valueTracker=Et(e,t,``+e[t])}}function Ot(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Tt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function kt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var At=/[\n"\\]/g;function jt(e){return e.replace(At,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Mt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+wt(t)):e.value!==``+wt(t)&&(e.value=``+wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Pt(e,o,wt(n)):Pt(e,o,wt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+wt(s):e.removeAttribute(`name`)}function Nt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Dt(e);return}n=n==null?``:``+wt(n),t=t==null?n:``+wt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Dt(e)}function Pt(e,t,n){t===`number`&&kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ft(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+wt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function It(e,t,n){if(t!=null&&(t=``+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+wt(n)}function Lt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(N(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Dt(e)}function Rt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zt=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 Bt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Vt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Bt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Bt(e,o,t[o])}function Ht(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Ut=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Wt=/^[\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 Gt(e){return Wt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Kt(){}var qt=null;function Jt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yt=null,Xt=null;function Zt(e){var t=lt(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Mt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[tt]||null;if(!a)throw Error(i(90));Mt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ot(r)}break a;case`textarea`:It(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ft(e,!!n.multiple,t,!1)}}}var Qt=!1;function $t(e,t,n){if(Qt)return e(t,n);Qt=!0;try{return e(t)}finally{if(Qt=!1,(Yt!==null||Xt!==null)&&(Cu(),Yt&&(t=Yt,e=Xt,Xt=Yt=null,Zt(t),e)))for(t=0;t<e.length;t++)Zt(e[t])}}function en(e,t){var n=e.stateNode;if(n===null)return null;var r=n[tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var tn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),nn=!1;if(tn)try{var rn={};Object.defineProperty(rn,`passive`,{get:function(){nn=!0}}),window.addEventListener(`test`,rn,rn),window.removeEventListener(`test`,rn,rn)}catch{nn=!1}var an=null,on=null,sn=null;function cn(){if(sn)return sn;var e,t=on,n=t.length,r,i=`value`in an?an.value:an.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return sn=i.slice(e,1<r?1-r:void 0)}function ln(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function un(){return!0}function dn(){return!1}function fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?un:dn,this.isPropagationStopped=dn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mn=fn(pn),hn=f({},pn,{view:0,detail:0}),gn=fn(hn),_n,vn,yn,bn=f({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==yn&&(yn&&e.type===`mousemove`?(_n=e.screenX-yn.screenX,vn=e.screenY-yn.screenY):vn=_n=0,yn=e),_n)},movementY:function(e){return`movementY`in e?e.movementY:vn}}),xn=fn(bn),Sn=fn(f({},bn,{dataTransfer:0})),Cn=fn(f({},hn,{relatedTarget:0})),wn=fn(f({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Tn=fn(f({},pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),En=fn(f({},pn,{data:0})),Dn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},On={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:`F
85`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function An(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kn[e])?!!t[e]:!1}function jn(){return An}var Mn=fn(f({},hn,{key:function(e){if(e.key){var t=Dn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?On[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return e.type===`keypress`?ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Nn=fn(f({},bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=fn(f({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Fn=fn(f({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=fn(f({},bn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Ln=fn(f({},pn,{newState:0,oldState:0})),Rn=[9,13,27,32],zn=tn&&`CompositionEvent`in window,Bn=null;tn&&`documentMode`in document&&(Bn=document.documentMode);var Vn=tn&&`TextEvent`in window&&!Bn,Hn=tn&&(!zn||Bn&&8<Bn&&11>=Bn),Un=` `,Wn=!1;function Gn(e,t){switch(e){case`keyup`:return Rn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Kn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var qn=!1;function Jn(e,t){switch(e){case`compositionend`:return Kn(t);case`keypress`:return t.which===32?(Wn=!0,Un):null;case`textInput`:return e=t.data,e===Un&&Wn?null:e;default:return null}}function Yn(e,t){if(qn)return e===`compositionend`||!zn&&Gn(e,t)?(e=cn(),sn=on=an=null,qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Hn&&t.locale!==`ko`?null:t.data;default:return null}}var Xn={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 Zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Xn[e.type]:t===`textarea`}function Qn(e,t,n,r){Yt?Xt?Xt.push(r):Xt=[r]:Yt=r,t=jd(t,`onChange`),0<t.length&&(n=new mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var $n=null,er=null;function tr(e){Cd(e,0)}function nr(e){if(Ot(ut(e)))return e}function rr(e,t){if(e===`change`)return t}var ir=!1;if(tn){var ar;if(tn){var or=`oninput`in document;if(!or){var sr=document.createElement(`div`);sr.setAttribute(`oninput`,`return;`),or=typeof sr.oninput==`function`}ar=or}else ar=!1;ir=ar&&(!document.documentMode||9<document.documentMode)}function cr(){$n&&($n.detachEvent(`onpropertychange`,lr),er=$n=null)}function lr(e){if(e.propertyName===`value`&&nr(er)){var t=[];Qn(t,er,e,Jt(e)),$t(tr,t)}}function ur(e,t,n){e===`focusin`?(cr(),$n=t,er=n,$n.attachEvent(`onpropertychange`,lr)):e===`focusout`&&cr()}function dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return nr(er)}function fr(e,t){if(e===`click`)return nr(t)}function pr(e,t){if(e===`input`||e===`change`)return nr(t)}function mr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var hr=typeof Object.is==`function`?Object.is:mr;function gr(e,t){if(hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!U.call(t,i)||!hr(e[i],t[i]))return!1}return!0}function _r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vr(e,t){var n=_r(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=_r(n)}}function yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=kt(e.document)}return t}function xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Sr=tn&&`documentMode`in document&&11>=document.documentMode,Cr=null,wr=null,Tr=null,Er=!1;function Dr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;
vendor: 118,742 bytes, lines 8-9
8Er||Cr==null||Cr!==kt(r)||(r=Cr,`selectionStart`in r&&xr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Tr&&gr(Tr,r)||(Tr=r,r=jd(wr,`onSelect`),0<r.length&&(t=new mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Cr)))}function Or(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var kr={animationend:Or(`Animation`,`AnimationEnd`),animationiteration:Or(`Animation`,`AnimationIteration`),animationstart:Or(`Animation`,`AnimationStart`),transitionrun:Or(`Transition`,`TransitionRun`),transitionstart:Or(`Transition`,`TransitionStart`),transitioncancel:Or(`Transition`,`TransitionCancel`),transitionend:Or(`Transition`,`TransitionEnd`)},Ar={},jr={};tn&&(jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),`TransitionEvent`in window||delete kr.transitionend.transition);function Mr(e){if(Ar[e])return Ar[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jr)return Ar[e]=t[n];return e}var Nr=Mr(`animationend`),Pr=Mr(`animationiteration`),Fr=Mr(`animationstart`),Ir=Mr(`transitionrun`),Lr=Mr(`transitionstart`),Rr=Mr(`transitioncancel`),zr=Mr(`transitionend`),Br=new Map,Vr=`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(` `);Vr.push(`scrollEnd`);function Hr(e,t){Br.set(e,t),ht(t,[e])}var Ur=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function ei(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ii(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=Yf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:H(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:H(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Me(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function K(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function Ci(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function wi(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ti=null,Ei=null,Di=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Li(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function Mi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[et]=e,t[tt]=r,n){case`dialog`:wd(`cancel`,t),wd(`close`,t);break;case`iframe`:case`object`:case`embed`:wd(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)wd(xd[n],t);break;case`source`:wd(`error`,t);break;case`img`:case`image`:case`link`:wd(`error`,t),wd(`load`,t);break;case`details`:wd(`toggle`,t);break;case`input`:wd(`invalid`,t),Nt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:wd(`invalid`,t);break;case`textarea`:wd(`invalid`,t),Lt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(wd(`beforetoggle`,t),wd(`toggle`,t)),r.onScroll!=null&&wd(`scroll`,t),r.onScrollEnd!=null&&wd(`scrollend`,t),r.onClick!=null&&(t.onclick=Kt),t=!0):t=!1,t||ji(e,!0)}function Ni(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ti=Ti.return}}function Pi(e){if(e!==Ti)return!1;if(!Di)return Ni(e),Di=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Yd(e.type,e.memoizedProps)),n=!n),n&&Ei&&ji(e),Ni(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=gf(e)}else t===27?(t=Ei,rf(e.type)?(e=hf,hf=null,Ei=e):Ei=t):Ei=Ti?mf(e.stateNode.nextSibling):null;return!0}function Fi(){Ei=Ti=null,Di=!1}function Ii(){var e=Oi;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Oi=null),e}function Li(e){Oi===null?Oi=[e]:Oi.push(e)}var Ri=L(null),zi=null,Bi=null;function Vi(e,t,n){R(Ri,t._currentValue),t._currentValue=n}function Hi(e){e._currentValue=Ri.current,ie(Ri)}function Ui(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Wi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ui(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ui(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Gi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ip]:e.push(ip))}a=a.return}e!==null&&Wi(t,e,n,r),t.flags|=262144}function Ki(e){for(e=e.firstContext;e!==null;){if(!hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qi(e){zi=e,Bi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ji(e){return Xi(zi,e)}function Yi(e,t){return zi===null&&qi(e),Xi(e,t)}function Xi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Bi===null){if(e===null)throw Error(i(308));Bi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Bi=Bi.next=t;return n}var Zi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Qi=t.unstable_scheduleCallback,$i=t.unstable_NormalPriority,ea={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ta(){return{controller:new Zi,data:new Map,refCount:0}}function na(e){e.refCount--,e.refCount===0&&Qi($i,function(){e.controller.abort()})}var ra=null,ia=0,aa=0,oa=null;function sa(e,t){if(ra===null){var n=ra=[];ia=0,aa=hd(),oa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ia++,t.then(ca,ca),t}function ca(){if(--ia===0&&ra!==null){oa!==null&&(oa.status=`fulfilled`);var e=ra;ra=null,aa=0,oa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function la(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ua=P.S;P.S=function(e,t){ru=be(),typeof t==`object`&&t&&typeof t.then==`function`&&sa(e,t),ua!==null&&ua(e,t)};var da=L(null);function fa(){var e=da.current;return e===null?zl.pooledCache:e}function pa(e,t){t===null?R(da,da.current):R(da,t.pool)}function ma(){var e=fa();return e===null?null:{parent:ea._currentValue,pool:e}}var ha=Error(i(460)),ga=Error(i(474)),_a=Error(i(542)),va={then:function(){}};function ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ba(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kt,Kt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e;default:if(typeof t.status==`string`)t.then(Kt,Kt);else{if(e=zl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e}throw Sa=t,ha}}function xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Sa=e,ha):e}}var Sa=null;function Ca(){if(Sa===null)throw Error(i(459));var e=Sa;return Sa=null,e}function wa(e){if(e===ha||e===_a)throw Error(i(483))}var Ta=null,Ea=0;function Da(e){var t=Ea;return Ea+=1,Ta===null&&(Ta=[]),ba(Ta,e,t)}function Oa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ka(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Aa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ri(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=si(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&xa(i)===t.type)?(t=a(t,n.props),Oa(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),Oa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=oi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=ai(t.type,t.key,t.props,null,e.mode,n),Oa(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=xa(t),f(e,t,n)}if(N(t)||ee(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Da(t),n);if(t.$$typeof===C)return f(e,Yi(e,t),n);ka(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=xa(n),p(e,t,n,r)}if(N(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Da(n),r);if(n.$$typeof===C)return p(e,t,Yi(e,n),r);ka(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=xa(r),m(e,t,n,r,i)}if(N(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Da(r),i);if(r.$$typeof===C)return m(e,t,n,Yi(t,r),i);ka(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Di&&xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Di&&xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Di&&xi(i,h),l}function _(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Di&&xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Di&&xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Di&&xi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Oa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),Oa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=xa(o),b(e,r,o,c)}if(N(o))return h(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),_(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Da(o),c);if(o.$$typeof===C)return b(e,r,Yi(e,o),c);ka(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ea=0;var i=b(e,t,n,r);return Ta=null,i}catch(t){if(t===ha||t===_a)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ja=Aa(!0),Ma=Aa(!1),Na=!1;function Pa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Rl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function Ra(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ba=!1;function Va(){if(Ba){var e=oa;if(e!==null)throw e}}function Ha(e,t,n,r){Ba=!1;var i=e.updateQueue;Na=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Vl&p)===p:(r&p)===p){p!==0&&p===aa&&(Ba=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Na=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Yl|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Wa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ua(n[e],t)}var Ga=L(null),Ka=L(0);function qa(e,t){e=ql,R(Ka,e),R(Ga,t),ql=e|t.baseLanes}function Ja(){R(Ka,ql),R(Ga,Ga.current)}function Ya(){ql=Ka.current,ie(Ga),ie(Ka)}var Xa=L(null),Za=null;function Qa(e){var t=e.alternate;R(ro,ro.current&1),R(Xa,e),Za===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(Za=e)}function $a(e){R(ro,ro.current),R(Xa,e),Za===null&&(Za=e)}function eo(e){e.tag===22?(R(ro,ro.current),R(Xa,e),Za===null&&(Za=e)):to(e)}function to(){R(ro,ro.current),R(Xa,Xa.current)}function no(e){ie(Xa),Za===e&&(Za=null),ie(ro)}var ro=L(0);function io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=0,oo=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return ao=a,oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){P.H=Fs;var t=so!==null&&so.next!==null;if(ao=0,co=so=oo=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&Ki(e)&&(ec=!0))}function xo(e,t,n,r){oo=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(oo.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}ao=0,co=so=oo=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?oo.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=oo.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?oo.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw oo.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?oo.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=ba(ho,e,t),t=oo,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Ji(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=oo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=oo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),oo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(Vl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===aa&&(d=!0);else if((ao&p)===p){u=u.next,p===aa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,oo.lanes|=p,Yl|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,oo.lanes|=f,Yl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!hr(o,e.memoizedState)&&(ec=!0,d&&(n=oa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);hr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=oo,a=Do(),o=Di;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!hr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||ao&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=oo.updateQueue,t===null?(t=Oo(),oo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hr(e,n)}catch{return!0}}function Vo(e){var t=Xr(e,2);t!==null&&vu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(Di){var n=zl.formState;if(n!==null){a:{var r=oo;if(Di){if(Ei){b:{for(var i=Ei,a=ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ei=mf(i.nextSibling),r=i.data===`F!`;break a}}ji(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,oo,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,oo,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,oo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ha?_a:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(oo.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=oo.updateQueue,t===null&&(t=Oo(),oo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();oo.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(oo.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){oo.flags|=4;var t=oo.updateQueue;if(t===null)t=Oo(),oo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Rl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||ao&1073741824&&!(Vl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),oo.lanes|=e,Yl|=e,n)}function vs(e,t,n,r){return hr(n,t)?n:Ga.current===null?!(ao&42)||ao&1073741824&&!(Vl&261930)?(ec=!0,e.memoizedState=n):(e=_u(),oo.lanes|=e,Yl|=e,t):(e=_s(e,n,r),hr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,js(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,la(c,r),gu(e)):As(e,t,r,gu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,I,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},gu())}function ws(){return Ji(ip)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Ia(n);var r=La(t,e,n);r!==null&&(vu(r,t,n),Ra(r,t,n)),t={cache:ta()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Yr(e,t,n,r),n!==null&&(vu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,gu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,hr(s,o))return Jr(e,t,i,0),zl===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return vu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&vu(t,e,2)}function Ms(e){var t=e.alternate;return e===oo||t!==null&&t===oo}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Fs={readContext:Ji,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Ji,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Ji,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){je(!0);try{n(t)}finally{je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,oo,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,oo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,oo,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oo,a=Eo();if(Di){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));Vl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=zl.identifierPrefix;if(Di){var n=bi,r=yi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,oo,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,oo)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Rl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Ji,use:Ao,useCallback:hs,useContext:Ji,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Ji,use:Ao,useCallback:hs,useContext:Ji,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ia(r);i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(vu(t,e,r),Ra(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ia(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(vu(t,e,r),Ra(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Ia(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(vu(t,e,n),Ra(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!gr(n,r)||!gr(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Ur(e)}function Gs(e){console.error(e)}function Ks(e){Ur(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ia(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Gi(t,n,a,!0),n=Xa.current,n!==null){switch(n.tag){case 31:case 13:return Za===null?Au():n.alternate===null&&Jl===0&&(Jl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===va?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===va?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Di)return t=Xa.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Li(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ys(e.stateNode,r,a),za(e,a),Jl!==4&&(Jl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Li(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),$l===null?$l=[o]:$l.push(o),Jl!==4&&(Jl=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),za(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Ma(t,null,n,r):ja(t,e.child,n,r)}function nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return qi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Di&&s&&K(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?gr:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(gr(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pa(t,a===null?null:a.cachePool),a===null?Ja():qa(t,a),eo(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&pa(t,null),Ja(),to(t)):(pa(t,a.cachePool),qa(t,a),to(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=fa();return a=a===null?null:{parent:ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&pa(t,null),Ja(),eo(t),e!==null&&Gi(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return ja(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,no(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Di){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if($a(t),(e=Ei)?(e=uf(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if($a(t),a)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||Gi(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=zl,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),vu(r,e,s),$s;Au(),t=lc(e,t,n)}else e=o.treeContext,Ei=mf(s.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fc(e,t,n,r,i){return qi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Di&&r&&K(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return qi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(Di&&r&&K(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(qi(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=Ji(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Pa(t),o=n.contextType,a.context=typeof o==`object`&&o?Ji(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Ha(t,r,a,i),Va(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=Ji(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Na=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),Va(),l=t.memoizedState,s||f!==l||Na?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Na||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fa(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=Ji(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Na=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i),Va();var p=t.memoizedState;o!==d||f!==p||Na||e!==null&&e.dependencies!==null&&Ki(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Na||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ki(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,dc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ja(t,e.child,null,i),t.child=ja(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Fi(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ma()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function yc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ro.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Di){if(a?Qa(t):to(t),(e=Ei)?(e=uf(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(to(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):(Qa(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Qa(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(to(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ja(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(to(t),t.child=e.child,t.flags|=128,t=null);else if(Qa(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Li({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||Gi(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=zl,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),vu(s,e,r),$s;df(c)||Au(),t=Sc(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ei=mf(c.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(to(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=ma():(l=ea._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):(Qa(t),n=e.child,e=n.sibling,n=ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return ja(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ui(e.return,t,n)}function wc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ro.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,R(ro,o),tc(e,t,r,n),r=Di?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Gi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ki(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:z(t,t.stateNode.containerInfo),Vi(t,ea,e.memoizedState.cache),Fi();break;case 27:case 5:ue(t);break;case 4:z(t,t.stateNode.containerInfo);break;case 10:Vi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$a(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Qa(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):(Qa(t),t.flags|=128,null);Qa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Gi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(ro,ro.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Vi(t,ea,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,Di&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=xa(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(z(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Fa(e,t),Ha(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Vi(t,ea,r),r!==o.cache&&Wi(t,[ea],n,!0),Va(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=hc(e,t,r,n);break a}else if(r!==a){a=di(Error(i(424)),t),Li(a),t=hc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ei=mf(e.firstChild),Ti=t,Di=!0,Oi=null,ki=!0,n=Ma(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fi(),r===a){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Di||(n=t.type,e=t.pendingProps,r=Kd(se.current).createElement(n),r[et]=t,r[tt]=e,Bd(r,n,e),ft(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&Di&&(r=t.stateNode=vf(t.type,t.pendingProps,se.current),Ti=t,ki=!0,a=Ei,rf(t.type)?(hf=a,Ei=mf(r.firstChild)):Ei=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Di&&((a=r=Ei)&&(r=cf(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ti=t,Ei=mf(r.firstChild),ki=!1,a=!0)),a||ji(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),ip._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&Di&&((e=n=Ei)&&(n=lf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ti=t,Ei=null,e=!0)),e||ji(t)),null;case 13:return yc(e,t,n);case 4:return z(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ja(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Vi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,qi(t),a=Ji(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return qi(t),r=Ji(ea),e===null?(a=fa(),a===null&&(a=zl,o=ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Pa(t),Vi(t,ea,a)):((e.lanes&n)!==0&&(Fa(e,t),Ha(t,null,null,n),Va()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Vi(t,ea,r),r!==a.cache&&Wi(t,[ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Vi(t,ea,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Sa=va,ga}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(Du())e.flags|=8192;else throw Sa=va,ga}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:He(),e.lanes|=t,Ql|=t)}function Pc(e,t){if(!Di)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ic(e,t,n){var r=t.pendingProps;switch(Ci(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Hi(ea),le(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Pi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ii())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(de(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=ae.current,Pi(t)?Mi(t,e):(e=vf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=ae.current,Pi(t))Mi(t,o);else{var s=Kd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Pi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||ji(t,!0)}else e=Kd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Pi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(no(t),t):(no(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(no(t),t):(no(t),null)}return no(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nc(t,t.updateQueue),Fc(t),null);case 4:return le(),e===null&&Dd(t.stateNode.containerInfo),Fc(t),null;case 10:return Hi(t.type),Fc(t),null;case 19:if(ie(ro),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Jl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=io(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return R(ro,ro.current&1|2),Di&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>iu&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Di)return Fc(t),null}else 2*be()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=ro.current,R(ro,a?n&1|2:n&1),Di&&xi(t,r.treeForkCount),e);case 22:case 23:return no(t),Ya(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ie(da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Hi(ea),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hi(ea),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(no(t),t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(no(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(ro),null;case 4:return le(),null;case 10:return Hi(t.type),null;case 22:case 23:return no(t),Ya(),e!==null&&ie(da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Hi(ea),null;case 25:return null;default:return null}}function Rc(e,t){switch(Ci(t),t.tag){case 3:Hi(ea),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&no(t);break;case 13:no(t);break;case 19:ie(ro);break;case 10:Hi(t.type);break;case 22:case 23:no(t),Ya(),e!==null&&ie(da);break;case 24:Hi(ea)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wa(t,n)}catch(t){Ju(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[tt]=t}catch(t){Ju(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Kt));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[et]=e,t[tt]=n}catch(t){Ju(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Wd=pp,e=br(e),xr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},pp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wa(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&st(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;rf(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),yf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),zp(e)):af(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zp(e)}catch(e){Ju(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zp(e)}catch(e){Ju(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function ml(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ot]||o[et]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[et]=e,ft(o),r=o;break a;case`link`:var s=qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[et]=e,ft(o),r=o}e.stateNode=r}else Jf(a,e.type,e.stateNode);else e.stateNode=Hf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Jf(a,e.type,e.stateNode):Hf(a,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Rt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Kf=null,a=hl,hl=Sf(t.containerInfo),ml(t,e),hl=a,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zp(t.containerInfo)}catch(t){Ju(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=Sf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Rt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:yf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ua(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&na(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Zf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=Sf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={getCacheForType:function(e){var t=Ji(ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ji(ea).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,Rl=0,zl=null,Bl=null,Vl=0,Hl=0,Ul=null,Wl=!1,Gl=!1,Kl=!1,ql=0,Jl=0,Yl=0,q=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Rl&2&&Vl!==0?Vl&-Vl:P.T===null?Ze():hd()}function _u(){if(Zl===0)if(!(Vl&536870912)||Di){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),Zl=e}else Zl=536870912;return e=Xa.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===zl&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Vl,Zl,!1)),We(e,n),(!(Rl&2)||e!==zl)&&(e===zl&&(!(Rl&2)&&(q|=n),Jl===4&&Su(e,Vl,Zl,!1)),sd(e))}function yu(e,t,n){if(Rl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Be(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Gl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Kl&&!l){c.errorRecoveryDisabledLanes|=o,q|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Wl);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-be(),10<a)){if(Su(r,t,Zl,!Wl),W(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Qd(bu.bind(null,r,n,eu,au,tu,t,Zl,q,Ql,Wl,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,q,Ql,Wl,o,null,-0,0)}}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kt},Al(t,a,d);var m=(a&62914560)===a?nu-be():(a&4194048)===a?ru-be():0;if(m=$f(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~q,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function Cu(){return Rl&6?!0:(cd(0,!1),!1)}function wu(){if(Bl!==null){if(Hl===0)var e=Bl.return;else e=Bl,Bi=zi=null,To(e),Ta=null,Ea=0,e=Bl;for(;e!==null;)Rc(e.alternate,e),e=e.return;Bl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),zl=e,Bl=n=ri(e.current,null),Vl=t,Hl=0,Ul=null,Wl=!1,Gl=Be(e,t),Kl=!1,Ql=Zl=Xl=q=Yl=Jl=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return ql=t,qr(),n}function Eu(e,t){oo=null,P.H=Fs,t===ha||t===_a?(t=Ca(),Hl=3):t===ga?(t=Ca(),Hl=4):Hl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ul=t,Bl===null&&(Jl=1,qs(e,di(t,e.current)))}function Du(){var e=Xa.current;return e===null?!0:(Vl&4194048)===Vl?Za===null:(Vl&62914560)===Vl||Vl&536870912?e===Za:!1}function Ou(){var e=P.H;return P.H=Fs,e===null?Fs:e}function ku(){var e=P.A;return P.A=Il,e}function Au(){Jl=4,Wl||(Vl&4194048)!==Vl&&Xa.current!==null||(Gl=!0),!(Yl&134217727)&&!(q&134217727)||zl===null||Su(zl,Vl,Zl,!1)}function ju(e,t,n){var r=Rl;Rl|=2;var i=Ou(),a=ku();(zl!==e||Vl!==t)&&(au=null,Tu(e,t)),t=!1;var o=Jl;a:do try{if(Hl!==0&&Bl!==null){var s=Bl,c=Ul;switch(Hl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Xa.current===null&&(t=!0);var l=Hl;if(Hl=0,Ul=null,Lu(e,s,c,l),n&&Gl){o=0;break a}break;default:l=Hl,Hl=0,Ul=null,Lu(e,s,c,l)}}Mu(),o=Jl;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Bi=zi=null,Rl=r,P.H=i,P.A=a,Bl===null&&(zl=null,Vl=0,qr()),o}function Mu(){for(;Bl!==null;)Fu(Bl)}function Nu(e,t){var n=Rl;Rl|=2;var r=Ou(),a=ku();zl!==e||Vl!==t?(au=null,iu=be()+500,Tu(e,t)):Gl=Be(e,t);a:do try{if(Hl!==0&&Bl!==null){t=Bl;var o=Ul;b:switch(Hl){case 1:Hl=0,Ul=null,Lu(e,t,o,1);break;case 2:case 9:if(ya(o)){Hl=0,Ul=null,Iu(t);break}t=function(){Hl!==2&&Hl!==9||zl!==e||(Hl=7),sd(e)},o.then(t,t);break a;case 3:Hl=7;break a;case 4:Hl=5;break a;case 7:ya(o)?(Hl=0,Ul=null,Iu(t)):(Hl=0,Ul=null,Lu(e,t,o,7));break;case 5:var s=null;switch(Bl.tag){case 26:s=Bl.memoizedState;case 5:case 27:var c=Bl;if(s?Xf(s):c.stateNode.complete){Hl=0,Ul=null;var l=c.sibling;if(l!==null)Bl=l;else{var u=c.return;u===null?Bl=null:(Bl=u,Ru(u))}break b}}Hl=0,Ul=null,Lu(e,t,o,5);break;case 6:Hl=0,Ul=null,Lu(e,t,o,6);break;case 8:wu(),Jl=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Bi=zi=null,P.H=r,P.A=a,Rl=n,Bl===null?(zl=null,Vl=0,qr(),Jl):0}function Pu(){for(;Bl!==null&&!ve();)Fu(Bl)}function Fu(e){var t=kc(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?Ru(e):Bl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Vl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Vl);break;case 5:To(t);default:Rc(n,t),t=Bl=ii(t,ql),t=kc(n,t,ql)}e.memoizedProps=e.pendingProps,t===null?Ru(e):Bl=t}function Lu(e,t,n,r){Bi=zi=null,To(t),Ta=null,Ea=0;var i=t.return;try{if(Qs(e,i,t,n,Vl)){Jl=1,qs(e,di(n,e.current)),Bl=null;return}}catch(t){if(i!==null)throw Bl=i,t;Jl=1,qs(e,di(n,e.current)),Bl=null;return}t.flags&32768?(Di||r===1?e=!0:Gl||Vl&536870912?e=!1:(Wl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Wl);return}e=t.return;var n=Ic(t.alternate,t,ql);if(n!==null){Bl=n;return}if(t=t.sibling,t!==null){Bl=t;return}Bl=t=e}while(t!==null);Jl===0&&(Jl=5)}function zu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Bl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Bl=e;return}Bl=e=n}while(e!==null);Jl=6,Bl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Rl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Ge(e,n,o,s,c,l),e===zl&&(Bl=zl=null,Vl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(we,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Rl,Rl|=4;try{rl(e,t,n)}finally{Rl=s,F.p=a,P.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Rl;Rl|=4;try{gl(t,e);var a=Gd,o=br(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&yr(s.ownerDocument.documentElement,s)){if(c!==null&&xr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=vr(s,h),v=vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}pp=!!Wd,Gd=Wd=null}finally{Rl=i,F.p=r,P.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Rl;Rl|=4;try{il(e,t.alternate,t)}finally{Rl=i,F.p=r,P.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,ye();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),Xe(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,na(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=Xe(uu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Rl&6)throw Error(i(331));var c=Rl;if(Rl|=4,Nl(o.current),Tl(o,o.current,s,n),Rl=c,cd(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{F.p=a,P.T=r,Wu(e,t)}}function qu(e,t,n){t=di(n,t),t=Ys(e.stateNode,t,2),e=La(e,t,2),e!==null&&(We(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=di(n,e),n=Xs(2),r=La(t,n,2),r!==null&&(Zs(n,r,t,e),We(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Kl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(Vl&n)===n&&(Jl===4||Jl===3&&(Vl&62914560)===Vl&&300>be()-nu?!(Rl&2)&&Tu(e,0):Xl|=n,Ql===Vl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=He()),e=Xr(e,t),e!==null&&(We(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return ge(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Me(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Vl,a=W(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(r,a)||(n=!0,pd(r,a));r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Zd()&&(e=od);for(var t=be(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=Vl,n=W(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Xe(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=fd.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Vl;return r=W(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,be()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){tf(function(){Rl&6?ge(Se,ld):ud()})}function hd(){if(od===0){var e=aa;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Gt(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Vr.length;yd++){var bd=Vr[yd];Hr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Hr(Nr,`onAnimationEnd`),Hr(Pr,`onAnimationIteration`),Hr(Fr,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(Ir,`onTransitionRun`),Hr(Lr,`onTransitionStart`),Hr(Rr,`onTransitionCancel`),Hr(zr,`onTransitionEnd`),gt(`onMouseEnter`,[`mouseout`,`mouseover`]),gt(`onMouseLeave`,[`mouseout`,`mouseover`]),gt(`onPointerEnter`,[`pointerout`,`pointerover`]),gt(`onPointerLeave`,[`pointerout`,`pointerover`]),ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,a=c}}}}function wd(e,t){var n=t[nt];n===void 0&&(n=t[nt]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,pt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(bp(t)){case 2:var i=mp;break;case 8:i=hp;break;default:i=gp}n=i.bind(null,t,n,e),i=void 0,!nn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ct(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}$t(function(){var r=a,i=Jt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=mn,u=e;switch(e){case`keypress`:if(ln(n)===0)break a;case`keydown`:case`keyup`:l=Mn;break;case`focusin`:u=`focus`,l=Cn;break;case`focusout`:u=`blur`,l=Cn;break;case`beforeblur`:case`afterblur`:l=Cn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Sn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Pn;break;case Nr:case Pr:case Fr:l=wn;break;case zr:l=Fn;break;case`scroll`:case`scrollend`:l=gn;break;case`wheel`:l=In;break;case`copy`:case`cut`:case`paste`:l=Tn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Nn;break;case`toggle`:case`beforetoggle`:l=Ln}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=en(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==qt&&(u=n.relatedTarget||n.fromElement)&&(ct(u)||u[G]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ct(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Nn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ut(l),h=u==null?c:ut(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ct(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?ut(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=rr;else if(Zn(c))if(ir)v=pr;else{v=dr;var y=ur}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ht(r.elementType)&&(v=rr):v=fr;if(v&&=v(e,r)){Qn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Pt(c,`number`,c.value)}switch(y=r?ut(r):window,e){case`focusin`:(Zn(y)||y.contentEditable===`true`)&&(Cr=y,wr=r,Tr=null);break;case`focusout`:Tr=wr=Cr=null;break;case`mousedown`:Er=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Er=!1,Dr(s,n,i);break;case`selectionchange`:if(Sr)break;case`keydown`:case`keyup`:Dr(s,n,i)}var b;if(zn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else qn?Gn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Hn&&n.locale!==`ko`&&(qn||x!==`onCompositionStart`?x===`onCompositionEnd`&&qn&&(b=cn()):(an=i,on=`value`in an?an.value:an.textContent,qn=!0)),y=jd(r,x),0<y.length&&(x=new En(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Kn(n),b!==null&&(x.data=b)))),(b=Vn?Jn(e,n):Yn(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new En(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=en(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=en(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=en(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=en(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,` 9`).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Rt(e,``+r);break;case`className`:St(e,`class`,r);break;case`tabIndex`:St(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:St(e,n,r);break;case`style`:Vt(e,r,o);break;case`data`:if(t!==`object`){St(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Gt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Gt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Gt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:wd(`beforetoggle`,e),wd(`toggle`,e),xt(e,`popover`,r);break;case`xlinkActuate`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:xt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Ut.get(n)||n,xt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:Vt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Rt(e,``+r);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[tt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):xt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:wd(`error`,e),wd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:wd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}Nt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in wd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ft(e,!!r,n,!0):Ft(e,!!r,t,!1);return;case`textarea`:for(s in wd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}Lt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:wd(`beforetoggle`,e),wd(`toggle`,e),wd(`cancel`,e),wd(`close`,e);break;case`iframe`:case`object`:wd(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)wd(xd[r],e);break;case`image`:wd(`error`,e),wd(`load`,e);break;case`details`:wd(`toggle`,e);break;case`embed`:case`source`:case`link`:wd(`error`,e),wd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(Ht(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}Mt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ft(e,!!n,n?[]:``,!1):Ft(e,!!n,t,!0)):Ft(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}It(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(Ht(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);
vendor: 4,464 bytes, line 9
9for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Jd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Yd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);zp(t)}function of(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:sf(n),st(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(r){if(!e[ot])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}}else if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;
vendor: 17,956 bytes, line 9
9e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function vf(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);st(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=F.d;F.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=Cu();return e||t}function Tf(e){var t=lt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+jt(n.imageSizes)+`"]`)):i+=`[href="`+jt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}bf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+jt(r)+`"][href="`+jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!bf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),ft(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=dt(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);ft(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=dt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),ft(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=dt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),ft(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=se.current)?Sf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=dt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=dt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bf.set(e,n),o||zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Bf(n),n=dt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+jt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),ft(t),e.head.appendChild(t))}function Bf(e){return`[src="`+jt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+jt(n.href)+`"]`);if(r)return t.instance=r,ft(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ft(r),Bd(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,ft(o),o;r=Rf(n),(a=bf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,ft(a),a):(r=n,(a=bf.get(o))&&(r=f({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ft(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Uf(r,n.precedence,e));return t.instance}function Uf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ot]||a[et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ft(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Wf(r,i),a=a.createElement(`link`),ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ep.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ip={$$typeof:C,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function ap(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ti(3,null,null,t),e.current=a,a.stateNode=e,t=ta(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Pa(a),e}function sp(e){return e?(e=$r,e):$r}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ia(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=La(e,r,t),n!==null&&(vu(n,e,t),Ra(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=Xr(e,67108864);t!==null&&vu(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=gu();t=Ye(t);var n=Xr(e,t);n!==null&&vu(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,gp(e,t,n,r)}finally{F.p=a,P.T=i}}function hp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,gp(e,t,n,r)}finally{F.p=a,P.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)kd(e,t,r,vp,n),kp(e,r);else if(jp(i,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var a=lt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Rl&6)&&(iu=be()+500,cd(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&vu(s,a,2),Cu(),up(a,2)}if(a=_p(r),a===null&&kd(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function _p(e){return e=Jt(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=ct(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vp=e,null}function bp(e){switch(e){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(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Dp=[],Op=`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 kp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Ap(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=lt(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jp(e,t,n,r,i){switch(t){case`focusin`:return Sp=Ap(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Ap(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Ap(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Ap(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Ap(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Mp(e){var t=ct(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Np(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);qt=r,n.target.dispatchEvent(r),qt=null}else return t=lt(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Pp(e,t,n){Np(e)&&n.delete(t)}function Fp(){xp=!1,Sp!==null&&Np(Sp)&&(Sp=null),Cp!==null&&Np(Cp)&&(Cp=null),wp!==null&&Np(wp)&&(wp=null),Tp.forEach(Pp),Ep.forEac
vendor: 4,424 bytes, line 9
9h(Pp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fp)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(yp(r||n)===null)continue;break}var a=lt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Sp!==null&&Ip(Sp,e),Cp!==null&&Ip(Cp,e),wp!==null&&Ip(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&(n=Dp[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Dp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[tt]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Vp(e){this._internalRoot=e}Hp.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,gu(),e,t,null,null)},Hp.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),Cu(),t[G]=null}};function Hp(e){this._internalRoot=e}Hp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&t!==0&&t<Dp[n].priority;n++);Dp.splice(n,0,e),n===0&&Mp(e)}};var Up=n.version;if(Up!==`19.2.3`)throw Error(i(527,Up,`19.2.3`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Wp={bundleType:0,version:`19.2.3`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.3`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gp.isDisabled&&Gp.supportsFiber)try{ke=Gp.inject(Wp),Ae=Gp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=op(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[G]=t.current,Dd(e),new Vp(t)}})),y=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=v()}))(),b=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),x=s(((e,t)=>{t.exports=b()})),S=h(),C=(0,S.createContext)({});function w(e){let t=(0,S.useRef)(null);return t.current===null&&(t.current=e()),t.current}var T=typeof window<`u`,E=T?S.useLayoutEffect:S.useEffect,D=(0,S.createContext)(null);function O(e,t){e.indexOf(t)===-1&&e.push(t)}function k(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}
9var A=(e,t,n)=>n>t?t:n<e?e:n,j={},ee=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function M(e){return typeof e==`object`&&!!e}var te=e=>/^0[^.\s]+$/u.test(e);function N(e){let t;return()=>(t===void 0&&(t=e()),t)}var P=e=>e,F=(e,t)=>n=>t(e(n)),I=(...e)=>e.reduce(F),ne=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},re=class{constructor(){this.subscriptions=[]}add(e){return O(this.subscriptions,e),()=>k(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},L=e=>e*1e3,ie=e=>e/1e3;function R(e,t){return t?e*(1e3/t):0}var ae=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,oe=1e-7,se=12;function ce(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ae(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>oe&&++s<se);return o}function z(e,t,n,r){if(e===t&&n===r)return P;let i=t=>ce(t,0,1,e,n);return e=>e===0||e===1?e:ae(i(e),t,r)}var le=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ue=e=>t=>1-e(1-t),de=z(.33,1.53,.69,.99),fe=ue(de),B=le(fe),pe=e=>(e*=2)<1?.5*fe(e):.5*(2-2**(-10*(e-1))),me=e=>1-Math.sin(Math.acos(e)),he=ue(me),V=le(me),H=z(.42,0,1,1),U=z(0,0,.58,1),ge=z(.42,0,.58,1),_e=e=>Array.isArray(e)&&typeof e[0]!=`number`,ve=e=>Array.isArray(e)&&typeof e[0]==`number`,ye={linear:P,easeIn:H,easeInOut:ge,easeOut:U,circIn:me,circInOut:V,circOut:he,backIn:fe,backInOut:B,backOut:de,anticipate:pe},be=e=>typeof e==`string`,xe=e=>{if(ve(e)){e.length;let[t,n,r,i]=e;return z(t,n,r,i)}else if(be(e))return ye[e],`${e}`,ye[e];return e},Se=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Ce={value:null,addProjectionMetrics:null};function we(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&Ce.value&&Ce.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var Te=40;function Ee(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Se.reduce((e,n)=>(e[n]=we(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=j.useManualTiming?i.timestamp:performance.now();n=!1,j.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,Te),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Se.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Se.length;t++)o[Se[t]].cancel(e)},state:i,steps:o}}var{schedule:De,cancel:Oe,state:ke,steps:Ae}=Ee(typeof requestAnimationFrame<`u`?requestAnimationFrame:P,!0),je;function Me(){je=void 0}var Ne={now:()=>(je===void 0&&Ne.set(ke.isProcessing||j.useManualTiming?ke.timestamp:performance.now()),je),set:e=>{je=e,queueMicrotask(Me)}},Pe={layout:0,mainThread:0,waapi:0},Fe=e=>t=>typeof t==`string`&&t.startsWith(e),Ie=Fe(`--`),Le=Fe(`var(--`),Re=e=>Le(e)?ze.test(e.split(`/*`)[0].trim()):!1,ze=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,W={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Be={...W,transform:e=>A(0,1,e)},Ve={...W,default:1},He=e=>Math.round(e*1e5)/1e5,Ue=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function We(e){return e==null}var Ge=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ke=(e,t)=>n=>!!(typeof n==`string`&&Ge.test(n)&&n.startsWith(e)||t&&!We(n)&&Object.prototype.hasOwnProperty.call(n,t)),qe=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Ue);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Je=e=>A(0,255,e),Ye={...W,transform:e=>Math.round(Je(e))},Xe={test:Ke(`rgb`,`red`),parse:qe(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ye.transform(e)+`, `+Ye.transform(t)+`, `+Ye.transform(n)+`, `+He(Be.transform(r))+`)`};function Ze(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alph
9a:i?parseInt(i,16)/255:1}}var Qe={test:Ke(`#`),parse:Ze,transform:Xe.transform},$e=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),et=$e(`deg`),tt=$e(`%`),G=$e(`px`),nt=$e(`vh`),rt=$e(`vw`),it=(()=>({...tt,parse:e=>tt.parse(e)/100,transform:e=>tt.transform(e*100)}))(),at={test:Ke(`hsl`,`hue`),parse:qe(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+tt.transform(He(t))+`, `+tt.transform(He(n))+`, `+He(Be.transform(r))+`)`},ot={test:e=>Xe.test(e)||Qe.test(e)||at.test(e),parse:e=>Xe.test(e)?Xe.parse(e):at.test(e)?at.parse(e):Qe.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Xe.transform(e):at.transform(e),getAnimatableNone:e=>{let t=ot.parse(e);return t.alpha=0,ot.transform(t)}},st=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ct(e){return isNaN(e)&&typeof e==`string`&&(e.match(Ue)?.length||0)+(e.match(st)?.length||0)>0}var lt=`number`,ut=`color`,dt=`var`,ft=`var(`,pt="${}",mt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ht(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(mt,e=>(ot.test(e)?(r.color.push(a),i.push(ut),n.push(ot.parse(e))):e.startsWith(ft)?(r.var.push(a),i.push(dt),n.push(e)):(r.number.push(a),i.push(lt),n.push(parseFloat(e))),++a,pt)).split(pt),indexes:r,types:i}}function gt(e){return ht(e).values}function _t(e){let{split:t,types:n}=ht(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===lt?i+=He(e[a]):t===ut?i+=ot.transform(e[a]):i+=e[a]}return i}}var vt=e=>typeof e==`number`?0:ot.test(e)?ot.getAnimatableNone(e):e;function yt(e){let t=gt(e);return _t(e)(t.map(vt))}var bt={test:ct,parse:gt,createTransformer:_t,getAnimatableNone:yt};function xt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function St({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=xt(s,r,e+1/3),a=xt(s,r,e),o=xt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Ct(e,t){return n=>n>0?t:e}var wt=(e,t,n)=>e+(t-e)*n,Tt=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Et=[Qe,Xe,at],Dt=e=>Et.find(t=>t.test(e));function Ot(e){let t=Dt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===at&&(n=St(n)),n}var kt=(e,t)=>{let n=Ot(e),r=Ot(t);if(!n||!r)return Ct(e,t);let i={...n};return e=>(i.red=Tt(n.red,r.red,e),i.green=Tt(n.green,r.green,e),i.blue=Tt(n.blue,r.blue,e),i.alpha=wt(n.alpha,r.alpha,e),Xe.transform(i))},At=new Set([`none`,`hidden`]);function jt(e,t){return At.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Mt(e,t){return n=>wt(e,t,n)}function Nt(e){return typeof e==`number`?Mt:typeof e==`string`?Re(e)?Ct:ot.test(e)?kt:Lt:Array.isArray(e)?Pt:typeof e==`object`?ot.test(e)?kt:Ft:Ct}function Pt(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Nt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Ft(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Nt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function It(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Lt=(e,t)=>{let n=bt.createTransformer(t),r=ht(e),i=ht(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?At.has(e)&&!i.values.length||At.has(t)&&!r.values.length?jt(e,t):I(Pt(It(r,i),i.values),n):(`${e}${t}`,Ct(e,t))};function Rt(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?wt(e,t,n):Nt(e)(e,t)}var zt=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>De.update(t,e),stop:()=>Oe(t),now:()=>ke.isProcessing?ke.timestamp:Ne.now()}},Bt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Vt=2e4;function Ht(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Ut(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Ht(r),Vt);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:ie(i)}}var Wt=5;function Gt(e,t,n){let r=Math.max(t-Wt,0);return R(n-e(r),t-r)}var Kt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},qt=.001;function Jt({duration:e=Kt.duration,bounce:t=Kt.bounce,velocity:n=Kt.velocity,mass:r=Kt.mass}){let i,a;Kt.maxDuration;let o=1-t;o=A(Kt.minDamping,Kt.maxDamping,o),e=A(Kt.minDuration,Kt.maxDuration,ie(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Zt(t,o),c=Math.exp(-i);
9return qt-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Zt(t**2,o);return(-i(t)+qt>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-qt+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Xt(i,a,s);if(e=L(e),isNaN(c))return{stiffness:Kt.stiffness,damping:Kt.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Yt=12;function Xt(e,t,n){let r=n;for(let n=1;n<Yt;n++)r-=e(r)/t(r);return r}function Zt(e,t){return e*Math.sqrt(1-t*t)}var Qt=[`duration`,`bounce`],$t=[`stiffness`,`damping`,`mass`];function en(e,t){return t.some(t=>e[t]!==void 0)}function tn(e){let t={velocity:Kt.velocity,stiffness:Kt.stiffness,damping:Kt.damping,mass:Kt.mass,isResolvedFromDuration:!1,...e};if(!en(e,$t)&&en(e,Qt))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*A(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Kt.mass,stiffness:i,damping:a}}else{let n=Jt(e);t={...t,...n,mass:Kt.mass},t.isResolvedFromDuration=!0}return t}function nn(e=Kt.visualDuration,t=Kt.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=tn({...n,velocity:-ie(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=ie(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Kt.restSpeed.granular:Kt.restSpeed.default,i||=v?Kt.restDelta.granular:Kt.restDelta.default;let y;if(h<1){let e=Zt(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?L(m):Gt(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Ht(b),Vt),t=Bt(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}nn.applyToOptions=e=>{let t=Ut(e,100,nn);return e.ease=t.ease,e.duration=L(t.duration),e.type=`keyframes`,e};function rn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=nn({keyframes:[f.value,m(f.value)],velocity:Gt(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function an(e,t,n){let r=[],i=n||j.mix||Rt,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=I(Array.isArray(t)?t[n]||P:t,a)),r.push(a)}return r}function on(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=an(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ne(e[r],e[r+1],n);return s[r](i)};return n?t=>l(A(e[0],e[a-1],t)):l}function sn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ne(0,t,r);e.push(wt(n,1,i))}}function cn(e){let t=[0];return sn(t,e.length-1),t}function ln(e,t){return e.map(e=>e*t)}function un(e,t){return e.map(()=>t||ge).splice(0,e.length-1)}function dn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=_e(r)?r.map(xe):xe(r),a={done:!1,value:t[0]},o=on(ln(n&&n.length===t.length?n:cn(t),e),t,{ease:Array.isArray(i)?i:un(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var fn=e=>e!==null;function pn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(fn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var mn={decay:rn,inertia:rn,tween:dn,keyframes:dn,spring:nn};function hn(e){typeof e.type==`string`&&(e.type=mn[e.type])}var gn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},_n=e=>e/100,vn=class extends gn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Ne.now()&&this.tick(Ne.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Pe.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;hn(e);let{type:t=dn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||dn;s!==dn&&typeof o[0]!=`number`&&(this.mixKeyframes=I(_n,Rt(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Ht(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=A(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);
9i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==rn&&(b.value=pn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return ie(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ie(e)}get time(){return ie(this.currentTime)}set time(e){e=L(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Ne.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=ie(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=zt,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Ne.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,Pe.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function yn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var bn=e=>e*180/Math.PI,xn=e=>Cn(bn(Math.atan2(e[1],e[0]))),Sn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:xn,rotateZ:xn,skewX:e=>bn(Math.atan(e[1])),skewY:e=>bn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cn=e=>(e%=360,e<0&&(e+=360),e),wn=xn,Tn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),En=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Dn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Tn,scaleY:En,scale:e=>(Tn(e)+En(e))/2,rotateX:e=>Cn(bn(Math.atan2(e[6],e[5]))),rotateY:e=>Cn(bn(Math.atan2(-e[2],e[0]))),rotateZ:wn,rotate:wn,skewX:e=>bn(Math.atan(e[4])),skewY:e=>bn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function On(e){return e.includes(`scale`)?1:0}function kn(e,t){if(!e||e===`none`)return On(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Dn,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Sn,i=t}if(!i)return On(t);let a=r[t],o=i[1].split(`,`).map(jn);return typeof a==`function`?a(o):o[a]}var An=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return kn(n,t)};function jn(e){return parseFloat(e.trim())}var Mn=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Nn=(()=>new Set(Mn))(),Pn=e=>e===W||e===G,Fn=new Set([`x`,`y`,`z`]),In=Mn.filter(e=>!Fn.has(e));function Ln(e){let t=[];return In.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var Rn={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>kn(t,`x`),y:(e,{transform:t})=>kn(t,`y`)};Rn.translateX=Rn.x,Rn.translateY=Rn.y;var zn=new Set,Bn=!1,Vn=!1,Hn=!1;function Un(){if(Vn){let e=Array.from(zn).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;
9t.forEach(e=>{let t=Ln(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Vn=!1,Bn=!1,zn.forEach(e=>e.complete(Hn)),zn.clear()}function Wn(){zn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vn=!0)})}function Gn(){Hn=!0,Wn(),Un(),Hn=!1}var Kn=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(zn.add(this),Bn||(Bn=!0,De.read(Wn),De.resolveKeyframes(Un))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}yn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),zn.delete(this)}cancel(){this.state===`scheduled`&&(zn.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},qn=e=>e.startsWith(`--`);function Jn(e,t,n){qn(t)?e.style.setProperty(t,n):e.style[t]=n}var Yn=N(()=>window.ScrollTimeline!==void 0),Xn={};function Zn(e,t){let n=N(e);return()=>Xn[t]??n()}var Qn=Zn(()=>{try{document.createElement(`div`).animate({opacity:0}
9,{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),$n=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,er={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:$n([0,.65,.55,1]),circOut:$n([.55,0,1,.45]),backIn:$n([.31,.01,.66,-.59]),backOut:$n([.33,1.53,.69,.99])};function tr(e,t){if(e)return typeof e==`function`?Qn()?Bt(e,t):`ease-out`:ve(e)?$n(e):Array.isArray(e)?e.map(e=>tr(e,t)||er.easeOut):er[e]}function nr(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=tr(s,i);Array.isArray(d)&&(u.easing=d),Ce.value&&Pe.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Ce.value&&p.finished.finally(()=>{Pe.waapi--}),p}function rr(e){return typeof e==`function`&&`applyToOptions`in e}function ir({type:e,...t}){return rr(e)&&Qn()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var ar=class extends gn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ir(e);this.animation=nr(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=pn(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):Jn(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return ie(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ie(e)}get time(){return ie(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=L(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`f
9inished`}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Yn()?(this.animation.timeline=e,P):t(this)}},or={anticipate:pe,backInOut:B,circInOut:V};function sr(e){return e in or}function cr(e){typeof e.ease==`string`&&sr(e.ease)&&(e.ease=or[e.ease])}var lr=10,ur=class extends ar{constructor(e){cr(e),hn(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new vn({...a,autoplay:!1}),s=L(this.finishedTime??this.time);t.setWithVelocity(o.sample(s-lr).value,o.sample(s).value,lr),o.stop()}},dr=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(bt.test(e)||e===`0`)&&!e.startsWith(`url(`));function fr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function pr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=dr(i,t),s=dr(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:fr(e)||(n===`spring`||rr(n))&&r}function mr(e){e.duration=0,e.type=`keyframes`}var hr=new Set([`opacity`,`clipPath`,`filter`,`transform`]),gr=N(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function _r(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return gr()&&n&&hr.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var vr=40,yr=class extends gn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ne.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||Kn)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Ne.now(),pr(e,i,a,o)||((j.instantAnimations||!s)&&l?.(pn(e,n,t)),e[0]=e[e.length-1],mr(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>vr?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&_r(u)?new ur({...u,element:u.motionValue.owner.current}):new vn(u);d.finished.then(()=>this.notifyFinished()).catch(P),this.pendingTimeline&&=(this.stopTimeline=d.attachTimeline(this.pendingTimeline),void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Gn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},br=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xr(e){let t=br.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Sr(e,t,n=1){`${e}`;let[r,i]=xr(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ee(e)?parseFloat(e):e}return Re(i)?Sr(i,t,n+1):i}function Cr(e,t){return e?.[t]??e?.default??e}var wr=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Mn]),Tr={test:e=>e===`auto`,parse:e=>e},Er=e=>t=>t.test(e),Dr=[W,G,tt,et,rt,nt,Tr],Or=e=>Dr.find(Er(e));function kr(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||te(e)}var Ar=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function jr(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Ue)||[];if(!r)return e;let i=n.replace(r,``),a=Ar.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var Mr=/\b([a-z-]*)\(.*?\)/gu,Nr={...bt,getAnimatableNone:e=>{let t=e.match(Mr);return t?t.map(jr).join(` `):e}},Pr={...W,transform:Math.round},Fr={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,radius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,backgroundPositionX:G,backgroundPositionY:G,rotate:et,rotateX:et,rotateY:et,rotateZ:et,scale:Ve,scaleX:Ve,scaleY:Ve,scaleZ:Ve,skew:et,skewX:et,skewY:et,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:Be,originX:it,originY:it,originZ:G,zIndex:Pr,fillOpacity:Be,strokeOpacity:Be,numOctaves:Pr},Ir={...Fr,color:ot,backgroundColor:ot,outlineColor:ot,fill:ot,stroke:ot,borderColor:ot,borderTopColor:ot,borderRightColor:ot,borderBottomColor:ot,borderLeftColor:ot,filter:Nr,WebkitFilter:Nr},Lr=e=>Ir[e];function Rr(e,t){let n=Lr(e);return n!==Nr&&(n=bt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var zr=new Set([`auto`,`none`,`0`]);function Br(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!zr.has(t)&&ht(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Rr(n,i)}var Vr=class extends Kn{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Re(r))){let i=Sr(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!wr.has(n)||e.length!==2)return;let[r,i]=e,a=Or(r),o=Or(i);if(a!==o)if(Pn(a)&&Pn(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Rn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||kr(e[t]))&&n.push(t);n.length&&Br(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Rn[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Rn[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEac
9h(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function Hr(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}var Ur=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Wr(e){return M(e)&&`offsetHeight`in e}var Gr=30,Kr=e=>!isNaN(parseFloat(e)),qr={current:void 0},Jr=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Ne.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Ne.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Kr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new re);let n=this.events[e].add(t);return e===`change`?()=>{n(),De.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return qr.current&&qr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Ne.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Gr)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Gr);return R(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Yr(e,t){return new Jr(e,t)}var{schedule:Xr,cancel:Zr}=Ee(queueMicrotask,!1),Qr={x:!1,y:!1};function $r(){return Qr.x||Qr.y}function ei(e){return e===`x`||e===`y`?Qr[e]?null:(Qr[e]=!0,()=>{Qr[e]=!1}):Qr.x||Qr.y?null:(Qr.x=Qr.y=!0,()=>{Qr.x=Qr.y=!1})}function ti(e,t){let n=Hr(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function ni(e){return!(e.pointerType===`touch`||$r())}function ri(e,t,n={}){let[r,i,a]=ti(e,n),o=e=>{if(!ni(e))return;let{target:n}=e,r=t(n,e);if(typeof r!=`function`||!n)return;let a=e=>{ni(e)&&(r(e),n.removeEventListener(`pointerleave`,a))};n.addEventListener(`pointerleave`,a,i)};return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var ii=(e,t)=>t?e===t?!0:ii(e,t.parentElement):!1,ai=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,oi=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function si(e){return oi.has(e.tagName)||e.tabIndex!==-1}var ci=new WeakSet;function li(e){return t=>{t.key===`Enter`&&e(t)}}function ui(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var di=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=li(()=>{if(ci.has(n))return;ui(n,`down`);let e=li(()=>{ui(n,`up`)});
9n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>ui(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function fi(e){return ai(e)&&!$r()}function pi(e,t,n={}){let[r,i,a]=ti(e,n),o=e=>{let r=e.currentTarget;if(!fi(e))return;ci.add(r);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),ci.has(r)&&ci.delete(r),fi(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||ii(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Wr(e)&&(e.addEventListener(`focus`,e=>di(e,i)),!si(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function mi(e){return M(e)&&`ownerSVGElement`in e}function hi(e){return mi(e)&&e.tagName===`svg`}var gi=e=>!!(e&&e.getVelocity),_i=[...Dr,ot,bt],vi=e=>_i.find(Er(e)),yi=(0,S.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function bi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function xi(...e){return t=>{let n=!1,r=e.map(e=>{let r=bi(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():bi(e[t],null)}}}}function Si(...e){return S.useCallback(xi(...e),e)}var K=x(),Ci=class extends S.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,n=Wr(e)&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}};function wi({children:e,isPresent:t,anchorX:n,root:r}){let i=(0,S.useId)(),a=(0,S.useRef)(null),o=(0,S.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=(0,S.useContext)(yi),c=Si(a,e?.ref);return(0,S.useInsertionEffect)(()=>{let{width:e,height:c,top:l,left:u,right:d}=o.current;if(t||!a.current||!e||!c)return;let f=n===`left`?`left: ${u}`:`right: ${d}`;a.current.dataset.motionPopId=i;let p=document.createElement(`style`);s&&(p.nonce=s);let m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(` 10 [data-motion-pop-id="${i}"] { 11 position: absolute !important; 12 width: ${e}px !important; 13 height: ${c}px !important; 14 ${f}px !important; 15 top: ${l}px !important; 16 } 17 `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),(0,K.jsx)(Ci,{isPresent:t,childRef:a,sizeRef:o,children:S.cloneElement(e,{ref:c})})}var Ti=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,root:c})=>{let l=w(Ei),u=(0,S.useId)(),d=!0,f=(0,S.useMemo)(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(let e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))}),[n,l,r]);return a&&d&&(f={...f}),(0,S.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[n]),S.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o===`popLayout`&&(e=(0,K.jsx)(wi,{isPresent:n,anchorX:s,root:c,children:e})),(0,K.jsx)(D.Provider,{value:f,children:e})};function Ei(){return new Map}function Di(e=!0){let t=(0,S.useContext)(D);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,S.useId)();(0,S.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,S.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Oi=e=>e.key||``;function ki(e){let t=[];return S.Children.forEach(e,e=>{(0,S.isValidElement)(e)&&t.push(e)}),t}var Ai=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,root:c})=>{let[l,u]=Di(o),d=(0,S.useMemo)(()=>ki(e),[e]),f=o&&!l?[]:d.map(Oi),p=(0,S.useRef)(!0),m=(0,S.useRef)(d),h=w(()=>new Map),[g,_]=(0,S.useState)(d),[v,y]=(0,S.useState)(d);E(()=>{p.current=!1,m.current=d;for(let e=0;e<v.length;e++){let t=Oi(v[e]);f.includes(t)?h.delete(t):h.get(t)!==!0&&h.set(t,!1)}}
17,[v,f.length,f.join(`-`)]);let b=[];if(d!==g){let e=[...d];for(let t=0;t<v.length;t++){let n=v[t],r=Oi(n);f.includes(r)||(e.splice(t,0,n),b.push(n))}return a===`wait`&&b.length&&(e=b),y(ki(e)),_(d),null}let{forceRender:x}=(0,S.useContext)(C);return(0,K.jsx)(K.Fragment,{children:v.map(e=>{let g=Oi(e),_=o&&!l?!1:d===v||f.includes(g);return(0,K.jsx)(Ti,{isPresent:_,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:_?void 0:()=>{if(h.has(g))h.set(g,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(x?.(),y(m.current),o&&u?.(),r&&r())},anchorX:s,children:e},g)})})},ji=(0,S.createContext)({strict:!1}),Mi={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Ni={};for(let e in Mi)Ni[e]={isEnabled:t=>Mi[e].some(e=>!!t[e])};function Pi(e){for(let t in e)Ni[t]={...Ni[t],...e[t]}}var Fi=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function Ii(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Fi.has(e)}var Li=c({default:()=>Ri}),Ri,zi=o((()=>{throw Ri={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),Bi=e=>!Ii(e);function Vi(e){typeof e==`function`&&(Bi=t=>t.startsWith(`on`)?!Ii(t):e(t))}try{Vi((zi(),d(Li)).default)}catch{}function Hi(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(Bi(i)||n===!0&&Ii(i)||!t&&!Ii(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var Ui=(0,S.createContext)({});function Wi(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Gi(e){return typeof e==`string`||Array.isArray(e)}var Ki=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],qi=[`initial`,...Ki];function Ji(e){return Wi(e.animate)||qi.some(t=>Gi(e[t]))}function Yi(e){return!!(Ji(e)||e.variants)}function Xi(e,t){if(Ji(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Gi(t)?t:void 0,animate:Gi(n)?n:void 0}}return e.inherit===!1?{}:t}function Zi(e){let{initial:t,animate:n}=Xi(e,(0,S.useContext)(Ui));return(0,S.useMemo)(()=>({initial:t,animate:n}),[Qi(t),Qi(n)])}function Qi(e){return Array.isArray(e)?e.join(` `):e}function $i(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var ea={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(G.test(e))e=parseFloat(e);else return e;return`${$i(e,t.target.x)}% ${$i(e,t.target.y)}%`}},ta={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=bt.parse(e);if(i.length>5)return r;let a=bt.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=wt(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},na={borderRadius:{...ea,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:ea,borderTopRightRadius:ea,borderBottomLeftRadius:ea,borderBottomRightRadius:ea,boxShadow:ta};function ra(e,{layout:t,layoutId:n}){return Nn.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!na[e]||e===`opacity`)}var ia={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},aa=Mn.length;function oa(e,t,n){let r=``,i=!0;for(let a=0;a<aa;a++){let o=Mn[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=Ur(s,Fr[o]);if(!c){i=!1;let t=ia[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function sa(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Nn.has(e)){o=!0;continue}else if(Ie(e)){i[e]=n;continue}else{let t=Ur(n,Fr[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=oa(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var ca=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function la(e,t,n){for(let r in t)!gi(t[r])&&!ra(r,n)&&(e[r]=t[r])}function ua({transformTemplate:e},t){return(0,S.useMemo)(()=>{let n=ca();return sa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function da(e,t){let n=e.style||{},r={};return la(r,n,e),Object.assign(r,ua(e,t)),r}function fa(e,t){let n={},r=da(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}
17`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var pa={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ma={offset:`strokeDashoffset`,array:`strokeDasharray`};function ha(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?pa:ma;e[a.offset]=G.transform(-r);let o=G.transform(t),s=G.transform(n);e[a.array]=`${o} ${s}`}function ga(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(sa(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&ha(d,i,a,o,!1)}var _a=()=>({...ca(),attrs:{}}),va=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ya(e,t,n,r){let i=(0,S.useMemo)(()=>{let n=_a();return ga(n,t,va(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};la(t,e.style,e),i.style={...t,...i.style}}return i}var ba=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function xa(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(ba.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sa(e,t,n,{latestValues:r},i,a=!1){let o=(xa(e)?ya:fa)(t,r,i,e),s=Hi(t,typeof e==`string`,a),c=e===S.Fragment?{}:{...s,...o,ref:n},{children:l}=t,u=(0,S.useMemo)(()=>gi(l)?l.get():l,[l]);return(0,S.createElement)(e,{...c,children:u})}function Ca(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function wa(e,t,n,r){if(typeof t==`function`){let[i,a]=Ca(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Ca(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Ta(e){return gi(e)?e.get():e}function Ea({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Da(n,r,i,e),renderState:t()}}function Da(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Ta(a[e]);let{initial:o,animate:s}=e,c=Ji(e),l=Yi(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Wi(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=wa(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Oa=e=>(t,n)=>{let r=(0,S.useContext)(Ui),i=(0,S.useContext)(D),a=()=>Ea(e,t,r,i);return n?a():w(a)};function ka(e,t,n){let{style:r}=e,i={};for(let a in r)(gi(r[a])||t.style&&gi(t.style[a])||ra(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}var Aa=Oa({scrapeMotionValuesFromProps:ka,createRenderState:ca});function ja(e,t,n){let r=ka(e,t,n);for(let n in e)if(gi(e[n])||gi(t[n])){let t=Mn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Ma=Oa({scrapeMotionValuesFromProps:ja,createRenderState:_a}),Na=Symbol.for(`motionComponentSymbol`);function Pa(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Fa(e,t,n){return(0,S.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):Pa(n)&&(n.current=r))},[t])}var Ia=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),La=`data-`+Ia(`framerAppearId`),Ra=(0,S.createContext)({});function za(e,t,n,r,i){let{visualElement:a}=(0,S.useContext)(Ui),o=(0,S.useContext)(ji),s=(0,S.useContext)(D),c=(0,S.useContext)(yi).reducedMotion,l=(0,S.useRef)(null);r||=o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));let u=l.current,d=(0,S.useContext)(Ra);u&&!u.projection&&i&&(u.type===`html`||u.type===`svg`)&&Ba(l.current,n,i,d);let f=(0,S.useRef)(!1);(0,S.useInsertionEffect)(()=>{u&&f.current&&u.update(n,s)});let p=n[La],m=(0,S.useRef)(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return E(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),(0,S.useEffect)(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),!1),u.enteringChildren=void 0)}),u}function Ba(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Va(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Pa(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Va(e){if(e)return e.options.allowProjection===!1?Va(e.parent):e.projection}function Ha(e,{forwardMotionProps:t=!1}={},n,r){n&&Pi(n);let i=xa(e)?Ma:Aa;function a(a,o){let s,c={...(0,S.useContext)(yi),...a,layoutId:Ua(a)},{isStatic:l}=c,u=Zi(a),d=i(a,l);if(!l&&T){Wa(c,n);let t=Ga(c);s=t.MeasureLayout,u.visualElement=za(e,d,c,r,t.ProjectionNode)}return(0,K.jsxs)(Ui.Provider,{value:u,children:[s&&u.visualElement?(0,K.jsx)(s,{visualElement:u.visualElement,...c}):null,Sa(e,a,Fa(d,u.visualElement,o),d,l,t)]})}a.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let o=(0,S.forwardRef)(a);return o[Na]=e,o}function Ua({layoutId:e}){let t=(0,S.useContext)(C).id;return t&&e!==void 0?t+`-`+e:e}function Wa(e,t){(0,S.useContext)(ji).strict}function Ga(e){let{drag:t,layout:n}=Ni;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}
17function Ka(e,t){if(typeof Proxy>`u`)return Ha;let n=new Map,r=(n,r)=>Ha(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ha(a,void 0,e,t)),n.get(a))})}function qa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ja({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ya(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Xa(e){return e===void 0||e===1}function Za({scale:e,scaleX:t,scaleY:n}){return!Xa(e)||!Xa(t)||!Xa(n)}function Qa(e){return Za(e)||$a(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $a(e){return eo(e.x)||eo(e.y)}function eo(e){return e&&e!==`0%`}function to(e,t,n){return n+t*(e-n)}function no(e,t,n,r,i){return i!==void 0&&(e=to(e,i,r)),to(e,n,r)+t}function ro(e,t=0,n=1,r,i){e.min=no(e.min,t,n,r,i),e.max=no(e.max,t,n,r,i)}function io(e,{x:t,y:n}){ro(e.x,t.translate,t.scale,t.originPoint),ro(e.y,n.translate,n.scale,n.originPoint)}var ao=.999999999999,oo=1.0000000000001;function so(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&uo(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,io(e,o)),r&&Qa(a.latestValues)&&uo(e,a.latestValues))}t.x<oo&&t.x>ao&&(t.x=1),t.y<oo&&t.y>ao&&(t.y=1)}function co(e,t){e.min+=t,e.max+=t}function lo(e,t,n,r,i=.5){ro(e,t,n,wt(e.min,e.max,i),r)}function uo(e,t){lo(e.x,t.x,t.scaleX,t.scale,t.originX),lo(e.y,t.y,t.scaleY,t.scale,t.originY)}function fo(e,t){return qa(Ya(e.getBoundingClientRect(),t))}function po(e,t,n){let r=fo(e,n),{scroll:i}=t;return i&&(co(r.x,i.offset.x),co(r.y,i.offset.y)),r}var mo=()=>({translate:0,scale:1,origin:0,originPoint:0}),ho=()=>({x:mo(),y:mo()}),go=()=>({min:0,max:0}),_o=()=>({x:go(),y:go()}),vo={current:null},yo={current:!1};function bo(){if(yo.current=!0,T)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>vo.current=e.matches;e.addEventListener(`change`,t),t()}else vo.current=!1}var xo=new WeakMap;function So(e,t,n){for(let r in t){let i=t[r],a=n[r];if(gi(i))e.addValue(r,i);else if(gi(a))e.addValue(r,Yr(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Yr(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Co=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],wo=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Kn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Ne.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,De.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=Ji(t),this.isVariantNode=Yi(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&gi(t)&&t.set(s[e])}}mount(e){this.current=e,xo.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
17h((e,t)=>this.bindToMotionValue(t,e)),yo.current||bo(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`?!0:vo.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),Oe(this.notifyUpdate),Oe(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=Nn.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&De.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Ni){let t=Ni[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_o()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Co.length;t++){let n=Co[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=So(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Yr(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(ee(n)||te(n))?n=parseFloat(n):!vi(n)&&bt.test(t)&&(n=Rr(e,t)),this.setBaseTarget(e,gi(n)?n.get():n)),gi(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=wa(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!gi(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new re),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Xr.render(this.render)}},To=class extends wo{constructor(){super(...arguments),this.KeyframeResolver=Vr}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;gi(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Eo(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Do(e){return window.getComputedStyle(e)}var Oo=class extends To{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Eo}readValueFromInstance(e,t){if(Nn.has(t))return this.projection?.isProjecting?On(t):An(e,t);{let n=Do(e),r=(Ie(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return fo(e,t)}build(e,t,n){sa(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ka(e,t,n)}},ko=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function Ao(e,t,n,r){for(let n in Eo(e,t,void 0,r),t.attrs)e.setAttribute(ko.has(n)?n:Ia(n),t.attrs[n])}var jo=class extends To{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=_o}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Nn.has(t)){let e=Lr(t);return e&&e.default||0}return t=ko.has(t)?t:Ia(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ja(e,t,n)}
17build(e,t,n){ga(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ao(e,t,n,r)}mount(e){this.isSVGTag=va(e.tagName),super.mount(e)}},Mo=(e,t)=>xa(e)?new jo(t):new Oo(t,{allowProjection:e!==S.Fragment});function No(e,t,n){let r=e.getProps();return wa(r,t,n===void 0?r.custom:n,e)}var Po=e=>Array.isArray(e);function Fo(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yr(n))}function Io(e){return Po(e)?e[e.length-1]||0:e}function Lo(e,t){let{transitionEnd:n={},transition:r={},...i}=No(e,t)||{};for(let t in i={...i,...n},i)Fo(e,t,Io(i[t]))}function Ro(e){return!!(gi(e)&&e.add)}function zo(e,t){let n=e.getValue(`willChange`);if(Ro(n))return n.add(t);if(!n&&j.WillChange){let n=new j.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Bo(e){return e.props[La]}var Vo=e=>e!==null;function Ho(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(Vo),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}var Uo={type:`spring`,stiffness:500,damping:25,restSpeed:10},Wo=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Go={type:`keyframes`,duration:.8},Ko={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},qo=(e,{keyframes:t})=>t.length>2?Go:Nn.has(e)?e.startsWith(`scale`)?Wo(t[1]):Uo:Ko;function Jo({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var Yo=(e,t,n,r={},i,a)=>o=>{let s=Cr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=L(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Jo(s)||Object.assign(u,qo(e,u)),u.duration&&=L(u.duration),u.repeatDelay&&=L(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(mr(u),u.delay===0&&(d=!0)),(j.instantAnimations||j.skipAnimations)&&(d=!0,mr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ho(u.keyframes,s);if(e!==void 0){De.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new vn(u):new yr(u)};function Xo({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Zo(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&Xo(l,t))continue;let o={delay:n,...Cr(a||{},t)},u=r.get();if(u!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let n=Bo(e);if(n){let e=window.MotionHandoffAnimation(n,t,De);e!==null&&(o.startTime=e,d=!0)}}zo(e,t),r.start(Yo(t,r,i,e.shouldReduceMotion&&wr.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{De.update(()=>{o&&Lo(e,o)})}),c}function Qo(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function $o(e,t,n={}){let r=No(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Zo(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return es(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function es(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push($o(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Qo(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function ts(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>$o(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=$o(e,t,n);else{let i=typeof t==`function`?No(e,t,n.custom):t;r=Promise.all(Zo(e,i,n))}return r.then(()=>
17{e.notify(`AnimationComplete`,t)})}function ns(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var rs=qi.length;function is(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&is(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<rs;n++){let r=qi[n],i=e.props[r];(Gi(i)||i===!1)&&(t[r]=i)}return t}var as=[...Ki].reverse(),os=Ki.length;function ss(e){return t=>Promise.all(t.map(({animation:t,options:n})=>ts(e,t,n)))}function cs(e){let t=ss(e),n=ds(),r=!0,i=t=>(n,r)=>{let i=No(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=is(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<os;t++){let f=as[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=Gi(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||Wi(m)||typeof m==`boolean`)continue;let v=ls(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},T=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Po(t)&&Po(n)?!ns(t,n):t!==n,r?t==null?l.add(e):T(e):t!==void 0&&l.has(e)?T(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let E=_&&v;y&&(!E||b)&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=No(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Qo(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=No(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=ds()}}}function ls(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!ns(t,e):!1}function us(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ds(){return{animate:us(!0),whileInView:us(),whileHover:us(),whileTap:us(),whileDrag:us(),whileFocus:us(),exit:us()}}var fs=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},ps=class extends fs{constructor(e){super(e),e.animationState||=cs(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Wi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},ms=0,hs={animation:{Feature:ps},exit:{Feature:class extends fs{constructor(){super(...arguments),this.id=ms++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function gs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function _s(e){return{point:{x:e.pageX,y:e.pageY}}}var vs=e=>t=>ai(t)&&e(t,_s(t));function ys(e,t,n,r){return gs(e,t,vs(n),r)}var bs=1e-4,xs=1-bs,Ss=1+bs,Cs=.01,ws=0-Cs,Ts=0+Cs;function Es(e){return e.max-e.min}function Ds(e,t,n){return Math.abs(e-t)<=n}function Os(e,t,n,r=.5){e.origin=r,e.originPoint=wt(t.min,t.max,e.origin),e.scale=Es(n)/Es(t),e.translate=wt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xs&&e.scale<=Ss||isNaN(e.scale))&&(e.scale=1),(e.translate>=ws&&e.translate<=Ts||isNaN(e.translate))&&(e.translate=0)}function ks(e,t,n,r){Os(e.x,t.x,n.x,r?r.originX:void 0),Os(e.y,t.y,n.y,r?r.originY:void 0)}
vendor: 9,565 bytes, line 17
17function As(e,t,n){e.min=n.min+t.min,e.max=e.min+Es(t)}function js(e,t,n){As(e.x,t.x,n.x),As(e.y,t.y,n.y)}function Ms(e,t,n){e.min=t.min-n.min,e.max=e.min+Es(t)}function Ns(e,t,n){Ms(e.x,t.x,n.x),Ms(e.y,t.y,n.y)}function Ps(e){return[e(`x`),e(`y`)]}var Fs=({current:e})=>e?e.ownerDocument.defaultView:null,Is=(e,t)=>Math.abs(e-t);function Ls(e,t){let n=Is(e.x,t.x),r=Is(e.y,t.y);return Math.sqrt(n**2+r**2)}var Rs=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Vs(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Ls(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=ke;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=zs(t,this.transformPagePoint),De.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Vs(e.type===`pointercancel`?this.lastMoveEventInfo:zs(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!ai(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let o=zs(_s(e),this.transformPagePoint),{point:s}=o,{timestamp:c}=ke;this.history=[{...s,timestamp:c}];let{onSessionStart:l}=t;l&&l(e,Vs(o,this.history)),this.removeListeners=I(ys(this.contextWindow,`pointermove`,this.handlePointerMove),ys(this.contextWindow,`pointerup`,this.handlePointerUp),ys(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Oe(this.updatePoint)}};function zs(e,t){return t?{point:t(e.point)}:e}function Bs(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vs({point:e},t){return{point:e,delta:Bs(e,Us(t)),offset:Bs(e,Hs(t)),velocity:Ws(t,.1)}}function Hs(e){return e[0]}function Us(e){return e[e.length-1]}function Ws(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Us(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>L(t)));)n--;if(!r)return{x:0,y:0};let a=ie(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Gs(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?wt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?wt(n,e,r.max):Math.min(e,n)),e}function Ks(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function qs(e,{top:t,left:n,bottom:r,right:i}){return{x:Ks(e.x,n,i),y:Ks(e.y,t,r)}}function Js(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Ys(e,t){return{x:Js(e.x,t.x),y:Js(e.y,t.y)}}function Xs(e,t){let n=.5,r=Es(e),i=Es(t);return i>r?n=ne(t.min,t.max-r,e.min):r>i&&(n=ne(e.min,e.max-i,t.min)),A(0,1,n)}function Zs(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Qs=.35;function $s(e=Qs){return e===!1?e=0:e===!0&&(e=Qs),{x:ec(e,`left`,`right`),y:ec(e,`top`,`bottom`)}}function ec(e,t,n){return{min:tc(e,t),max:tc(e,n)}}function tc(e,t){return typeof e==`number`?e:e[t]||0}var nc=new WeakMap,rc=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_o(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(_s(e).point)},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ei(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ps(e=>{let t=this.getAxisMotionValue(e).get()||0;if(tt.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Es(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&De.postRender(()=>i(e,t)),zo(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=ac(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Ps(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new Rs(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Fs(this.visualElement)})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&De.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!ic(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Gs(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Pa(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=qs(n.layoutBox,e):this.constraints=!1,this.elastic=$s(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Ps(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Zs(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Pa(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=po(n,r.root,this.visualElement.getTransformPagePoint()),a=Ys(r.layout.layoutBox,i);if(t){let e=t(Ja(a));this.hasMutatedConstraints=!!e,e&&(a=qa(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Ps(o=>{if(!ic(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return zo(this.visualElement,e),n.start(Yo(e,n,0,t,this.visualElement,!1))}stopAnimation(){Ps(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ps(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Ps(t=>{let{drag:n}=this.getProps();if(!ic(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t];i.set(e[t]-wt(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Pa(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Ps(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Xs({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ps(t=>{if(!ic(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(wt(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;nc.set(this.visualElement,this);let e=this.visualElement.current,t=ys(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}
17=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();Pa(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),De.read(n);let a=gs(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Ps(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Qs,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function ic(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ac(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var oc=class extends fs{constructor(e){super(e),this.removeGroupControls=P,this.removeListeners=P,this.controls=new rc(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||P}unmount(){this.removeGroupControls(),this.removeListeners()}},sc=e=>(t,n)=>{e&&De.postRender(()=>e(t,n))},cc=class extends fs{constructor(){super(...arguments),this.removePointerDownListener=P}onPointerDown(e){this.session=new Rs(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fs(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:sc(e),onStart:sc(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&De.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ys(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},uc=!1,dc=class extends S.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),uc&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,uc=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||De.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Xr.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;uc=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function fc(e){let[t,n]=Di(),r=(0,S.useContext)(C);return(0,K.jsx)(dc,{...e,layoutGroup:r,switchLayoutGroup:(0,S.useContext)(Ra),isPresent:t,safeToRemove:n})}function pc(e,t,n){let r=gi(e)?e:Yr(e);return r.start(Yo(``,r,t,n)),r.animation}var mc=(e,t)=>e.depth-t.depth,hc=class{constructor(){this.children=[],this.isDirty=!1}add(e){O(this.children,e),this.isDirty=!0}remove(e){k(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(mc),this.isDirty=!1,this.children.forEach(e)}};function gc(e,t){let n=Ne.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Oe(r),e(a-t))};return De.setup(r,!0),()=>Oe(r)}var _c=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],vc=_c.length,yc=e=>typeof e==`string`?parseFloat(e):e,bc=e=>typeof e==`number`||G.test(e);function xc(e,t,n,r,i,a){i?(e.opacity=wt(0,n.opacity??1,Cc(r)),e.opacityExit=wt(t.opacity??1,0,wc(r))):a&&(e.opacity=wt(t.opacity??1,n.opacity??1,r));for(let i=0;i<vc;i++){let a=`border${_c[i]}Radius`,o=Sc(t,a),s=Sc(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||bc(o)===bc(s)?(e[a]=Math.max(wt(yc(o),yc(s),r),0),(tt.test(s)||tt.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=wt(t.rotate||0,n.rotate||0,r))}function Sc(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Cc=Tc(0,.5,he),wc=Tc(.5,.95,P);function Tc(e,t,n){return r=>r<e?0:r>t?1:n(ne(e,t,r))}function Ec(e,t){e.min=t.min,e.max=t.max}function Dc(e,t){Ec(e.x,t.x),Ec(e.y,t.y)}function Oc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function kc(e,t,n,r,i){return e-=t,e=to(e,1/n,r),i!==void 0&&(e=to(e,1/i,r)),e}function Ac(e,t=0,n=1,r=.5,i,a=e,o=e){if(tt.test(t)&&(t=parseFloat(t),t=wt(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;
vendor: 5,270 bytes, line 17
17let s=wt(a.min,a.max,r);e===a&&(s-=t),e.min=kc(e.min,t,n,s,i),e.max=kc(e.max,t,n,s,i)}function jc(e,t,[n,r,i],a,o){Ac(e,t[n],t[r],t[i],t.scale,a,o)}var Mc=[`x`,`scaleX`,`originX`],Nc=[`y`,`scaleY`,`originY`];function Pc(e,t,n,r){jc(e.x,t,Mc,n?n.x:void 0,r?r.x:void 0),jc(e.y,t,Nc,n?n.y:void 0,r?r.y:void 0)}function Fc(e){return e.translate===0&&e.scale===1}function Ic(e){return Fc(e.x)&&Fc(e.y)}function Lc(e,t){return e.min===t.min&&e.max===t.max}function Rc(e,t){return Lc(e.x,t.x)&&Lc(e.y,t.y)}function zc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Bc(e,t){return zc(e.x,t.x)&&zc(e.y,t.y)}function Vc(e){return Es(e.x)/Es(e.y)}function Hc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Uc=class{constructor(){this.members=[]}add(e){O(this.members,e),e.scheduleRender()}remove(e){if(k(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Wc(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Gc={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Kc=[``,`X`,`Y`,`Z`],qc=1e3,Jc=0;function Yc(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Xc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Bo(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,De,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Xc(r)}function Zc({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Jc++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ce.value&&(Gc.nodes=Gc.calculatedTargetDeltas=Gc.calculatedProjections=0),this.nodes.forEach(el),this.nodes.forEach(sl),this.nodes.forEach(cl),this.nodes.forEach(tl),Ce.addProjectionMetrics&&Ce.addProjectionMetrics(Gc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new hc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new re),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=mi(t)&&!hi(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;De.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=gc(i,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEac
17h(ol)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||hl,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Bc(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Cr(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||ol(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Oe(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ll),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Xc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(rl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(il);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(al),this.nodes.forEach(Qc),this.nodes.forEach($c)):this.nodes.forEach(il),this.clearAllSnapshots();let e=Ne.now();ke.delta=A(0,1e3/60,e-ke.timestamp),ke.timestamp=e,ke.isProcessing=!0,Ae.update.process(ke),Ae.preRender.process(ke),Ae.render.process(ke),ke.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nl),this.sharedNodes.forEach(ul)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,De.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){De.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Es(this.snapshot.measuredBox.x)&&!Es(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=_o(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ic(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Qa(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),yl(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return _o();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(xl))){let{scroll:e}=this.root;e&&(co(t.x,e.offset.x),co(t.y,e.offset.y))}return t}removeElementScroll(e){let t=_o();if(Dc(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Dc(t,e),co(t.x,i.offset.x),co(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=_o();Dc(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&uo(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),Qa(r.latestValues)&&uo(n,r.latestValues)}return Qa(this.latestValues)&&uo(n,this.latestValues),n}removeTransform(e){let t=_o();Dc(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!Qa(n.latestValues))continue;Za(n.latestValues)&&n.updateSnapshot();let r=_o();Dc(r,n.measurePageBox()),Pc(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return Qa(this.latestValues)&&Pc(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ke.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;
17if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=ke.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_o(),this.targetWithTransforms=_o()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),js(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Dc(this.target,this.layout.layoutBox),io(this.target,this.targetDelta)):Dc(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Ce.value&&Gc.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Za(this.parent.latestValues)||$a(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_o(),this.relativeTargetOrigin=_o(),Ns(this.relativeTargetOrigin,t,n),Dc(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===ke.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Dc(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;so(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=_o());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Oc(this.prevProjectionDelta.x,this.projectionDelta.x),Oc(this.prevProjectionDelta.y,this.projectionDelta.y)),ks(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Hc(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Ce.value&&Gc.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ho(),this.projectionDelta=ho(),this.projectionDeltaWithTransform=ho()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=ho();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=_o(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(ml));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;dl(a.x,e.x,n),dl(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ns(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),pl(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Rc(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=_o(),Dc(d,this.relativeTarget)),s&&(this.animationValues=i,xc(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Oe(this.pendingAnimation),void 0),this.pendingAnimation=De.update(()=>{lc.hasAnimatedSinceResize=!0,Pe.layout++,this.motionValue||=Yr(0),this.currentAnimation=pc(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Pe.layout--},onComplete:()=>{Pe.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(qc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&bl(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||_o();let t=Es(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Es(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Dc(t,n),uo(t,i),ks(this.projectionDeltaWithTransform,this.layoutCorrected,t,i
17)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Uc),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Yc(`z`,e,r,this.animationValues);for(let t=0;t<Kc.length;t++)Yc(`rotate${Kc[t]}`,e,r,this.animationValues),Yc(`skew${Kc[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Ta(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Ta(t?.pointerEvents)||``),this.hasProjected&&!Qa(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Wc(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,na){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=na[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Ta(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(rl),this.root.sharedNodes.clear()}}}function Qc(e){e.updateLayout()}function $c(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?Ps(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Es(r);r.min=n[e].min,r.max=r.min+i}):bl(i,t.layoutBox,n)&&Ps(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Es(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=ho();ks(o,n,t.layoutBox);let s=ho();a?ks(s,e.applyTransform(r,!0),t.measuredBox):ks(s,n,t.layoutBox);let c=!Ic(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=_o();Ns(o,t.layoutBox,i.layoutBox);let s=_o();Ns(s,n,a.layoutBox),Bc(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function el(e){Ce.value&&Gc.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function tl(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function nl(e){e.clearSnapshot()}function rl(e){e.clearMeasurements()}function il(e){e.isLayoutDirty=!1}function al(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ol(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function sl(e){e.resolveTargetDelta()}function cl(e){e.calcProjection()}
17function ll(e){e.resetSkewAndRotation()}function ul(e){e.removeLeadSnapshot()}function dl(e,t,n){e.translate=wt(t.translate,0,n),e.scale=wt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function fl(e,t,n,r){e.min=wt(t.min,n.min,r),e.max=wt(t.max,n.max,r)}function pl(e,t,n,r){fl(e.x,t.x,n.x,r),fl(e.y,t.y,n.y,r)}function ml(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var hl={duration:.45,ease:[.4,0,.1,1]},gl=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),_l=gl(`applewebkit/`)&&!gl(`chrome/`)?Math.round:P;function vl(e){e.min=_l(e.min),e.max=_l(e.max)}function yl(e){vl(e.x),vl(e.y)}function bl(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ds(Vc(t),Vc(n),.2)}function xl(e){return e!==e.root&&e.scroll?.wasRoot}var Sl=Zc({attachResizeListener:(e,t)=>gs(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cl={current:void 0},wl=Zc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cl.current){let e=new Sl({});e.mount(window),e.setOptions({layoutScroll:!0}),Cl.current=e}return Cl.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Tl={pan:{Feature:cc},drag:{Feature:oc,ProjectionNode:wl,MeasureLayout:fc}};function El(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&De.postRender(()=>i(t,_s(t)))}var Dl=class extends fs{mount(){let{current:e}=this.node;e&&(this.unmount=ri(e,(e,t)=>(El(this.node,t,`Start`),e=>El(this.node,e,`End`))))}unmount(){}},Ol=class extends fs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=I(gs(this.node.current,`focus`,()=>this.onFocus()),gs(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function kl(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&De.postRender(()=>i(t,_s(t)))}var Al=class extends fs{mount(){let{current:e}=this.node;e&&(this.unmount=pi(e,(e,t)=>(kl(this.node,t,`Start`),(e,{success:t})=>kl(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},jl=new WeakMap,Ml=new WeakMap,Nl=e=>{let t=jl.get(e.target);t&&t(e)},Pl=e=>{e.forEach(Nl)};function Fl({root:e,...t}){let n=e||document;Ml.has(n)||Ml.set(n,{});let r=Ml.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Pl,{root:e,...t})),r[i]}function Il(e,t,n){let r=Fl(t);return jl.set(e,n),r.observe(e),()=>{jl.delete(e),r.unobserve(e)}}var Ll={some:0,all:1},Rl=class extends fs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ll[r]};return Il(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(zl(e,t))&&this.startObserver()}unmount(){}};function zl({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Bl={inView:{Feature:Rl},tap:{Feature:Al},focus:{Feature:Ol},hover:{Feature:Dl}},Vl={layout:{ProjectionNode:wl,MeasureLayout:fc}},Hl=Ka({...hs,...Bl,...Tl,...Vl},Mo),Ul=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Wl=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Gl=e=>{let t=Wl(e);return t.charAt(0).toUpperCase()+t.slice(1)},Kl=(...e)=>
17e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ql=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},Jl={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`},Yl=(0,S.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,S.createElement)(`svg`,{ref:c,...Jl,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Kl(`lucide`,i),...!a&&!ql(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,S.createElement)(e,t)),...Array.isArray(a)?a:[a]])),q=(e,t)=>{let n=(0,S.forwardRef)(({className:n,...r},i)=>(0,S.createElement)(Yl,{ref:i,iconNode:t,className:Kl(`lucide-${Ul(Gl(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Gl(e),n},Xl=q(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Zl=q(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ql=q(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),$l=q(`battery`,[[`path`,{d:`M 22 14 L 22 10`,key:`nqc4tb`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),eu=q(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),tu=q(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),nu=q(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),ru=q(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),iu=q(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),au=q(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ou=q(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),su=q(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),cu=q(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),lu=q(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),uu=q(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),du=q(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),fu=q(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),pu=q(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),mu=q(`credit-card`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),hu=q(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),gu=q(`delete`,[[`path`,{d:`M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z`,key:`1yo7s0`}],[`path`,{d:`m12 9 6 6`,key:`anjzzh`}],[`path`,{d:`m18 9-6 6`,key:`1fp51s`}]]),_u=q(`disc`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),vu=q(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),yu=q(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),bu=q(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),xu=q(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Su=q(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Cu=q(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),wu=q(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Tu=q(`github`,[[`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`,key:`tonef`}],[`path`,{d:`M9 18c-4.51 2-5-2-7-2`,key:`9comsn`}]]),Eu=q(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Du=q(`grid-3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Ou=q(`hard-drive`,[[`line`,{x1:`22`,x2:`2`,y1:`12`,y2:`12`,key:`1y58io`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}],[`line`,{x1:`6`,x2:`6.01`,y1:`16`,y2:`16`,key:`sgf278`}],[`line`,{x1:`10`,x2:`10.01`,y1:`16`,y2:`16`,key:`1l4acy`}]]),ku=q(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Au=q(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),ju=q(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}
17]]),Mu=q(`instagram`,[[`rect`,{width:`20`,height:`20`,x:`2`,y:`2`,rx:`5`,ry:`5`,key:`2e1cvw`}],[`path`,{d:`M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z`,key:`9exkf1`}],[`line`,{x1:`17.5`,x2:`17.51`,y1:`6.5`,y2:`6.5`,key:`r4j83e`}]]),Nu=q(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Pu=q(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Fu=q(`linkedin`,[[`path`,{d:`M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z`,key:`c2jq9f`}],[`rect`,{width:`4`,height:`12`,x:`2`,y:`9`,key:`mk3on5`}],[`circle`,{cx:`4`,cy:`4`,r:`2`,key:`bt5ra8`}]]),Iu=q(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Lu=q(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),Ru=q(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),zu=q(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Bu=q(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Vu=q(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),Hu=q(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),Uu=q(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Wu=q(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Gu=q(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Ku=q(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),qu=q(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),Ju=q(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),Yu=q(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Xu=q(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Zu=q(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),Qu=q(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),$u=q(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ed=q(`rotate-ccw`,[[`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`}]]),td=q(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),nd=q(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),rd=q(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}
17]]),id=q(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ad=q(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),od=q(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),sd=q(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),cd=q(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),ld=q(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]),ud=q(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]),dd=q(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),fd=q(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),pd=q(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),md=q(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),hd=q(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),gd=q(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),_d=q(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),vd=q(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),yd=q(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),bd=q(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);const xd=` 18<strong>ALISH AQADIL</strong> 19<em>Fullstack Developer</em> 20 21<strong>Astana, Kazakhstan</strong> | +7 776 234 9535 | [email protected] | [email protected] | github.com/AQADIL 22 23<strong>SUMMARY</strong> 24Product-driven <strong>Fullstack Developer</strong> and <strong>EdTech founder</strong>. Specialized in architecting <em>scalable web ecosystems</em>, <em>real-time systems</em>, and <em>high-performance applications</em> from the ground up. 25Proven ability to bridge complex business logic with seamless user experiences, transitioning from conceptual design to secure, production-ready cloud infrastru
25cture. 26 27 28<strong>TECHNICAL SKILLS</strong> 29 30<strong>Frontend:</strong> React 18, Next.js, JavaScript, Tailwind CSS, Headless UI, Lucide React, React Hot Toast 31<strong>3D, Motion & Visuals:</strong> Three.js, React Three Fiber (R3F), Drei, Framer Motion, Canvas API 32<strong>State Management & Architecture:</strong> Zustand, React Context API 33<strong>Backend & APIs:</strong> Node.js, Express.js, NestJS, Golang (Go), Python, REST API, WebSockets 34<strong>Database & Cloud Infrastructure:</strong> Firebase Ecosystem (Firestore, Auth, Cloud Functions, Realtime Database), PostgreSQL, MySQL, SQLite3 35<strong>Build Tools & DevOps:</strong> Vite, Rolldown (Vite core), Git, GitHub Flow, ESLint, PostCSS 36<strong>Specialized Libraries & Integrations:</strong> Monaco Editor, Recharts (Data Visualization), i18n (react-i18next), KaTeX (Math Rendering), Plyr (Media Integration) 37 38 39<strong>PROJECTS</strong> 40 41<strong>AkadilEDU</strong> | <em>Founder & Developer</em> 42akadiledu.web.app 43⢠Architected and launched a comprehensive <strong>Progressive Web App (PWA)</strong> to prepare students for the <strong>UBT</strong> in mathematics and programming. 44⢠Engineered a <em>native-like mobile ecosystem</em> featuring automated <strong>push notifications</strong>, video lesson delivery, and interactive assignments. 45⢠Designed custom UI/UX and implemented seamless <strong>real-time database synchronization</strong> for instant content updates and zero-lag user interaction. 46 47 48<strong>JudGO</strong> | <em>Founder & Developer</em> 49judgo.tech 50⢠Developed a <strong>real-time competitive programming arena</strong> enabling live coding battles and instant algorithmic problem validation. 51⢠Built a high-speed, secure <strong>backend execution environment using Golang</strong> to safely compile, isolate, and evaluate user code on the fly. 52⢠Integrated <strong>WebSockets and Monaco Editor</strong> to provide a robust, <em>zero-latency coding experience</em> with live leaderboards. 53 54 55<strong>AqadilOS</strong> | <em>Founder & Developer</em> 56aqadilos.web.app 57⢠Engineered an interactive, <strong>browser-based portfolio</strong> designed as a fully functional <em>cloud operating system</em>. 58⢠Managed complex application states, window mechanics, and DOM manipulation to showcase <em>advanced frontend architecture</em> and problem-solving capabilities. 59 60 61<strong>EXPERIENCE & EDUCATION</strong> 62<strong>LLP "WELL-DONE"</strong> | <em>Developer</em> | June 2026 - Present 63<strong>Astana IT University</strong> 64<em>Software Engineering</em> 65<strong>EdTech Specialist & UNT (Ò°ÐТ) Tutor</strong> | <em>Math & Programming</em> 66Prepared students for the Ò°ÐТ (National Entrance Exam). 67`;var Sd=`aqadil-os-notepad-resume-content`,Cd=`aqadil-os-notepad-resume-meta`;function wd(){let[e,t]=(0,S.useState)(``),[n,r]=(0,S.useState)(`RESUME.txt`),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(``);(0,S.useEffect)(()=>{if(typeof window>`u`){t(xd);return}try{let e=window.localStorage.getItem(Sd),n=window.localStorage.getItem(Cd);if(n)try{let e=JSON.parse(n);e&&typeof e.fileName==`string`&&r(e.fileName)}catch{}e!==null&&e.trim()!==``?t(e):t(xd)}catch(e){console.error(`Failed to load Notepad content from storage`,e),t(xd)}},[]);let u=e=>{l(e),e&&setTimeout(()=>{l(t=>t===e?``:t)},2e3)},d=()=>{try{typeof window<`u`&&(window.localStorage.setItem(Sd,e),window.localStorage.setItem(Cd,JSON.stringify({fileName:n}))),a(!1),u(`Saved`)}catch(e){console.error(`Failed to save Notepad content`,e),u(`Save failed`)}s(!1)},f=()=>{i&&typeof window<`u`&&!window.confirm(`Discard unsaved changes and create a new file?`)||(t(``),r(`Untitled.txt`),a(!1),u(`New file`),s(!1))},p=()=>{if(typeof window>`u`)return;let t=window.prompt(`Save As`,n.replace(/\.[^./]+$/,``)+`.txt`);if(t){try{let n=new Blob([e||``],{type:`text/plain;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r),u(`TXT file downloaded`)}catch(e){console.error(`Failed to download TXT`,e),u(`Download failed`)}s(!1)}},m=()=>{i&&typeof window<`u`&&!window.confirm(`Discard unsaved changes and restore original RESUME.txt?`)||(t(xd),r(`RESUME.txt`),a(!1),u(`Restored RESUME.txt`),s(!1))},h=()=>{u(`Edit via keyboard: Ctrl+Z, Ctrl+Y, Ctrl+C, Ctrl+V`)},g=()=>{u(`Format: Monospace font, wrapping enabled`)},_=()=>{u(`View: Status bar is always visible`)},v=()=>{u(`This Notepad shows your resume text`)},y=()=>
67{if(typeof window>`u`)return;let t=(n||`RESUME`).replace(/\\/g,``).replace(/\//g,``).replace(/\s+/g,`-`).replace(/\.[^./]+$/,``)||`RESUME`,r=(e||``).replace(/&/g,`&`).replace(/<strong>/g,`<strong>`).replace(/<\/strong>/g,`</strong>`).replace(/<em>/g,`<em>`).replace(/<\/em>/g,`</em>`),i=window.open(``,`_blank`);if(!i){u(`Allow popups to print PDF`),s(!1);return}i.document.write(`<!DOCTYPE html> 68<html lang="en"> 69 <head> 70 <meta charset="UTF-8" /> 71 <title>${t}</title> 72 <style> 73 * { box-sizing: border-box; } 74 body { 75 margin: 0; 76 min-height: 100vh; 77 font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; 78 background: #020617; 79 color: #f9fafb; 80 display: flex; 81 align-items: center; 82 justify-content: center; 83 padding: 32px 16px; 84 } 85 .card { 86 width: 100%; 87 max-width: 920px; 88 border-radius: 24px; 89 padding: 40px 48px; 90 background: linear-gradient(145deg, #020617ee, #020617aa); 91 border: 1px solid rgba(148, 163, 184, 0.35); 92 box-shadow: 93 0 22px 45px rgba(15, 23, 42, 0.85), 94 0 0 0 1px rgba(15, 23, 42, 0.9); 95 position: relative; 96 } 97 .pill { 98 display: inline-flex; 99 align-items: center; 100 gap: 8px; 101 padding: 6px 14px; 102 border-radius: 999px; 103 font-size: 10px; 104 letter-spacing: .12em; 105 text-transform: uppercase; 106 color: #a5b4fc; 107 background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.08)); 108 border: 1px solid rgba(59, 130, 246, 0.4); 109 margin-bottom: 20px; 110 backdrop-filter: blur(8px); 111 } 112 .pill-dot { 113 width: 6px; 114 height: 6px; 115 border-radius: 999px; 116 background: linear-gradient(135deg, #22c55e, #16a34a); 117 box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22); 118 } 119 .title { 120 font-size: clamp(28px, 3vw, 36px); 121 font-weight: 800; 122 letter-spacing: .05em; 123 text-transform: uppercase; 124 margin: 0 0 8px; 125 background: linear-gradient(135deg, #f9fafb, #e5e7eb); 126 -webkit-background-clip: text; 127 -webkit-text-fill-color: transparent; 128 background-clip: text; 129 } 130 .subtitle { 131 margin: 0 0 24px; 132 font-size: 14px; 133 color: #9ca3af; 134 font-weight: 400; 135 letter-spacing: .01em; 136 } 137 .divider { 138 height: 1px; 139 width: 100%; 140 background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.6), transparent); 141 margin: 20px 0 24px; 142 } 143 .content { 144 white-space: pre-wrap; 145 font-family: 'Calibri', 'Arial', 'Helvetica Neue', sans-serif; 146 font-size: 13px; 147 line-height: 1.6; 148 letter-spacing: 0; 149 color: #e5e7eb; 150 } 151 .content strong { 152 font-weight: 600; 153 color: #f9fafb; 154 } 155 .content em { 156 font-style: italic; 157 color: #cbd5e1; 158 } 159 .footer { 160 margin-top: 32px; 161 display: flex; 162 justify-content: space-between; 163 align-items: center; 164 font-size: 11px; 165 color: #6b7280; 166 } 167 .badge { 168 padding: 4px 10px; 169 border-radius: 999px; 170 border: 1px solid rgba(148, 163, 184, 0.4); 171 background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05)); 172 color: #93c5fd; 173 font-weight: 500; 174 } 175 .photo-container { 176 position: absolute; 177 top: 24px; 178 right: 24px; 179 } 180 .photo { 181 width: 140px; 182 height: auto; 183 border-radius: 12px; 184 border: 2px solid transparent; 185 background: linear-gradient(#020617, #020617) padding-box, 186 linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899) border-box; 187 padding: 2px; 188 } 189 .photo img { 190 border-radius: 10px; 191 width: 100%; 192 height: auto; 193 display: block; 194 } 195 @media print { 196 @page { margin: 12mm; size: A4; } 197 * { -webkit-print-color-adjust: exact !important; color-adjust: exact !important; } 198 body { 199 background: white !important; 200 color: black !important; 201 margin: 0; 202 padding: 0; 203 } 204 .card { 205 background: white !important; 206 box-shadow: none !important; 207 border: 1px solid #e5e7eb !important; 208 max-width: 100%; 209 width: 100%; 210 padding: 20px 24px !important; 211 border-radius: 8px !important; 212 } 213 .pill { 214 color: #3730a3 !important; 215 background: linear-gradient(135deg, rgba(55, 48, 163, 0.12), rgba(55, 48, 163, 0.06)) !important; 216 border-color: #c7d2fe !important; 217 font-size: 9px !important; 218 padding: 4px 10px !important; 219 margin-bottom: 16px !important; 220 } 221 .pill-dot { 222 background: linear-gradient(135deg, #16a34a, #15803d) !important; 223 box-shadow: none !important; 224 } 225 .title { 226 color: black !important; 227 font-size: 22px !important; 228 margin: 0 0 6px !important; 229 background: none !important; 230 -webkit-text-fill-color: black !important; 231 } 232 .subtitle { 233 color: #6b7280 !important; 234 font-size: 12px !important; 235 margin: 0 0 16px !important; 236 } 237 .divider { 238 background: linear-gradient(90deg, transparent, #d1d5db, transparent) !important; 239 margin: 16px 0 20px !important; 240 } 241 .content { 242 color: #111827 !important; 243 font-family: 'Calibri', 'Arial', 'Helvetica Neue', sans-serif !important; 244 font-size: 9.5px !important; 245 line-height: 1.35 !important; 246 white-space: pre-wrap !important; 247 word-wrap: break-word !important; 248 letter-spacing: -0.01em !important; 249 } 250 .content strong { 251 font-weight: 600 !important; 252 color: #000000 !important; 253 } 254 .content em { 255 font-style: italic !important; 256 color: #374151 !important; 257 } 258 .footer { 259 color: #6b7280 !important; 260 margin-top: 20px !important; 261 font-size: 9px !important; 262 } 263 .badge { 264 background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03)) !important; 265 border-color: #d1d5db !important; 266 color: #374151 !important; 267 font-size: 9px !important; 268 padding: 3px 8px !important; 269 } 270 .photo-container { 271 position: absolute !important; 272 top: 20px !important; 273 right: 20px !important; 274 } 275 .photo { 276 width: 100px !important; 277 height: auto !important; 278 border-radius: 8px !important; 279 border: 1px solid #d1d5db !important; 280 background: none !important; 281 padding: 0 !important; 282 } 283 } 284 </style> 285 </head> 286 <body> 287 <main class="card" aria-label="Resume document"> 288 <div class="pill">
289 <span class="pill-dot"></span> 290 <span>See You Space Cowboy...</span> 291 </div> 292 <h1 class="title">${t}</h1> 293 <p class="subtitle">Exported from your AqadilOS Notepad</p> 294 <div class="photo-container"> 295 <div class="photo"> 296 <img src="/me.jpg" alt="Profile photo" onerror="this.src='/me.jpg'" /> 297 </div> 298 </div> 299 <div class="divider"></div> 300 <section class="content">${r}</section> 301 <div class="footer"> 302 <span class="badge">A true warrior needs no sword</span> 303 <span>Designed in AqadilOS</span> 304 </div> 305 </main> 306 <script> 307 window.onload = () => { 308 setTimeout(() => { 309 window.print(); 310 window.close(); 311 }, 300); 312 }; 313 <\/script> 314 </body> 315</html>`),i.document.close(),u(`Print dialog opened â save as PDF`),s(!1)};return(0,K.jsxs)(`div`,{className:`h-full bg-[#1e1e1e] text-[#d4d4d4] font-mono text-[13px] flex flex-col`,onClick:()=>s(!1),children:[(0,K.jsx)(`style`,{children:` 316 .notepad-content strong { 317 font-weight: 700; 318 color: #ffffff; 319 } 320 .notepad-content em { 321 font-style: italic; 322 color: #a8dadc; 323 } 324 `}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4 px-4 py-1 text-xs bg-[#2d2d2d] border-b border-[#1e1e1e] text-[#cccccc] relative select-none`,children:[(0,K.jsx)(`button`,{type:`button`,className:`hover:text-white cursor-default`,onClick:e=>{e.stopPropagation(),s(e=>!e)},children:`File`}),(0,K.jsx)(`button`,{type:`button`,className:`hover:text-white cursor-default`,onClick:e=>{e.stopPropagation(),h()},children:`Edit`}),(0,K.jsx)(`button`,{type:`button`,className:`hover:text-white cursor-default`,onClick:e=>{e.stopPropagation(),g()},children:`Format`}),(0,K.jsx)(`button`,{type:`button`,className:`hover:text-white cursor-default`,onClick:e=>{e.stopPropagation(),_()},children:`View`}),(0,K.jsx)(`button`,{type:`button`,className:`hover:text-white cursor-default`,onClick:e=>{e.stopPropagation(),v()},children:`Help`}),o&&(0,K.jsxs)(`div`,{className:`absolute top-full left-2 mt-1 w-44 bg-[#2d2d2d] border border-[#1e1e1e] rounded shadow-lg z-20 py-1`,children:[(0,K.jsx)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-xs text-[#eeeeee] hover:bg-[#3a3a3a]`,onClick:e=>{e.stopPropagation(),f()},children:`New`}),(0,K.jsx)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-xs text-[#eeeeee] hover:bg-[#3a3a3a]`,onClick:e=>{e.stopPropagation(),d()},children:`Save`}),(0,K.jsx)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-xs text-[#eeeeee] hover:bg-[#3a3a3a]`,onClick:e=>{e.stopPropagation(),p()},children:`Save As TXT`}),(0,K.jsx)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-xs text-[#eeeeee] hover:bg-[#3a3a3a]`,onClick:e=>{e.stopPropagation(),y()},children:`Download PDF`}),(0,K.jsx)(`div`,{className:`border-t border-[#1e1e1e] my-1`}),(0,K.jsx)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-xs text-[#eeeeee] hover:bg-[#3a3a3a]`,onClick:e=>{e.stopPropagation(),m()},children:`Restore RESUME.txt`})]})]}),(0,K.jsx)(`div`,{className:`flex-1 p-6 md:p-8 flex justify-center overflow-auto`,children:(0,K.jsxs)(`div`,{className:`w-full max-w-3xl bg-[#1b1b1b] border border-[#2a2a2a] rounded-lg shadow-[0_0_0_1px_rgba(0,0,0,0.8)] overflow-hidden flex flex-col`,children:[(0,K.jsxs)(`div`,{className:`px-5 py-3 border-b border-[#2a2a2a] bg-[#222222] text-xs text-[#999999] flex justify-between items-center`,children:[(0,K.jsxs)(`span`,{children:[n,` - Notepad`,i?` *`:``]}),(0,K.jsx)(`span`,{className:`hidden sm:inline`,children:`UTF-8 | Windows (CRLF)`})]}),(0,K.jsx)(`div`,{className:`w-full flex-1 min-h-[260px] bg-[#1b1b1b] text-[#d4d4d4] px-5 py-4 leading-relaxed tracking-[0.03em] selection:bg-blue-500/40 selection:text-white text-[13px] outline-none overflow-auto notepad-content`,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,dangerouslySetInnerHTML:{__html:e},onInput:e=>{t(e.currentTarget.innerHTML),a(!0)},style:{whiteSpace:`pre-wrap`,wordWrap:`break-word`}}),(0,K.jsx)(`div`,{className:`px-5 py-2 border-t border-[#2a2a2a] bg-[#202020] text-xs text-[#888888] flex justify-between items-center`,children:(0,K.jsx)(`span`,{children:c||(i?`Unsaved changes`:`All changes saved`)})})]})})]})}const Td={header:{name:`ALISH AQADIL`,role:`Frontend Engineer (React Ecosystem)`,contacts:`Astana | +7 776 234 9535`},summary:`Product-minded Frontend Developer specialized in building complex SPAs and PWAs. I focus on secure architecture, performance, and advanced UI/UX patterns. Founder of AkadilEDU platform. Currently mastering backend architecture with Node.js/Nest.js.`,skills:{frontend:[`React 18 (Hooks, Context)`,`Vite / Next.js`,`Tailwind CSS / Framer Motion`,`PWA Service Workers`,`State Management`],backend:[`Node.js Fundamentals`,`Firebase (Auth, Firestore, Rules)`,`REST API Concepts`],tools:[`Git & GitHub Workflow`,`Figma (UI Design)`,`VS Code Power User`]},project:{name:`AkadilEDU v2 Production`,status:`Live PWA`,description:`A comprehensive Learning Management System built as an installable PWA. It solves real business problems concerning content security and user engagement.`,highlights:[`Architecture: Designed scalable SPA/PWA architecture using React + Vite with offline capabilities and caching strategies`,`Session Management: Built session revocation system to kick unauthorized active sessions in real-time`,`Security: Implemented complex Firestore Security Rules for Role-Based Access Control (RBAC) for Admins and
324Students`,`Authentication: Engineered robust security system using Firebase Auth with device fingerprinting and IP tracking`,`Media Streaming: Built custom video player with encrypted playback controls and granular progress tracking`,`Features: Multi-language support (i18n) with auto-detection, real-time data sync for quiz results and course progress`,`Admin Dashboard: Complete content management system with user analytics and monitoring capabilities`,`Roadmap: Currently wrapping PWA into .apk and .exe executables for broader platform distribution`]}},Ed={name:`AkadilEDU-v2`,files:[{name:`.env`,type:`file`,icon:`FileCode`},{name:`.env.example`,type:`file`,icon:`FileCode`},{name:`.eslintrc.cjs`,type:`file`,icon:`FileCode`},{name:`.firebaserc`,type:`file`,icon:`FileCode`},{name:`.gitignore`,type:`file`,icon:`FileCode`},{name:`package.json`,type:`file`,icon:`FileCode`},{name:`README.md`,type:`file`,icon:`FileCode`},{name:`firebase.json`,type:`file`,icon:`FileCode`},{name:`index.html`,type:`file`,icon:`FileCode`},{name:`vite.config.js`,type:`file`,icon:`FileCode`},{name:`vercel.json`,type:`file`,icon:`FileCode`},{name:`src`,type:`folder`,icon:`FolderOpen`,children:[{name:`App.jsx`,type:`file`,icon:`FileCode`},{name:`main.jsx`,type:`file`,icon:`FileCode`},{name:`i18n.js`,type:`file`,icon:`FileCode`},{name:`api`,type:`folder`,icon:`FolderOpen`,children:[]},{name:`components`,type:`folder`,icon:`FolderOpen`,children:[{name:`AdminGuard.jsx`,type:`file`,icon:`FileCode`},{name:`AppLoader.jsx`,type:`file`,icon:`FileCode`},{name:`AppWrapper.jsx`,type:`file`,icon:`FileCode`},{name:`BlockedAccountOverlay.jsx`,type:`file`,icon:`FileCode`},{name:`CertificateGenerator.jsx`,type:`file`,icon:`FileCode`},{name:`CookieConsent.jsx`,type:`file`,icon:`FileCode`},{name:`CustomVideoPlayer.jsx`,type:`file`,icon:`FileCode`},{name:`EmailVerificationBanner.jsx`,type:`file`,icon:`FileCode`},{name:`Header.jsx`,type:`file`,icon:`FileCode`},{name:`MatchingDrag.jsx`,type:`file`,icon:`FileCode`},{name:`ProfileModal.jsx`,type:`file`,icon:`FileCode`},{name:`SessionRevokedModal.jsx`,type:`file`,icon:`FileCode`},{name:`Sidebar.jsx`,type:`file`,icon:`FileCode`},{name:`ThreeLoader.jsx`,type:`file`,icon:`FileCode`},{name:`UncompletedTestModal.jsx`,type:`file`,icon:`FileCode`},{name:`admin`,type:`folder`,icon:`FolderOpen`,children:[]},{name:`test`,type:`folder`,icon:`FolderOpen`,children:[]}]},{name:`firebase`,type:`folder`,icon:`FolderOpen`,children:[{name:`auth.js`,type:`file`,icon:`FileCode`},{name:`config.js`,type:`file`,icon:`FileCode`},{name:`firestore.js`,type:`file`,icon:`FileCode`},{name:`messaging.js`,type:`file`,icon:`FileCode`},{name:`realtimeDb.js`,type:`file`,icon:`FileCode`},{name:`rtdbApi.js`,type:`file`,icon:`FileCode`},{name:`sessionManager.js`,type:`file`,icon:`FileCode`},{name:`storage.js`,type:`file`,icon:`FileCode`},{name:`testModule.js`,type:`file`,icon:`FileCode`}]},{name:`hooks`,type:`folder`,icon:`FolderOpen`,children:[]},{name:`pages`,type:`folder`,icon:`FolderOpen`,children:[{name:`Admin.jsx`,type:`file`,icon:`FileCode`},{name:`AuthAction.jsx`,type:`file`,icon:`FileCode`},{name:`CourseDetail.jsx`,type:`file`,icon:`FileCode`},{name:`Courses.jsx`,type:`file`,icon:`FileCode`},{name:`EmailVerificationRequired.jsx`,type:`file`,icon:`FileCode`},{name:`ForgotPassword.jsx`,type:`file`,icon:`FileCode`},{name:`Home.jsx`,type:`file`,icon:`FileCode`},{name:`Login.jsx`,type:`file`,icon:`FileCode`},{name:`MyCourses.jsx`,type:`file`,icon:`FileCode`},{name:`NotFound.jsx`,type:`file`,icon:`FileCode`},{name:`Profile.jsx`,type:`file`,icon:`FileCode`},{name:`ResetPassword.jsx`,type:`file`,icon:`FileCode`},{name:`Shop.jsx`,type:`file`,icon:`FileCode`},{name:`Signup.jsx`,type:`file`,icon:`FileCode`},{name:`TestUBT.jsx`,type:`file`,icon:`FileCode`},{name:`VerifyEmail.jsx`,type:`file`,icon:`FileCode`},{name:`admin`,type:`folder`,icon:`FolderOpen`,children:[]}]},{name:`styles`,type:`folder`,icon:`FolderOpen`,children:[]},{name:`utils`,type:`folder`,icon:`FolderOpen`,children:[]}]},{name:`backend`,type:`folder`,icon:`FolderOpen`,children:[{name:`.gitignore`,type:`file`,icon:`FileCode`},{name:`README.md`,type:`file`,icon:`FileCode`},{name:`package.json`,type:`file`,icon:`FileCode`},{name:`server.js`,type:`file`,icon:`FileCode`},{name:`serviceAccountKey.json`,type:`file`,icon:`FileCode`},{name:`vercel.json`,type:`file`,icon:`FileCode`}]},{name:`cloud`,type:`folder`,icon:`FolderOpen`,children:[{name:`functions`,type:`folder`,icon:`FolderOpen`,children:[{name:`aiParserStub.js`,type:`file`,icon:`FileCode`},{name:`index.js`,type:`file`,icon:`FileCode`},{name:`package.json`,type:`file`,icon:`FileCode`}]}]},{name:`functions`,type:`folder`,icon:`FolderOpen`,children:[]},{name:`public`,type:`folder`,icon:`FolderOpen`,children:[{name:`firebase-messaging-sw.js`,type:`file`,icon:`FileCode`},{name:`manifest.json`,type:`file`,icon:`FileCode`},{name:`icons`,type:`folder`,icon:`FolderOpen`,children:[{name:`.gitkeep`,type:`file`,icon:`FileCode`},{name:`icon-144.png`,type:`file`,icon:`FileCode`},{name:`icon-192.png`,type:`file`,icon:`FileCode`},{name:`icon-512.png`,type:`file`,icon:`FileCode`},{name:`logo-пÑозÑаÑнÑй.png`,type:`file`,icon:`FileCode`}]}]},{name:`scripts`,type:`folder`,icon:`FolderOpen`,children:[{name:`.gitignore`,type:`file`,icon:`FileCode`},{name:`initAdmin.js`,type:`file`,icon:`FileCode`},{name:`migrateAuthUsers.js`,type:`file`,icon:`FileCode`},{name:`serviceAccountKey.example.json`,type:`file`,icon:`FileCode`},{name:`serviceAccountKey.json`,type:`file`,icon:`FileCode`}]}]};function Dd({isOpen:e,onClose:t,projectPath:n}){let[r,i]=(0,S.useState)(n),[a,o]=(0,S.useState)(new Set([Ed.name])),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(`list`),[d,f]=(0,S.useState)([n]),[p,m]=(0,S.useState)(0),h=()=>
324{if(!r||!n||!r.startsWith(n))return Ed;let e=r.slice(n.length).replace(/^\\+/,``);if(!e)return Ed;let t=e.split(`\\`).filter(Boolean),i=Ed;for(let e of t){let t=(i.children||i.files||[]).find(t=>t.type===`folder`&&t.name===e);if(t)i=t;else break}return i},g=e=>{let t=`${r}\\${e}`;i(t),_(t);let n=d.slice(0,p+1);n.push(t),f(n),m(n.length-1)},_=e=>{let t=e.split(`\\`).filter(e=>e),n=new Set,r=t[0];for(let e=1;e<t.length;e++)r+=`\\${t[e]}`,n.add(t[e]);o(n)},v=()=>{if(p>0){let e=p-1,t=d[e];i(t),_(t),m(e)}else{let e=r.split(`\\`).filter(e=>e);if(e.length>1){let t=e.slice(0,-1).join(`\\`);i(t),_(t),f([r]),m(0)}}},y=()=>{if(p<d.length-1){let e=p+1,t=d[e];i(t),_(t),m(e)}},b=()=>{let e=r.split(`\\`).filter(e=>e);if(e.length>1){let t=e.slice(0,-1).join(`\\`);i(t),_(t);let n=d.slice(0,p+1);n.push(t),f(n),m(n.length-1)}},x=()=>{i(r)},C=()=>{i(n),_(n);let e=d.slice(0,p+1);e.push(n),f(e),m(e.length-1)},w=e=>{console.log(`Opening file: ${e}`),alert(`Opening file: ${e}`)},T=e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},E=(e,t=0)=>e?e.map((e,n)=>{let r=a.has(e.name),i=e.children&&e.children.length>0;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 px-1 py-0.5 hover:bg-blue-500/20 cursor-pointer text-xs`,style:{paddingLeft:`${t*12+4}px`},onClick:()=>{e.type===`folder`&&(i?T(e.name):g(e.name)),c(e.name)},children:[e.type===`folder`&&(0,K.jsx)(`span`,{className:`w-3 h-3 flex items-center justify-center`,children:i?r?(0,K.jsx)(iu,{size:10}):(0,K.jsx)(ou,{size:10}):(0,K.jsx)(xu,{size:10})}),e.type===`file`&&(0,K.jsx)(bu,{size:10}),(0,K.jsx)(`span`,{className:`truncate text-gray-300`,children:e.name})]}),e.type===`folder`&&i&&r&&E(e.children,t+1)]},`${e.name}-${n}`)}):null;return e?(0,K.jsxs)(`div`,{className:`h-full flex flex-col bg-[#181818] text-gray-300`,children:[(0,K.jsxs)(`div`,{className:`bg-[#252525] border-b border-gray-700 px-2 py-1 flex items-center gap-2`,children:[(0,K.jsx)(`button`,{onClick:v,className:`p-1 hover:bg-[#333333] rounded text-white`,children:(0,K.jsx)(Xl,{size:16})}),(0,K.jsx)(`button`,{onClick:y,className:`p-1 hover:bg-[#333333] rounded text-white`,children:(0,K.jsx)(Zl,{size:16})}),(0,K.jsx)(`button`,{onClick:b,className:`p-1 hover:bg-[#333333] rounded text-white`,children:(0,K.jsx)(Ql,{size:16})}),(0,K.jsx)(`button`,{onClick:x,className:`p-1 hover:bg-[#333333] rounded text-white`,children:(0,K.jsx)(ed,{size:16})}),(0,K.jsx)(`div`,{className:`border-l border-gray-600 h-4 mx-1`}),(0,K.jsx)(`button`,{onClick:C,className:`p-1 hover:bg-[#333333] rounded text-white`,children:(0,K.jsx)(Au,{size:16})}),(0,K.jsxs)(`div`,{className:`flex-1 flex items-center bg-[#333333] border border-gray-600 rounded px-2 py-1`,children:[(0,K.jsx)(nd,{size:16,className:`text-white mr-2`}),(0,K.jsx)(`input`,{type:`text`,value:r,readOnly:!0,className:`flex-1 outline-none text-sm bg-transparent text-gray-300`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 flex overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`w-48 bg-[#202020] border-r border-gray-700 overflow-y-auto p-2`,children:(0,K.jsxs)(`div`,{className:`mb-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 hover:bg-blue-500/20 cursor-pointer font-medium text-sm text-gray-300`,children:[(0,K.jsx)(Ou,{size:14,className:`text-white`}),`Local Disk (C:)`]}),E([Ed],0)]})}),(0,K.jsxs)(`div`,{className:`flex-1 flex flex-col`,children:[(0,K.jsxs)(`div`,{className:`bg-[#252525] border-b border-gray-700 px-2 py-1 flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`button`,{onClick:()=>u(`list`),className:`p-1 rounded ${l===`list`?`bg-blue-600 text-white`:`hover:bg-[#333333] text-black`}`,children:(0,K.jsx)(Iu,{size:16})}),(0,K.jsx)(`button`,{onClick:()=>u(`grid`),className:`p-1 rounded ${l===`grid`?`bg-blue-600 text-white`:`hover:bg-[#333333] text-black`}`,children:(0,K.jsx)(Du,{size:16})})]}),(0,K.jsxs)(`div`,{className:`text-xs text-gray-400`,children:[h().children?.length||h().files?.length||0,` items`]})]}),(0,K.jsx)(`div`,{className:`flex-1 bg-[#181818] overflow-auto`,children:(()=>{let e=h(),t=e.children||e.files||[];return l===`list`?(0,K.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,K.jsx)(`thead`,{className:`bg-[#252525] border-b border-gray-700`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`text-left px-2 py-1 text-gray-400`,children:`N
324ame`}),(0,K.jsx)(`th`,{className:`text-left px-2 py-1 text-gray-400`,children:`Date modified`}),(0,K.jsx)(`th`,{className:`text-left px-2 py-1 text-gray-400`,children:`Type`}),(0,K.jsx)(`th`,{className:`text-left px-2 py-1 text-gray-400`,children:`Size`})]})}),(0,K.jsx)(`tbody`,{children:t.map((e,t)=>(0,K.jsxs)(`tr`,{className:`hover:bg-blue-500/20 cursor-pointer ${s===e.name?`bg-blue-500/30`:``}`,onClick:()=>c(e.name),onDoubleClick:()=>{e.type===`folder`?g(e.name):w(e.name)},children:[(0,K.jsxs)(`td`,{className:`px-2 py-1 border-b border-gray-700 flex items-center gap-2`,children:[e.type===`folder`?(0,K.jsx)(xu,{size:16,className:`text-white`}):(0,K.jsx)(bu,{size:16,className:`text-gray-400`}),(0,K.jsx)(`span`,{className:`text-gray-300`,children:e.name})]}),(0,K.jsx)(`td`,{className:`px-2 py-1 border-b border-gray-700 text-gray-400`,children:`-`}),(0,K.jsx)(`td`,{className:`px-2 py-1 border-b border-gray-700 text-gray-400`,children:e.type===`folder`?`File folder`:`File`}),(0,K.jsx)(`td`,{className:`px-2 py-1 border-b border-gray-700 text-gray-400`,children:`-`})]},`${e.name}-${t}`))})]}):(0,K.jsx)(`div`,{className:`grid grid-cols-8 gap-4 p-4`,children:t.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex flex-col items-center p-2 hover:bg-blue-500/20 cursor-pointer rounded ${s===e.name?`bg-blue-500/30`:``}`,onClick:()=>c(e.name),onDoubleClick:()=>{e.type===`folder`?g(e.name):w(e.name)},children:[e.type===`folder`?(0,K.jsx)(xu,{size:32,className:`text-white`}):(0,K.jsx)(bu,{size:32,className:`text-gray-400`}),(0,K.jsx)(`span`,{className:`text-xs text-center mt-1 truncate w-full text-gray-300`,children:e.name})]},`${e.name}-${t}`))})})()})]})]}),(0,K.jsxs)(`div`,{className:`bg-[#252525] border-t border-gray-700 px-2 py-1 flex items-center justify-between text-xs text-gray-400`,children:[(0,K.jsx)(`div`,{children:s?`${s} selected`:`No items selected`}),(0,K.jsxs)(`div`,{children:[h().children?.length||h().files?.length||0,` objects`]})]})]}):null}function Od({onOpenApp:e}){let[t,n]=(0,S.useState)(`grid`),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)({totalFiles:7905,totalFolders:1234,totalLines:142857,lastUpdated:new Date().toISOString()}),[s,c]=(0,S.useState)(!1),l=e=>{if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/t**+r).toFixed(1))+` `+n[r]},u={name:`AkadilEDU-v2`,version:`2.1.0`,lastModified:`2024-12-22`,status:`Active Development`,technologies:[`React`,`Firebase`,`
324Vite`,`TailwindCSS`],projectPath:`C:\\Users\\ACER\\WebstormProjects\\akadiledu-v2`},d=[{name:`App.jsx`,path:`src/App.jsx`,type:`component`,modified:`2 hours ago`,size:`23.4 KB`},{name:`firebase.js`,path:`src/firebase/config.js`,type:`config`,modified:`5 hours ago`,size:`1.6 KB`},{name:`package.json`,path:`package.json`,type:`config`,modified:`1 day ago`,size:`1.1 KB`},{name:`Login.jsx`,path:`src/pages/Login.jsx`,type:`page`,modified:`2 days ago`,size:`9.8 KB`}],f={frontend:[`React 18.2.0`,`Vite 4.4.5`,`React Router DOM 6.15.0`,`Tailwind CSS 3.3.3`,`Headless UI 1.7.13`,`Lucide React 0.263.1`,`React-i18next 13.0.2`,`i18next 23.4.4`,`React Hot Toast 2.4.1`,`React Hook Form 7.45.4`,`React Player 2.13.0`,`Katex`,`Firebase 10.1.0`],backend:[`Firebase Authentication`,`Firebase Firestore`,`Firebase Storage`,`Firebase Realtime Database`,`Firebase Cloud Functions`,`Firebase Hosting`]},p=[{icon:xu,label:`Open Project Folder`,action:`open-project`,color:`text-blue-400`},{icon:wu,label:`Git Status`,action:`git-status`,color:`text-green-400`},{icon:Yu,label:`Technologies`,action:`technologies`,color:`text-purple-400`}],m=async t=>{switch(console.log(`Quick action: ${t}`),t){case`open-project`:e({id:`windows-explorer`,title:`File Explorer`,component:(0,K.jsx)(Dd,{isOpen:!0,onClose:()=>{},projectPath:u.projectPath}),icon:(0,K.jsx)(xu,{size:16,className:`text-blue-400`}),props:{projectPath:u.projectPath}});break;case`git-status`:window.open(`https://github.com/AQADIL/akadiledu-v2-1`,`_blank`);break;case`technologies`:c(!0);break;default:console.log(`Unknown action:`,t)}},h=d.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())||e.path.toLowerCase().includes(r.toLowerCase())||e.type.toLowerCase().includes(r.toLowerCase()));return a.totalFolders-5,(0,K.jsx)(`div`,{className:`h-full bg-[#181818] text-white p-6 overflow-auto`,children:(0,K.jsxs)(`div`,{className:`max-w-7xl mx-auto`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(xu,{className:`text-blue-400`,size:32}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-3xl font-bold`,children:u.name}),(0,K.jsx)(`p`,{className:`text-gray-400`,children:`Project Dashboard - Real Data Analysis`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`px-3 py-1 bg-green-500/20 text-green-400 text-xs font-bold rounded-full`,children:u.status}),(0,K.jsxs)(`span`,{className:`px-3 py-1 bg-blue-500/20 text-blue-400 text-xs font-bold rounded-full`,children:[`v`,u.version]})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4 mb-6`,children:[(0,K.jsxs)(`div`,{className:`flex-1 relative`,children:[(0,K.jsx)(nd,{size:20,className:`absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400`}),(0,K.jsx)(`input`,{type:`text`,placeholder:`Search files and folders...`,value:r,onChange:e=>i(e.target.value),className:`w-full pl-10 pr-4 py-2 bg-[#252525] border border-gray-700 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-500`})]}),(0,K.jsx)(`button`,{className:`p-2 bg-[#252525] border border-gray-700 rounded-lg hover:border-blue-500 transition-colors`,children:(0,K.jsx)(Su,{size:18})}),(0,K.jsxs)(`div`,{className:`flex bg-[#252525] border border-gray-700 rounded-lg p-1`,children:[(0,K.jsx)(`button`,{onClick:()=>n(`grid`),className:`p-2 rounded ${t===`grid`?`bg-blue-600`:`hover:bg-gray-600`} transition-colors`,children:(0,K.jsx)(Du,{size:16})}),(0,K.jsx)(`button`,{onClick:()=>n(`list`),className:`p-2 rounded ${t===`list`?`bg-blue-600`:`hover:bg-gray-600`} transition-colors`,children:(0,K.jsx)(Iu,{size:16})})]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4 mb-8`,children:[(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,K.jsx)(yu,{className:`text-blue-400`,size:20}),(0,K.jsx)(`span`,{className:`text-gray-400 text-sm`,children:`Files`})]}),(0,K.jsx)(`div`,{className:`text-2xl font-bold`,children:a.totalFiles})]}),(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,K.jsx)(xu,{className:`text-purple-400`,size:20}),(0,K.jsx)(`span`,{className:`text-gray-400 text-sm`,children:`Folders`})]}),(0,K.jsx)(`div`,{className:`text-2xl font-bold`,children:a.totalFolders})]}),(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,K.jsx)(hu,{className:`text-cyan-400`,size:20}),(0,K.jsx)(`span`,{className:`text-gray-400 text-sm`,children:`Total Size`})]}),(0,K.jsx)(`div`,{className:`text-2xl font-bold`,children:l(a.totalSize)})]})]}),(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-6 mb-8`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold mb-4`,children:`Quick Actions`}),(0,K.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:p.map((e,t)=>(0,K.jsxs)(`button`,{onClick:()=>m(e.action),className:`flex flex-col items-center gap-3 p-4 bg-[#252525] border border-gray-700 rounded-lg hover:border-blue-500 transition-all hover:scale-105`,children:[(0,K.jsx)(e.icon,{size:24,className:e.color}),(0,K.jsx)(`span`,{className:`text-sm text-center`,children:e.label})]},t))})]}),(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-6 mb-8`,children:[(0,K.jsxs)(`h2`,{className:`text-xl font-semibold mb-4`,children:[`Recent Files `,r&&`(Filtered: ${h.length})`]}),(0,K.jsx)(`div`,{className:`space-y-3`,children:h.length>0?h.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between p-3 bg-[#252525] rounded-lg border border-gray-700 hover:border-blue-500 transition-colors cursor-pointer`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(yu,{size:16,className:`text-blue-400`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-white font-medium`,children:e.name}),(0,K.jsx)(`div`,{className:`text-gray-400 text-sm`,children:e.path})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4 text-sm text-gray-400`,children:[(0,K.jsx)(`span`,{children:e.type}),(0,K.jsx)(`span`,{children:e.size}),(0,K.jsx)(`span`,{children:e.modified})]})]},t)):(0,K.jsx)(`div`,{className:`text-center py-8 text-gray-400`,children:r?`No files found matching your search`:`No recent files available`})})]}),s&&(0,K.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50`,children:(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-6 max-w-4xl w-[90vw] max-h-[80vh] overflow-auto`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,K.jsxs)(`h2`,{className:`text-2xl font-bold text-white flex items-center gap-3`,children:[(0,K.jsx)(Yu,{className:`text-purple-400`,size:28}),`Project Technologies`]}),(0,K.jsx)(`button`,{onClick:()=>c(!1),className:`text-gray-400 hover:text-white transition-colors`,children:(0,K.jsx)(yd,{size:24})})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,K.jsxs)(`div`,{className:`bg-[#252525] border border-gray-700 rounded-xl p-6`,children:[(0,K.jsxs)(`h3`,{className:`text-lg font-semibold mb-4 flex items-center gap-2`,children:[(0,K.jsx)(Eu,{className:`text-blue-400`,size:20}),`Frontend Technologies`]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:f.frontend.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(cu,{size:12,className:`text-green-400`}),(0,K.jsx)(`span`,{className:`text-gray-300`,children:e})]},t))})]}),(0,K.jsxs)(`div`,{className:`bg-[#252525] border border-gray-700 rounded-xl p-6`,children:[(0,K.jsxs)(`h3`,{className:`text-lg font-semibold mb-4 flex items-center gap-2`,children:[(0,K.jsx)(hu,{className:`text-purple-400`,size:20}),`Backend Services`]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:f.backend.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(cu,{size:12,className:`text-green-400`}),(0,K.jsx)(`span`,{className:`text-gray-300`,children:e})]},t))})]})]}),(0,K.jsxs)(`div`,{className:`mt-6 p-4 bg-blue-600/20 border border-blue-500/50 rounded-lg`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,K.jsx)(ju,{className:`text-blue-400`,size:20}),(0,K.jsx)(`h4`,{className:`font-semibold text-blue-400`,children:`Technology Summary`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-gray-400`,children:`Total Packages:`}),(0,K.jsx)(`span`,{className:`text-white ml-2 font-medium`,children:f.frontend.length})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-gray-400`,children:`Backend Services:`}),(0,K.jsx)(`span`,{className:`text-white ml-2 font-medium`,children:f.backend.length})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-gray-400`,children:`Build Tool:`}),(0,K.jsx)(`span`,{className:`text-white ml-2 font-medium`,children:`Vite 4.4.5`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-gray-400`,children:`Framework:`}),(0,K.jsx)(`span`,{className:`text-white ml-2 font-medium`,children:`React 18.2.0`})]})]})]})]})})]})})}function kd(){let[e,t]=(0,S.useState)(`firestore`),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),o={firestore:`rules_version = '2'; 325service cloud.firestore { 326 match /databases/{database}/documents { 327 328 match /users/{userId} { 329 allow read, write: if request.auth != null && request.auth.uid == userId; 330 } 331 332 333 match /courses/{courseId} { 334 allow read: if true; 335 allow write: if request.auth != null && request.auth.token.admin == true; 336 } 337 338 339 match /progress/{userId}/{documentId} { 340 allow read, write: if request.auth != null && request.auth.uid == userId; 341 } 342 } 343}`,storage:`rules_version = '2'; 344service firebase.storage { 345 match /b/{bucket}/o { 346 347 match /users/{userId}/{allPaths=**} { 348 allow read, write: if request.auth != null && request.auth.uid == userId; 349 } 350 351 352 match /courses/{courseId}/{allPaths=**} { 353 allow read: if true; 354 allow write: if request.auth != null && request.auth.token.admin == true; 355 } 356 } 357}`,realtime:`{ 358 "rules": { 359 "users": { 360 "$uid": { 361 ".read": "$uid === auth.uid", 362 ".write": "$uid === auth.uid" 363 } 364 }, 365 "courses": { 366 ".read": "auth != null", 367 ".write": "auth != null && auth.token.admin === true" 368 } 369 } 370}`},s=()=>{navigator.clipboard.writeText(o[e]),r(!0),setTimeout(()=>r(!1),2e3)},c=[{id:`firestore`,label:`Firestore`,icon:hu},{id:`storage`,label:`Storage`,icon:bu},{id:`realtime`,label:`Realtime DB`,icon:id}];return(0,K.jsx)(`div`,{className:`h-full bg-[#181818] text-white p-6 overflow-auto`,children:(0,K.jsxs)(`div`,{className:`max-w-6xl mx-auto`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mb-8`,children:[(0,K.jsx)(cd,{className:`text-blue-400`,size:32}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Security Rules`}),(0,K.jsx)(`p`,{className:`text-gray-400`,children:`Firebase Security Configuration`})]})]}),(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-6 mb-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(Ru,{className:`text-green-400`,size:24}),(0,K.jsx)(`span`,{className:`text-lg font-semibold`,children:`Security Status: Protected`})]}),(0,K.jsx)(`div`,{className:`text-sm text-gray-400`,children:`Last updated: 2 hours ago`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(ru,{size:16,className:`text-green-400`}),(0,K.jsx)(`span`,{className:`text-sm`,children:`Authentication enabled`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(ru,{size:16,className:`text-green-400`}),(0,K.jsx)(`span`,{className:`text-sm`,children:`Admin role validation`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(ru,{size:16,className:`text-green-400`}),(0,K.jsx)(`span`,{className:`text-sm`,children:`Data isolation active`})]})]})]}),(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl p-6 mb-6`,children:[(0,K.jsxs)(`h3`,{className:`text-lg font-semibold mb-4 flex items-center gap-2`,children:[(0,K.jsx)(Ru,{className:`text-blue-400`,size:20}),`Session Management`]}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`p-3 bg-[#252525] rounded-lg`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-400 mb-1`,children:`Session Revocation`}),(0,K.jsx)(`div`,{className:`text-sm text-gray-400`,children:`First session automatically disconnects when second session is detected`})]}),(0,K.jsxs)(`div`,{className:`p-3 bg-[#252525] rounded-lg`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-400 mb-1`,children:`Device Fingerprinting`}),(0,K.jsx)(`div`,{className:`text-sm text-gray-400`,children:`Tracks device characteristics to prevent account sharing`})]}),(0,K.jsxs)(`div`,{className:`p-3 bg-[#252525] rounded-lg`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-400 mb-1`,children:`IP Monitoring`}),(0,K.jsx)(`div`,{className:`text-sm text-gray-400`,children:`Real-time IP tracking for unauthorized access detection`})]})]})]}),(0,K.jsx)(`div`,{className:`flex gap-2 mb-6 border-b border-gray-700`,children:c.map(n=>(0,K.jsxs)(`button`,{onClick:()=>t(n.id),className:`flex items-center gap-2 px-4 py-3 font-medium transition-colors border-b-2 ${e===n.id?`text-blue-400 border-blue-400`:`text-gray-400 border-transparent hover:text-white hover:border-gray-600`}`,children:[(0,K.jsx)(n.icon,{size:18}),n.label]},n.id))}),(0,K.jsxs)(`div`,{className:`bg-[#202020] border border-gray-700 rounded-xl overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b border-gray-700 bg-[#252525]`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(bu,{size:18,className:`text-blue-400`}),(0,K.jsxs)(`span`,{className:`font-medium`,children:[c.find(t=>
370t.id===e)?.label,` Rules`]})]}),(0,K.jsx)(`div`,{className:`flex gap-2`,children:(0,K.jsxs)(`button`,{onClick:s,className:`flex items-center gap-2 px-3 py-1.5 bg-gray-700 hover:bg-gray-600 rounded text-sm transition-colors`,children:[n?(0,K.jsx)(ru,{size:16,className:`text-green-400`}):(0,K.jsx)(fu,{size:16}),n?`Copied!`:`Copy`]})})]}),(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(`textarea`,{value:o[e],readOnly:!0,className:`w-full h-96 bg-[#181818] text-white font-mono text-sm p-4 border border-gray-700 rounded-lg focus:outline-none focus:border-blue-500 resize-none`,spellCheck:!1})})]}),(0,K.jsxs)(`div`,{className:`mt-6 bg-[#202020] border border-gray-700 rounded-xl p-6`,children:[(0,K.jsx)(`h3`,{className:`text-lg font-semibold mb-4`,children:`Rule Information`}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`p-3 bg-[#252525] rounded-lg`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-400 mb-1`,children:`Firestore Rules`}),(0,K.jsx)(`div`,{className:`text-sm text-gray-400`,children:`Controls access to Cloud Firestore database with user-based permissions`})]}),(0,K.jsxs)(`div`,{className:`p-3 bg-[#252525] rounded-lg`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-400 mb-1`,children:`Storage Rules`}),(0,K.jsx)(`div`,{className:`text-sm text-gray-400`,children:`Manages file upload and download permissions for Firebase Storage`})]}),(0,K.jsxs)(`div`,{className:`p-3 bg-[#252525] rounded-lg`,children:[(0,K.jsx)(`div`,{className:`font-medium text-blue-400 mb-1`,children:`Realtime Database Rules`}),(0,K.jsx)(`div`,{className:`text-sm text-gray-400`,children:`Secures real-time data synchronization with JSON-based rules`})]})]})]})]})})}var Ad=({icon:e,label:t,active:n,hasChildren:r,onClick:i,isExpanded:a,level:o=0})=>(0,K.jsxs)(`div`,{onClick:i,className:`flex items-center gap-2 px-2 py-1.5 rounded-md text-sm mb-1 cursor-pointer transition-colors `+(n?`bg-blue-500/20 text-blue-400`:`text-white hover:text-white hover:bg-white/5`),style:{paddingLeft:`${8+o*16}px`},children:[r&&(0,K.jsx)(`span`,{className:`inline-flex items-center justify-center w-4 h-4`,children:a?(0,K.jsx)(iu,{size:14}):(0,K.jsx)(ou,{size:14})}),!r&&(0,K.jsx)(`span`,{className:`inline-flex items-center justify-center w-4 h-4`}),(0,K.jsx)(e,{size:16,className:`flex-shrink-0`}),(0,K.jsx)(`span`,{className:`flex-1 truncate text-white select-none`,children:t}),r&&(0,K.jsx)(`span`,{className:`text-xs text-gray-400 opacity-60`,children:a?`â`:`+`})]});
370function jd({onOpenApp:e}){let{project:t}=Td,[n,r]=(0,S.useState)(new Set([Ed.name])),[i,a]=(0,S.useState)(`explorer`),o=e=>{if(console.log(`Clicked on: ${e}`),e===`Dashboard`){a(`dashboard`);return}if(e===`Security Rules`){a(`security`);return}r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},s=(e,t=0,r=``)=>e.map((e,i)=>{let a=e.icon===`FolderOpen`?xu:yu,c=r?`${r}/${e.name}`:e.name,l=n.has(c),u=e.children&&e.children.length>0;return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Ad,{icon:a,label:e.name,hasChildren:u,isExpanded:l,onClick:()=>o(c),level:t}),u&&l&&(0,K.jsxs)(`div`,{className:`relative`,children:[t>0&&(0,K.jsx)(`div`,{className:`absolute left-4 top-0 bottom-0 w-px bg-white/10`,style:{left:`${12+t*16}px`}}),s(e.children,t+1,c)]})]},`${c}-${i}`)});return(0,K.jsxs)(`div`,{className:`h-full flex bg-[#181818] text-os-text`,children:[(0,K.jsxs)(`div`,{className:`w-64 bg-[#202020] border-r border-os-border flex flex-col p-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-bold text-white uppercase mb-3 tracking-wider px-2`,children:`Explorer`}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto max-h-[calc(100vh-10rem)] scrollbar-thin scrollbar-thumb-gray-600 scrollbar-track-transparent`,children:[(0,K.jsx)(Ad,{icon:xu,label:Ed.name,active:!0,hasChildren:!0,isExpanded:n.has(Ed.name),onClick:()=>o(Ed.name),level:0}),n.has(Ed.name)&&(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(`div`,{className:`absolute left-4 top-0 bottom-0 w-px bg-white/10`}),s(Ed.files,1,Ed.name)]}),(0,K.jsx)(`div`,{className:`mt-6 text-xs font-bold text-white uppercase mb-3 tracking-wider px-2`,children:`Favorites`}),(0,K.jsx)(Ad,{icon:Pu,label:`Dashboard`,onClick:()=>o(`Dashboard`)}),(0,K.jsx)(Ad,{icon:sd,label:`Security Rules`,onClick:()=>o(`Security Rules`)}),(0,K.jsxs)(`div`,{className:`mt-4 flex items-center gap-2 px-2 py-2 bg-[#252525] rounded-lg border border-gray-700`,children:[(0,K.jsx)(`button`,{onClick:()=>a(`explorer`),className:`px-3 py-1 rounded text-xs font-medium transition-colors ${i===`explorer`?`bg-blue-600 text-white`:`bg-gray-700 text-gray-400 hover:bg-gray-600`}`,children:`Files`}),(0,K.jsx)(`button`,{onClick:()=>a(`dashboard`),className:`px-3 py-1 rounded text-xs font-medium transition-colors ${i===`dashboard`?`bg-blue-600 text-white`:`bg-gray-700 text-gray-400 hover:bg-gray-600`}`,children:`Dashboard`}),(0,K.jsx)(`button`,{onClick:()=>a(`security`),className:`px-3 py-1 rounded text-xs font-medium transition-colors ${i===`security`?`bg-blue-600 text-white`:`bg-gray-700 text-gray-400 hover:bg-gray-600`}`,children:`Security`})]})]})]}),(0,K.jsx)(`div`,{className:`flex-1 flex flex-col`,children:(()=>i===`dashboard`?(0,K.jsx)(Od,{onOpenApp:e}):i===`security`?(0,K.jsx)(kd,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`h-10 bg-[#252525] border-b border-os-border flex items-center px-4 text-sm text-white gap-2`,children:[(0,K.jsx)(xu,{size:16}),(0,K.jsx)(`span`,{children:`Projects`}),(0,K.jsx)(ou,{size:14}),(0,K.jsx)(`span`,{className:`text-white font-medium`,children:t.name})]}),(0,K.jsx)(`div`,{className:`flex-1 p-8 overflow-auto bg-grid-pattern`,children:(0,K.jsxs)(`div`,{className:`bg-[#202020]/80 backdrop-blur-xl p-8 rounded-2xl border border-os-border shadow-2xl max-w-3xl mx-auto`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between mb-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(`div`,{className:`w-16 h-16 bg-blue-500/20 text-blue-400 rounded-xl flex items-center justify-center`,children:(0,K.jsx)(lu,{size:32})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-3xl font-bold text-white mb-2`,children:t.name}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`px-3 py-1 bg-green-500/20 text-green-400 text-xs font-bold rounded-full`,children:t.status}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400`,children:`React + Firebase + PWA`})]})]})]}),(0,K.jsx)(`button`,{onClick:()=>window.open(`https://github.com/AQADIL`,`_blank`),className:`px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white text-sm font-bold rounded-lg transition-colors`,children:`View Source`})]}),(0,K.jsx)(`p`,{className:`text-lg text-gray-300 leading-relaxed mb-8 border-b border-os-border pb-8`,children:t.description}),(0,K.jsxs)(`h2`,{className:`text-xl font-bold text-white mb-6 flex items-center gap-3`,children:[(0,K.jsx)(sd,{size:24,className:`text-blue-400`}),`Key Technical Highlights`]}),(0,K.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:t.highlights.map((e,t)=>(0,K.jsxs)(`div`,{className:`bg-[#2a2a2a] p-4 rounded-xl border border-os-border hover:border-blue-500/50 transition-colors flex items-start gap-3`,children:[(0,K.jsx)(`div`,{className:`mt-1 text-blue-400`,children:t===0?(0,K.jsx)(sd,{}):t===2?(0,K.jsx)(_d,{}):(0,K.jsx)(yu,{})}),(0,K.jsx)(`span`,{className:`text-sm text-gray-300 leading-snug`,children:e})]},t))})]})})]}))()})]})}var Md=[`AqadilOS Kernel v2.5.0-generic #42 SMP PREEMPT Thu Dec 16 20:55:32 UTC 2025`,`Checking file systems...`,`EXT4-fs (nvme0n1p2): mounted filesystem with ordered data mode. Opts: (null)`,`systemd[1]: Detected virtualization 'react-vm'.`,`systemd[1]: Detected architecture 'x86-64'.`,`Welcome to AqadilOS!`,``,`Type 'help' to see available commands.`,``];function Nd(){let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(0),[i,a]=(0,S.useState)(``),o=(0,S.useRef)(null),s=(0,S.useRef)(null);return(0,S.useEffect)(()=>
370{if(n<Md.length){let e=setTimeout(()=>{t(e=>[...e,Md[n]]),r(e=>e+1)},Math.random()*100+50);return()=>clearTimeout(e)}},[n]),(0,S.useEffect)(()=>{s.current?.scrollTo({top:s.current.scrollHeight,behavior:`smooth`})},[e]),(0,K.jsxs)(`div`,{className:`h-full bg-black/95 p-4 font-mono text-sm md:text-base text-green-500 overflow-auto`,ref:s,onClick:()=>o.current?.focus(),children:[e.map((e,t)=>(0,K.jsx)(`div`,{className:`whitespace-pre-wrap mb-1`,children:e},t)),n===Md.length&&(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(`span`,{className:`text-blue-400 mr-2`,children:`user@aqadil:~$`}),(0,K.jsx)(`input`,{ref:o,type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{if(e.key===`Enter`){let e=i.trim().toLowerCase(),n=[`user@aqadil:~$ `+i];switch(e){case`help`:n.push(`Available commands: about, skills, contact, clear, date`);break;case`about`:n.push(`Alish Aqadil. Fullstack Developer focused on complex product logic.`);break;case`skills`:n.push(`React, Node.js, Firebase, PWA, Secure Architecture.`);break;case`contact`:n.push(`Telegram: @wellpussy | Phone: +7 776 234 9535`);break;case`date`:n.push(new Date().toString());break;case`clear`:t([]),a(``);return;case``:break;default:n.push(`bash: `+e+`: command not found`)}t(e=>[...e,...n,``]),a(``)}},className:`flex-1 bg-transparent outline-none border-none text-green-500 caret-green-500`,autoFocus:!0})]})]})}function Pd(){let[e,t]=(0,S.useState)(`0`),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)(!1),c=e=>{if(e===`Error`)return`Error`;if(!e)return`0`;let[t,n]=e.split(`.`);return n==null?new Intl.NumberFormat(`en-US`).format(t):`${new Intl.NumberFormat(`en-US`).format(t)}.${n}`},l=()=>{t(`0`),r(``),a(null),s(!1)},u=()=>{if(o){t(`0`),s(!1);return}e.length===1?t(`0`):t(e.slice(0,-1))},d=n=>{e.length>15&&!o||n===`.`&&e.includes(`.`)||(o?(t(n),s(!1)):t(e===`0`&&n!==`.`?n:e+n))},f=o=>{if(e!==``){if(n!==``){let a=m(n,e,i);r(String(a)),t(String(a))}else r(e);a(o),s(!0)}},p=n=>{let r=parseFloat(e),i;if(!isNaN(r)){switch(n){case`x²`:i=r*r;break;case`âx`:i=Math.sqrt(r);break;case`1/x`:i=1/r;break;case`%`:i=r/100;break;case`+/-`:i=r*-1;break;default:return}t(String(i)),s(!0)}},m=(e,t,n)=>{let r=parseFloat(e),i=parseFloat(t);if(isNaN(r)||isNaN(i))return``;let a=0;switch(n){case`+`:a=r+i;break;case`-`:a=r-i;break;case`Ã`:a=r*i;break;case`÷`:a=r/i;break;default:return i}return a},h=[{label:`%`,action:()=>p(`%`),type:`sec`},{label:`CE`,action:()=>t(`0`),type:`sec`},{label:`C`,action:l,type:`sec`},{label:(0,K.jsx)(gu,{size:18}),action:u,type:`sec`},{label:`1/x`,action:()=>p(`1/x`),type:`sec`},{label:`x²`,action:()=>p(`x²`),type:`sec`},{label:`âx`,action:()=>p(`âx`),type:`sec`},{label:`÷`,action:()=>f(`÷`),type:`sec`},{label:`7`,action:()=>d(`7`),type:`num`},{label:`8`,action:()=>d(`8`),type:`num`},{label:`9`,action:()=>d(`9`),type:`num`},{label:`Ã`,action:()=>f(`Ã`),type:`sec`},{label:`4`,action:()=>d(`4`),type:`num`},{label:`5`,action:()=>d(`5`),type:`num`},{label:`6`,action:()=>d(`6`),type:`num`},{label:`-`,action:()=>f(`-`),type:`sec`},{label:`1`,action:()=>d(`1`),type:`num`},{label:`2`,action:()=>d(`2`),type:`num`},{label:`3`,action:()=>d(`3`),type:`num`},{label:`+`,action:()=>f(`+`),type:`sec`},{label:`+/-`,action:()=>p(`+/-`),type:`num`},{label:`0`,action:()=>d(`0`),type:`num`},{label:`.`,action:()=>d(`.`),type:`num`},{label:`=`,action:()=>{if(!i||!n)return;let o=m(n,e,i);t(String(o)),r(``),a(null),s(!0)},type:`accent`}];return(0,K.jsxs)(`div`,{className:`flex flex-col h-full bg-[#202020] text-white select-none`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4 px-4 pt-2 pb-0`,children:[(0,K.jsx)(`button`,{className:`hover:bg-white/10 p-2 rounded`,children:(0,K.jsx)(Uu,{size:18})}),(0,K.jsx)(`span`,{className:`text-xl font-semibold`,children:`Standard`}),(0,K.jsx)(`button`,{className:`ml-auto hover:bg-white/10 p-2 rounded`,children:(0,K.jsx)(ed,{size:16,className:`text-gray-400`})})]}),(0,K.jsxs)(`div`,{className:`flex-1 flex flex-col items-end justify-end px-4 pb-2`,children:[(0,K.jsxs)(`div`,{className:`text-gray-400 text-sm h-6 font-medium tracking-wide`,children:[n,` `,i]}),(0,K.jsx)(`div`,{className:`${(()=>e.length>12?`text-3xl`:e.length>9?`text-4xl`:`text-5xl`)()} font-semibold break-all transition-all`,children:c(e)})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-4 grid-rows-6 gap-[2px] bg-[#202020] p-[2px]`,children:h.map((e,t)=>(0,K.jsx)(`button`,{onClick:e.action,className:` 371 h-[55px] flex items-center justify-center text-sm transition-all duration-100 372 ${e.type===`num`?`bg-[#3b3b3b] hover:bg-[#323232] font-bold text-white`:``} 373 ${e.type===`sec`?`bg-[#323232] hover:bg-[#3b3b3b] text-gray-100`:``} 374 ${e.type===`accent`?`bg-[#76b9ed] hover:bg-[#68a3d1] text-black font-semibold`:``} 375 active:scale-95 active:opacity-80 rounded-sm 376 `,children:e.label},t))})]})}function Fd(){let[e,t]=(0,S.useState)(new Date),[n,r]=(0,S.useState)(new Date),[i,a]=(0,S.useState)(new Date),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)([{id:1,title:`Team Daily Scrum`,date:new Date,time:`10:00 AM`,location:`Zoom Meeting`,type:`meeting`},{id:2,title:`AQADIL OS v2 Release`,date:new Date,time:`23:59 PM`,location:``,type:`deadline`}]),[u,d]=(0,S.useState)({title:``,date:new Date,time:``,location:``,type:`meeting`});(0,S.useEffect)(()=>{let e=setInterval(()=>a(new Date),1e3);return()=>clearInterval(e)},[]);let f=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],p=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],{days:m,firstDay:h}=(e=>{let t=e.getFullYear(),n=e.getMonth();return{days:new Date(t,n+1,0).getDate(),firstDay:new Date(t,n,1).getDay()}})(e),g=n=>{t(new Date(e.getFullYear(),e.getMonth()+n,1))},_=t=>{let n=new Date;return t===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()},v=t=>t===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear(),y=()=>
376{if(u.title.trim()){let e={id:Date.now(),...u,date:n};l([...c,e]),d({title:``,date:new Date,time:``,location:``,type:`meeting`}),s(!1)}},b=e=>{r(e),d({title:``,date:e,time:``,location:``,type:`meeting`}),s(!0)};return(0,K.jsxs)(`div`,{className:`relative w-full h-full bg-[#0f0f11] text-white overflow-hidden font-sans`,children:[(0,K.jsx)(`div`,{className:`absolute top-[-10%] left-[-10%] w-[300px] h-[300px] bg-purple-600 rounded-full blur-[100px] opacity-40 animate-pulse`}),(0,K.jsx)(`div`,{className:`absolute bottom-[-10%] right-[-10%] w-[400px] h-[400px] bg-blue-600 rounded-full blur-[120px] opacity-40`}),(0,K.jsx)(`div`,{className:`absolute top-[20%] right-[30%] w-[200px] h-[200px] bg-pink-500 rounded-full blur-[90px] opacity-20`}),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10 flex`,children:[(0,K.jsxs)(`div`,{className:`w-[280px] h-full bg-white/5 backdrop-blur-2xl border-r border-white/10 flex flex-col p-6 relative`,children:[(0,K.jsx)(`div`,{className:`absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-10 pointer-events-none`}),(0,K.jsxs)(`div`,{className:`relative z-10 flex flex-col h-full`,children:[(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`h1`,{className:`text-7xl font-thin tracking-tighter text-transparent bg-clip-text bg-gradient-to-b from-white to-white/60`,children:i.toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!1})}),(0,K.jsx)(`p`,{className:`text-blue-200/80 text-lg font-medium mt-1 ml-1`,children:i.toLocaleDateString(`en-US`,{weekday:`long`,month:`long`,day:`numeric`})})]}),(0,K.jsxs)(`div`,{className:`mt-8 space-y-3 flex-1`,children:[(0,K.jsxs)(`div`,{className:`group bg-white/5 hover:bg-white/10 transition-colors border border-white/10 rounded-2xl p-4 cursor-pointer backdrop-blur-sm`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-start mb-2`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-blue-300 uppercase tracking-wider`,children:`Upcoming`}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400`,children:`10:00 AM`})]}),(0,K.jsx)(`h3`,{className:`font-medium text-lg leading-tight`,children:`Team Daily Scrum`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 mt-2 text-xs text-gray-400`,children:[(0,K.jsx)(Vu,{size:12}),(0,K.jsx)(`span`,{children:`Zoom Meeting`})]})]}),(0,K.jsxs)(`div`,{className:`group bg-white/5 hover:bg-white/10 transition-colors border border-white/10 rounded-2xl p-4 cursor-pointer backdrop-blur-sm`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-start mb-2`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold text-purple-300 uppercase tracking-wider`,children:`Deadline`}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400`,children:`23:59 PM`})]}),(0,K.jsx)(`h3`,{className:`font-medium text-lg leading-tight`,children:`AQADIL OS v2 Release`})]})]}),(0,K.jsxs)(`button`,{onClick:()=>s(!0),className:`flex items-center justify-center gap-2 w-full py-3 bg-gradient-to-r from-blue-600/80 to-purple-600/80 hover:from-blue-500 hover:to-purple-500 rounded-xl font-medium shadow-lg shadow-blue-900/20 backdrop-blur-sm transition-all active:scale-95 group`,children:[(0,K.jsx)($u,{size:18,className:`group-hover:rotate-90 transition-transform`}),(0,K.jsx)(`span`,{className:`group-hover:text-white/90 transition-colors`,children:`New Event`})]})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 h-full bg-black/20 backdrop-blur-xl p-8 flex flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsx)(`span`,{className:`text-sm text-gray-400 font-medium uppercase tracking-widest mb-1`,children:`Select Date`}),(0,K.jsxs)(`h2`,{className:`text-3xl font-bold text-white`,children:[f[e.getMonth()],` `,(0,K.jsx)(`span`,{className:`text-white/40`,children:e.getFullYear()})]})]}),(0,K.jsxs)(`div`,{className:`flex gap-1 bg-white/5 p-1 rounded-lg border border-white/10`,children:[(0,K.jsx)(`button`,{onClick:()=>g(-1),className:`p-2 hover:bg-white/10 rounded-md text-gray-300 transition-colors`,children:(0,K.jsx)(au,{size:20})}),(0,K.jsx)(`button`,{onClick:()=>g(1),className:`p-2 hover:bg-white/10 rounded-md text-gray-300 transition-colors`,children:(0,K.jsx)(ou,{size:20})})]})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-7 mb-4`,children:p.map(e=>(0,K.jsx)(`div`,{className:`text-center text-xs font-semibold text-white/40 uppercase tracking-wider py-2`,children:e},e))}),(0,K.jsxs)(`div`,{className:`grid grid-cols-7 gap-3 content-start`,children:[Array.from({length:h}).map((e,t)=>(0,K.jsx)(`div`,{},`empty-${t}`)),Array.from({length:m}).map((t,n)=>{let r=n+1,i=_(r),a=v(r);return(0,K.jsxs)(`button`,{onClick:()=>b(new Date(e.getFullYear(),e.getMonth(),r)),className:` 377 relative h-10 w-full rounded-xl flex flex-col items-center justify-center transition-all duration-300 group 378 ${i?`bg-gradient-to-br from-blue-500 to-indigo-600 text-white shadow-lg shadow-blue-500/30 scale-105 font-bold z-10`:`text-gray-300 hover:bg-white/5 hover:scale-105`} 379 ${a&&!i?`bg-white/10 border border-white/20 text-white`:``} 380 `,children:[(0,K.jsx)(`span`,{className:`text-sm`,children:r}),[3,14,25].includes(r)&&!i&&(0,K.jsx)(`div`,{className:`absolute bottom-1.5 w-1 h-1 bg-purple-400 rounded-full shadow-[0_0_5px_currentColor]`})]},r)})]})]})]}),o&&(0,K.jsx)(`div`,{className:`absolute inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,children:(0,K.jsxs)(`div`,{className:`w-[400px] bg-white/10 backdrop-blur-2xl border border-white/20 rounded-2xl p-6 shadow-2xl`,children:[(0,K.jsx)(`h3`,{className:`text-xl font-bold text-white mb-4`,children:`Create New Event`}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-sm text-gray-300 mb-1 block`,children:`Event Title`}),(0,K.jsx)(`input`,{type:`text`,value:u.title,onChange:e=>d({...u,title:e.target.value}),className:`w-full px-3 py-2 bg-white/10 border border-white/20 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-400`,placeholder:`Enter event title...`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-sm text-gray-300 mb-1 block`,children:`Date`}),(0,K.jsx)(`input`,{type:`date`,value:u.date.toISOString().split(`T`)[0],onChange:e=>d({...u,date:new Date(e.target.value)}),className:`w-full px-3 py-2 bg-white/10 border border-white/20 rounded-lg text-white focus:outline-none focus:border-blue-400`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-sm text-gray-300 mb-1 block`,children:`Time`}),(0,K.jsx)(`input`,{type:`text`,value:u.time,onChange:e=>d({...u,time:e.target.value}),className:`w-full px-3 py-2 bg-white/10 border border-white/20 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-400`,placeholder:`10:00 AM`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-sm text-gray-300 mb-1 block`,children:`Location`}),(0,K.jsx)(`input`,{type:`text`,value:u.location,onChange:e=>d({...u,location:e.target.value}),className:`w-full px-3 py-2 bg-white/10 border border-white/20 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-400`,placeholder:`Zoom Meeting / Office...`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-sm text-gray-300 mb-1 block`,children:`Type`}
380),(0,K.jsxs)(`select`,{value:u.type,onChange:e=>d({...u,type:e.target.value}),className:`w-full px-3 py-2 bg-white/10 border border-white/20 rounded-lg text-white focus:outline-none focus:border-blue-400`,children:[(0,K.jsx)(`option`,{value:`meeting`,className:`bg-gray-800`,children:`Meeting`}),(0,K.jsx)(`option`,{value:`deadline`,className:`bg-gray-800`,children:`Deadline`}),(0,K.jsx)(`option`,{value:`reminder`,className:`bg-gray-800`,children:`Reminder`})]})]})]}),(0,K.jsxs)(`div`,{className:`flex gap-3 mt-6`,children:[(0,K.jsx)(`button`,{onClick:()=>s(!1),className:`flex-1 py-2 bg-white/10 hover:bg-white/20 border border-white/20 rounded-lg text-white transition-colors`,children:`Cancel`}),(0,K.jsx)(`button`,{onClick:y,className:`flex-1 py-2 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-500 hover:to-purple-500 rounded-lg text-white font-medium transition-all`,children:`Create Event`})]})]})})]})}function Id(){let[e,t]=(0,S.useState)(!1),[n,r]=(0,S.useState)(0),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(80),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(0),m=(0,S.useRef)(null),h=[{title:`Mimosa 2000`,artist:`Furacão 2000`,cover:`/music/covers/mimosa.jpg`,audioFile:`/music/audio/mimosa.mp3`},{title:`Night Dancer`,artist:`imase`,cover:`/music/covers/night-dancer.jpg`,audioFile:`/music/audio/night-dancer.mp3`},{title:`Salvatore`,artist:`Lana Del Rey`,cover:`/music/covers/salvatore.jpg`,audioFile:`/music/audio/salvatore.mp3`},{title:`Empire State of Mind`,artist:`Jay-Z ft. Alicia Keys`,cover:`/music/covers/empire-state-mind.jpg`,audioFile:`/music/audio/empire-state-mind.mp3`},{title:`ÐÓÐ·Ð·Ð°Ñ Ð°Ð»Ð°ÑÑ`,artist:`ÐÑÐ±Ð¾Ð»Ð°Ñ ÒұдайбеÑгенов`,cover:`/music/covers/lyazzat-alauy.jpg`,audioFile:`/music/audio/lyazzat-alauy.mp3`}],g=h[n];(0,S.useEffect)(()=>{let e=new Audio;m.current=e,e.volume=o/100;let t=()=>{d(e.currentTime),p(e.duration||0),a(e.duration?e.currentTime/e.duration*100:0)},n=()=>{_()};return e.addEventListener(`timeupdate`,t),e.addEventListener(`loadedmetadata`,t),e.addEventListener(`ended`,n),()=>{e.removeEventListener(`timeupdate`,t),e.removeEventListener(`loadedmetadata`,t),e.removeEventListener(`ended`,n),e.pause()}},[]),(0,S.useEffect)(()=>{m.current&&(m.current.src=g.audioFile,e&&m.current.play().catch(console.error))},[n]),(0,S.useEffect)(()=>{m.current&&(e?m.current.play().catch(console.error):m.current.pause())},[e]),(0,S.useEffect)(()=>{m.current&&(m.current.volume=o/100)},[o]);let _=()=>{a(0),r(e=>(e+1)%h.length),t(!0)},v=()=>{a(0),r(e=>(e-1+h.length)%h.length),t(!0)},y=e=>{if(m.current&&f){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*f;m.current.currentTime=n}},b=e=>{if(!e||isNaN(e))return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,`0`)}`};return(0,K.jsxs)(`div`,{className:`relative w-full h-full overflow-hidden flex text-white select-none`,children:[(0,K.jsxs)(`div`,{className:`absolute inset-0 z-0`,children:[(0,K.jsx)(`img`,{src:g.cover,alt:`bg`,className:`w-full h-full object-cover opacity-60 blur-3xl scale-125 transition-all duration-1000`}),(0,K.jsx)(`div`,{className:`absolute inset-0 bg-black/40`}),(0,K.jsx)(`div`,{className:`absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-20`})]}),(0,K.jsxs)(`div`,{className:`relative z-10 w-[45%] h-full flex flex-col items-center justify-center p-8 border-r border-white/10 backdrop-blur-md bg-black/20`,children:[(0,K.jsxs)(`div`,{className:`relative w-64 h-64 mb-8 group`,children:[(0,K.jsx)(`div`,{className:`absolute inset-0 rounded-full bg-black/50 blur-xl transform translate-y-4 transition-all duration-500 ${e?`scale-100`:`scale-90`}`}),(0,K.jsxs)(`div`,{className:`relative w-full h-full rounded-full border-4 border-black/80 bg-black shadow-2xl overflow-hidden transition-transform duration-[5s] ease-linear ${e?`animate-[spin_4s_linear_infinite]`:``}`,children:[(0,K.jsx)(`img`,{src:g.cover,alt:`cover`,className:`w-full h-full object-cover opacity-80`}),(0,K.jsx)(`div`,{className:`absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-16 h-16 bg-[#1a1a1a] rounded-full flex items-center justify-center border border-white/20`,children:(0,K.jsx)(`div`,{className:`w-3 h-3 bg-black rounded-full border border-gray-700`})}),(0,K.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-tr from-transparent via-white/10 to-transparent roun
380ded-full pointer-events-none`})]})]}),(0,K.jsxs)(`div`,{className:`text-center space-y-1 mb-6`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight text-white drop-shadow-lg`,children:g.title}),(0,K.jsx)(`p`,{className:`text-gray-300 font-medium text-lg`,children:g.artist})]}),(0,K.jsxs)(`div`,{className:`w-full space-y-2 mb-6`,children:[(0,K.jsx)(`div`,{className:`relative h-1 bg-white/20 rounded-full overflow-hidden cursor-pointer group`,onClick:y,children:(0,K.jsx)(`div`,{className:`absolute top-0 left-0 h-full bg-white shadow-[0_0_10px_rgba(255,255,255,0.8)] transition-all duration-300 group-hover:bg-blue-400`,style:{width:`${i}%`}})}),(0,K.jsxs)(`div`,{className:`flex justify-between text-xs text-gray-400 font-medium`,children:[(0,K.jsx)(`span`,{children:b(u)}),(0,K.jsx)(`span`,{children:b(f)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,K.jsx)(`button`,{onClick:v,className:`text-gray-300 hover:text-white transition-transform active:scale-90`,children:(0,K.jsx)(ld,{size:28,fill:`currentColor`})}),(0,K.jsx)(`button`,{onClick:()=>t(!e),className:`w-16 h-16 rounded-full bg-white text-black flex items-center justify-center hover:scale-105 active:scale-95 transition-all shadow-[0_0_20px_rgba(255,255,255,0.3)]`,children:e?(0,K.jsx)(Xu,{size:28,fill:`currentColor`}):(0,K.jsx)(Qu,{size:28,fill:`currentColor`,className:`ml-1`})}),(0,K.jsx)(`button`,{onClick:_,className:`text-gray-300 hover:text-white transition-transform active:scale-90`,children:(0,K.jsx)(ud,{size:28,fill:`currentColor`})})]})]}),(0,K.jsxs)(`div`,{className:`relative z-10 flex-1 h-full bg-black/40 backdrop-blur-xl p-6 flex flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-center mb-6`,children:[(0,K.jsxs)(`h3`,{className:`text-xl font-bold flex items-center gap-2`,children:[(0,K.jsx)(_u,{className:e?`animate-spin`:``,size:20}),` Current Playlist`]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(gd,{size:16,className:`text-gray-400`}),(0,K.jsx)(`div`,{className:`w-20 h-1 bg-white/20 rounded-full overflow-hidden`,children:(0,K.jsx)(`div`,{className:`h-full bg-white w-[80%]`})})]})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto pr-2 space-y-2 custom-scrollbar`,children:h.map((i,o)=>(0,K.jsxs)(`div`,{onClick:()=>{r(o),t(!0),a(0)},className:` 381 group p-3 rounded-xl flex items-center justify-between cursor-pointer transition-all duration-200 border border-transparent 382 ${n===o?`bg-white/10 border-white/20 backdrop-blur-sm`:`hover:bg-white/5 hover:border-white/5`} 383 `,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsxs)(`div`,{className:`relative w-10 h-10 rounded-md overflow-hidden`,children:[(0,K.jsx)(`img`,{src:i.cover,alt:`cover`,className:`w-full h-full object-cover`}),n===o&&e&&(0,K.jsxs)(`div`,{className:`absolute inset-0 bg-black/60 flex items-center justify-center gap-[2px]`,children:[(0,K.jsx)(`div`,{className:`w-[3px] bg-blue-400 h-3 animate-[bounce_1s_infinite]`}),(0,K.jsx)(`div`,{className:`w-[3px] bg-blue-400 h-5 animate-[bounce_1.2s_infinite]`}),(0,K.jsx)(`div`,{className:`w-[3px] bg-blue-400 h-2 animate-[bounce_0.8s_infinite]`})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h4`,{className:`text-sm font-semibold ${n===o?`text-blue-300`:`text-white`}`,children:i.title}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400`,children:i.artist})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(`span`,{className:`text-xs text-gray-500 font-mono`,children:i.duration}),n===o&&(0,K.jsx)(`button`,{onClick:e=>{e.stopPropagation(),l(!c)},children:(0,K.jsx)(ku,{size:16,className:c?`fill-red-500 text-red-500`:`text-gray-400 hover:text-white`})})]})]},o))}),(0,K.jsx)(`div`,{className:`h-12 flex items-end justify-center gap-1 mt-4 opacity-50`,children:Array.from({length:30}).map((t,n)=>(0,K.jsx)(`div`,{className:`w-1.5 bg-white/80 rounded-t-sm transition-all duration-150 ${e?`animate-pulse`:`h-1`}`,style:{height:e?`${Math.random()*100}%`:`4px`,animationDelay:`${n*.05}s`}},n))})]})]})}var Ld=e=>{let t=new(window.AudioContext||window.webkitAudioContext),n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.connect(i),i.connect(t.destination),e===`scan`&&(r.type=`sine`,r.frequency.setValueAtTime(800,n),r.frequency.exponentialRampToValueAtTime(1200,n+.1),i.gain.setValueAtTime(.05,n),i.gain.linearRampToValueAtTime(0,n+.1),r.start(n),r.stop(n+.1))},Rd=e=>e.includes(`github.com`)?{name:`GitHub`,icon:Tu,color:`text-white`,bg
383:`bg-zinc-800`,trust:`High`}:e.includes(`t.me`)||e.includes(`telegram`)?{name:`Telegram`,icon:rd,color:`text-blue-400`,bg:`bg-blue-500/20`,trust:`Verified`}:e.includes(`youtube.com`)?{name:`YouTube`,icon:vu,color:`text-red-500`,bg:`bg-red-500/20`,trust:`Media`}:e.includes(`akadiledu.com`)?{name:`AkadilEDU`,icon:Eu,color:`text-emerald-400`,bg:`bg-emerald-500/20`,trust:`Official`}:{name:`External Site`,icon:Eu,color:`text-cyan-400`,bg:`bg-cyan-500/20`,trust:`Unverified`},zd=(0,S.createContext)();const Bd=()=>(0,S.useContext)(zd),Vd=({children:e})=>{let[t,n]=(0,S.useState)(null);return console.log(`SecurityProvider: Component rendered`),console.log(`SecurityProvider: Current request:`,t),(0,K.jsxs)(zd.Provider,{value:{openLink:e=>{console.log(`SecurityProvider: openLink called with URL:`,e),Ld(`scan`),n({url:e}),console.log(`SecurityProvider: setRequest called with:`,{url:e})}},children:[e,(0,K.jsx)(Hd,{request:t,onConfirm:()=>{t?.url&&(console.log(`SecurityProvider: Opening URL:`,t.url),window.open(t.url,`_blank`),n(null))},onCancel:()=>{console.log(`SecurityProvider: Cancelled`),n(null)}})]})};function Hd({request:e,onConfirm:t,onCancel:n}){if(!e)return null;let r=Rd(e.url),i=r.icon;return console.log(`SecurityModal: Rendering for URL:`,e.url),(0,K.jsx)(Ai,{children:e&&(0,K.jsxs)(`div`,{className:`fixed inset-0 z-[99999] flex items-center justify-center font-sans`,children:[(0,K.jsx)(Hl.div,{initial:{opacity:0}
383,animate:{opacity:1},exit:{opacity:0},onClick:n,className:`absolute inset-0 bg-black/60 backdrop-blur-xl`}),(0,K.jsxs)(Hl.div,{initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:10},transition:{type:`spring`,duration:.5,bounce:.3},className:`relative w-full max-w-md bg-[#09090b] border border-white/10 rounded-3xl shadow-2xl overflow-hidden z-[99999]`,children:[(0,K.jsx)(`div`,{className:`h-1 w-full bg-gradient-to-r from-transparent via-blue-500 to-transparent opacity-50`}),(0,K.jsxs)(`div`,{className:`p-8`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-start mb-8`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/5`,children:[(0,K.jsx)(sd,{size:14,className:`text-emerald-400`}),(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-widest text-gray-400 font-medium`,children:`Security Gateway`})]}),(0,K.jsx)(`button`,{onClick:n,className:`text-gray-500 hover:text-white transition-colors`,children:(0,K.jsx)(yd,{size:20})})]}),(0,K.jsxs)(`div`,{className:`flex flex-col items-center text-center mb-8`,children:[(0,K.jsxs)(`div`,{className:`relative mb-6 p-6 rounded-2xl ${r.bg} bg-opacity-10 border border-white/5 shadow-[0_0_30px_rgba(0,0,0,0.5)]`,children:[(0,K.jsx)(`div`,{className:`absolute inset-0 rounded-2xl ${r.bg} blur-xl opacity-40`}),(0,K.jsx)(i,{size:48,className:`relative ${r.color}`})]}),(0,K.jsx)(`h2`,{className:`text-2xl font-bold text-white mb-2`,children:`Leaving aqadilOS`}),(0,K.jsxs)(`p`,{className:`text-gray-400 text-sm`,children:[`You are attempting to navigate to `,(0,K.jsx)(`span`,{className:`text-white font-medium`,children:r.name}),`.`]}),(0,K.jsxs)(`div`,{className:`mt-4 px-4 py-2 bg-black/50 rounded-lg border border-white/5 flex items-center gap-2 max-w-full`,children:[(0,K.jsx)(Eu,{size:12,className:`text-gray-500 shrink-0`}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400 truncate font-mono`,children:e.url})]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,K.jsx)(`button`,{onClick:n,className:`py-3.5 rounded-xl font-medium text-sm text-gray-400 hover:text-white hover:bg-white/5 transition-all`,children:`Cancel`}),(0,K.jsxs)(`button`,{onClick:t,className:`relative group py-3.5 rounded-xl font-bold text-sm text-black bg-white overflow-hidden`,children:[(0,K.jsxs)(`span`,{className:`relative z-10 flex items-center justify-center gap-2`,children:[`Open Link `,(0,K.jsx)(Zl,{size:14})]}),(0,K.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-r from-gray-100 to-gray-300 opacity-0 group-hover:opacity-100 transition-opacity`})]})]})]})]})]})})}var Ud=({size:e,className:t})=>(0,K.jsx)(`img`,{src:`/akadilium.png`,className:`${t} rounded`,style:{width:e,height:e},alt:`Akadilium`}),Wd=({onNavigate:e})=>(0,K.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full bg-gray-900 font-sans`,children:(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-8 max-w-2xl w-full px-8`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,K.jsx)(`img`,{src:`/akadilium.png`,className:`w-16 h-16 object-contain`}),(0,K.jsx)(`h1`,{className:`text-3xl font-semibold text-white`,children:`Akadilium`})]}),(0,K.jsx)(`div`,{className:`w-full max-w-xl`,children:(0,K.jsx)(`form`,{onSubmit:t=>{t.preventDefault();let n=t.target[0].value;n&&e(n)},className:`relative`,children:(0,K.jsxs)(`div`,{className:`flex items-center bg-gray-800 border border-gray-700 rounded-lg shadow-sm hover:shadow-md transition-shadow`,children:[(0,K.jsx)(nd,{size:18,className:`text-gray-400 ml-4 mr-3`}),(0,K.jsx)(`input`,{type:`text`,placeholder:`Search Google or type a URL`,className:`flex-1 py-3 px-2 bg-transparent border-none outline-none text-white placeholder-gray-500 text-sm`,autoFocus:!0}),(0,K.jsx)(`button`,{type:`submit`,className:`px-4 py-2 bg-blue-600 text-white text-sm rounded-r-md hover:bg-blue-700 transition-colors`,children:`Search`})]})})}),(0,K.jsx)(`div`,{className:`grid grid-cols-5 gap-4 mt-8`,children:[{name:`GitHub`,url:`https://github.com/AQADIL`,icon:(0,K.jsx)(`img`,{src:`/github.png`,style:{width:30,height:30},alt:`GitHub`}),color:`hover:bg-gray-800`},{name:`Portfolio`,url:`resume://open`,icon:(0,K.jsx)(tu,{size:24}),color:`hover:bg-blue-900/30`},{name:`Wiki`,url:`https://www.wikipedia.org`,icon:(0,K.jsx)(`img`,{src:`/wiki.png`,style:{width:30,height:30},alt:`Wiki`}),color:`hover:bg-gray-800`},{name:`YouTube`,url:`https://youtube.com`,icon:(0,K.jsx)(Qu,{size:24}),color:`hover:bg-gray-800`},{name:`AkadilEDU`,url:`https://akadiledu.com`,icon:(0,K.jsx)(`img`,{src:`/logo.png`,style:{width:30,height:30},alt:`AkadilEDU`}),color:`hover:bg-green-800`}].map(t=>(0,K.jsxs)(`button`,{onClick:()=>e(t.url),className:`flex flex-col items-center gap-2 p-4 rounded-xl transition-all duration-300 ${t.color} hover:scale-105 group`,children:[(0,K.jsx)(`div`,{className:`w-12 h-12 bg-white/5 rounded-full flex items-center justify-center text-2xl border border-white/10 group-hover:border-white/30 shadow-lg`,children:t.icon}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400 font-medium`,children:t.name})]},t.name))})]})});function Gd({onOpenApp:e}){let{openLink:t}=Bd(),[n,r]=(0,S.useState)([{id:1,title:`New Tab`,url:`home`,icon:(0,K.jsx)(Ud,{size:14}),isLoading:!1}]),[i,a]=(0,S.useState)(1),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(0),[u,d]=(0,S.useState)(1402);(0,S.useEffect)(()=>{let e=setInterval(()=>{d(e=>e+Math.floor(Math.random()*3))},5e3);return()=>clearInterval(e)},[]);let f=n.find(e=>e.id===i)||n[0];(0,S.useEffect)(()=>{f.url===`home`?s(``):s(f.url)},[i,f.url]);let p=t=>{let n=t,r=t;if(t===`resume://open`){e&&e(`notepad`);return}!t.includes(`.`)||t.includes(` `)?(n=`https://duckduckgo.com/?q=${encodeURIComponent(t)}`,r=`${t} - Search`):(t.startsWith(`http`)||(n=`https://${t}`),r=t),m(i,{url:n,title:r,isLoading:!0}),setTimeout(()=>{m(i,{isLoading:!1})},1500)},m=(e,t)=>
383{r(n=>n.map(n=>n.id===e?{...n,...t}:n))},h=()=>{let e=Math.max(...n.map(e=>e.id))+1;r([...n,{id:e,title:`New Tab`,url:`home`,icon:(0,K.jsx)(Ud,{size:14}),isLoading:!1}]),a(e)},g=(e,t)=>{if(e.stopPropagation(),n.length===1)return;let o=n.filter(e=>e.id!==t);r(o),i===t&&a(o[o.length-1].id)};return(0,K.jsxs)(`div`,{className:`flex flex-col h-full bg-[#1c1c1e] text-gray-300`,children:[(0,K.jsx)(`div`,{className:`bg-[#2a2a2c] pt-2 px-2 flex items-end gap-1 select-none`,children:(0,K.jsxs)(`div`,{className:`flex-1 flex items-end gap-1 overflow-x-auto no-scrollbar`,children:[n.map(e=>(0,K.jsxs)(`div`,{onClick:()=>a(e.id),className:` 384 group relative flex items-center gap-2 px-3 py-2 text-xs max-w-[180px] min-w-[120px] rounded-t-lg cursor-pointer transition-all 385 ${i===e.id?`bg-[#3a3a3c] text-white shadow-[-1px_-1px_0_rgba(255,255,255,0.05)]`:`bg-transparent hover:bg-[#323234] text-gray-400`} 386 `,children:[e.isLoading?(0,K.jsx)(td,{size:12,className:`animate-spin text-blue-400`}):(0,K.jsx)(Ud,{size:12,className:i===e.id?`opacity-100`:`opacity-60`}),(0,K.jsx)(`span`,{className:`truncate flex-1`,children:e.title}),(0,K.jsx)(`button`,{onClick:t=>g(t,e.id),className:`opacity-0 group-hover:opacity-100 hover:bg-white/10 rounded p-0.5`,children:(0,K.jsx)(yd,{size:10})}),i===e.id&&(0,K.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-1 bg-[#3a3a3c] z-10 translate-y-1`})]},e.id)),(0,K.jsx)(`button`,{onClick:h,className:`p-2 hover:bg-white/5 rounded-md text-gray-400 mb-1`,children:(0,K.jsx)($u,{size:16})})]})}),(0,K.jsxs)(`div`,{className:`bg-[#3a3a3c] px-3 py-2 flex items-center gap-3 border-b border-black/20 shadow-md relative z-20`,children:[(0,K.jsxs)(`div`,{className:`flex gap-1`,children:[(0,K.jsx)(`button`,{className:`p-1.5 hover:bg-white/10 rounded-full text-gray-400`,children:(0,K.jsx)(Xl,{size:16})}),(0,K.jsx)(`button`,{className:`p-1.5 hover:bg-white/10 rounded-full text-gray-400`,children:(0,K.jsx)(Zl,{size:16})}),(0,K.jsx)(`button`,{onClick:()=>{l(e=>e+1),m(i,{isLoading:!0}),setTimeout(()=>m(i,{isLoading:!1}),1e3)},className:`p-1.5 hover:bg-white/10 rounded-full text-gray-400`,children:(0,K.jsx)(td,{size:14,className:f.isLoading?`animate-spin`:``})})]}),(0,K.jsxs)(`div`,{className:`flex-1 bg-[#1c1c1e] rounded-lg flex items-center px-3 py-1.5 border border-white/5 focus-within:border-blue-500/50 transition-colors`,children:[f.url.startsWith(`https`)?(0,K.jsx)(Ru,{size:12,className:`text-green-500 mr-2`}):(0,K.jsx)(nd,{size:12,className:`text-gray-500 mr-2`}),(0,K.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&p(o),onFocus:e=>e.target.select(),className:`flex-1 bg-transparent border-none outline-none text-sm text-white placeholder-gray-600 font-mono`}),(0,K.jsx)(`button`,{className:`text-gray-500 hover:text-yellow-400`,children:(0,K.jsx)(fd,{size:14})})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 relative bg-white overflow-hidden`,children:[f.isLoading&&(0,K.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-0.5 bg-blue-500/20 z-50`}),f.url===`home`?(0,K.jsx)(Wd,{onNavigate:p}):(0,K.jsx)(`div`,{className:`w-full h-full relative`,children:f.url.includes(`google.com`)||f.url.includes(`youtube.com`)?(0,K.jsxs)(`div`,{className:`absolute inset-0 bg-[#1c1c1e] text-white flex flex-col items-center justify-center gap-4`,children:[(0,K.jsx)(cd,{size:64,className:`text-red-500`}),(0,K.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Security Protocol Activated`}),(0,K.jsxs)(`p`,{className:`text-gray-400 text-center max-w-md`,children:[`The site `,(0,K.jsx)(`b`,{children:f.url}),` prohibits embedding in Akadilium OS for security reasons (X-Frame-Options).`]}),(0,K.jsx)(`button`,{onClick:()=>t(f.url),className:`px-6 py-2 bg-blue-600 hover:bg-blue-500 rounded-lg text-sm font-medium transition`,children:`Open in External Tab`}),(0,K.jsx)(`button`,{onClick:()=>m(i,{url:`home`,title:`New Tab`}),className:`text-sm text-gray-500 hover:text-white underline`,children:`Go Home`})]}):(0,K.jsx)(`iframe`,{src:f.url,title:f.title,className:`w-full h-full border-none bg-white`,sandbox:`allow-same-origin allow-scripts allow-popups allow-forms`},c)})]})]})}var Kd=s((e=>{e.ConcurrentRoot=1,e.ContinuousEventPriority=8,e.DefaultEventPriority=32,e.DiscreteEventPriority=2})),qd=s(((e,t)=>{t.exports=Kd()}
vendor: 4,217 bytes, line 386
386)),Jd=qd(),Yd={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Xd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Zd=`attached`,Qd=`detached`,$d=1e3,ef=1001,tf=1002,nf=1003,rf=1004,af=1004,of=1005,sf=1005,cf=1006,lf=1007,uf=1007,df=1008,ff=1008,pf=1009,mf=1010,hf=1011,gf=1012,_f=1013,vf=1014,yf=1015,bf=1016,xf=1017,Sf=1018,Cf=1020,wf=35902,Tf=35899,Ef=1021,Df=1022,Of=1023,kf=1026,Af=1027,jf=1028,Mf=1029,Nf=1030,Pf=1031,Ff=1032,If=1033,Lf=33776,Rf=33777,zf=33778,Bf=33779,Vf=35840,Hf=35841,Uf=35842,Wf=35843,Gf=36196,Kf=37492,qf=37496,Jf=37488,Yf=37489,Xf=37490,Zf=37491,Qf=37808,$f=37809,ep=37810,tp=37811,np=37812,rp=37813,ip=37814,ap=37815,op=37816,sp=37817,cp=37818,lp=37819,up=37820,dp=37821,fp=36492,pp=36494,mp=36495,hp=36283,gp=36284,_p=36285,vp=36286,yp=2200,bp=2201,xp=2202,Sp=2300,Cp=2301,wp=2302,Tp=2400,Ep=2401,Dp=2402,Op=2500,kp=2501,Ap=3200,jp=3201,Mp=3202,Np=3203,Pp=`srgb`,Fp=`srgb-linear`,Ip=`linear`,Lp=`srgb`,Rp=7680,zp=7681,Bp=7682,Vp=7683,Hp=34055,Up=34056,Wp=5386,Gp=35044,Kp=35048,qp=35040,Jp=35045,Yp=35049,Xp=35041,Zp=35046,Qp=35050,$p=35042,em=`300 es`,tm=2e3,nm=2001,rm={COMPUTE:`compute`,RENDER:`render`},im={PERSPECTIVE:`perspective`,LINEAR:`linear`,FLAT:`flat`},am={NORMAL:`normal`,CENTROID:`centroid`,SAMPLE:`sample`,FIRST:`first`,EITHER:`either`};function om(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var sm={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function cm(e,t){return new sm[e](t)}function lm(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function um(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function dm(){let e=um(`canvas`);return e.style.display=`block`,e}var fm={},pm=null;function mm(e){pm=e}function hm(){return pm}function gm(...e){let t=`THREE.`+e.shift();pm?pm(`log`,t,...e):console.log(t,...e)}function J(...e){let t=`THREE.`+e.shift();pm?pm(`warn`,t,...e):console.warn(t,...e)}function _m(...e){let t=`THREE.`+e.shift();pm?pm(`error`,t,...e):console.error(t,...e)}function vm(...e){let t=e.join(` `);t in fm||(fm[t]=!0,J(...e))}function ym(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var bm=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},xm=`00.01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.10.11.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.20.21.22.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.30.31.32.33.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.40.41.42.43.44.45.46.47.48.49.4a.4b.4c.4d.4e.4f.50.51.52.53.54.55.56.57.58.59.5a.5b.5c.5d.5e.5f.60.61.62.63.64.65.66.67.68.69.6a.6b.6c.6d.6e.6f.70.71.72.73.74.75.76.77.78.79.7a.7b.7c.7d.7e.7f.80.81.82.83.84.85.86.87.88.89.8a.8b.8c.8d.8e.8f.90.91.92.93.94.95.96.97.98.99.9a.9b.9c.9d.9e.9f.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.aa.ab.ac.ad.ae.af.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bb.bc.bd.be.bf.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cc.cd.ce.cf.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.dd.de.df.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ee.ef.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.ff`.split(`.`),Sm=1234567,Cm=Math.PI/180,wm=180/Math.PI;function Tm(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(xm[e&255]+xm[e>>8&255]+xm[e>>16&255]+xm[e>>24&255]+`-`+xm[t&255]+xm[t>>8&255]+`-`+xm[t>>16&15|64]+xm[t>>24&255]+`-`+xm[n&63|128]+xm[n>>8&255]+`-`+xm[n>>16&255]+xm[n>>24&255]+xm[r&255]+xm[r>>8&255]+xm[r>>16&255]+xm[r>>24&255]).toLowerCase()}function Em(e,t,n){return Math.max(t,Math.min(n,e))}function Dm(e,t){return(e%t+t)%t}
vendor: 4,294 bytes, line 386
386function Om(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function km(e,t,n){return e===t?0:(n-e)/(t-e)}function Am(e,t,n){return(1-n)*e+n*t}function jm(e,t,n,r){return Am(e,t,1-Math.exp(-n*r))}function Mm(e,t=1){return t-Math.abs(Dm(e,t*2)-t)}function Nm(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Pm(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Fm(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Im(e,t){return e+Math.random()*(t-e)}function Lm(e){return e*(.5-Math.random())}function Rm(e){e!==void 0&&(Sm=e);let t=Sm+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function zm(e){return e*Cm}function Bm(e){return e*wm}function Vm(e){return(e&e-1)==0&&e!==0}function Hm(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Um(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Wm(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:J(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Gm(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function Km(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var qm={DEG2RAD:Cm,RAD2DEG:wm,generateUUID:Tm,clamp:Em,euclideanModulo:Dm,mapLinear:Om,inverseLerp:km,lerp:Am,damp:jm,pingpong:Mm,smoothstep:Nm,smootherstep:Pm,randInt:Fm,randFloat:Im,randFloatSpread:Lm,seededRandom:Rm,degToRad:zm,radToDeg:Bm,isPowerOfTwo:Vm,ceilPowerOfTwo:Hm,floorPowerOfTwo:Um,setQuaternionFromProperEuler:Wm,normalize:Km,denormalize:Gm},Y=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Em(this.x,e.x,t.x),this.y=Em(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Em(this.x,e,t),this.y=Em(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Em(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}
vendor: 16,713 bytes, line 386
386round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Em(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Jm=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o<=0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o>=1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:J(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Em(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},X=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Xm.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Xm.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Em(this.x,e.x,t.x),this.y=Em(this.y,e.y,t.y),this.z=Em(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Em(this.x,e,t),this.y=Em(this.y,e,t),this.z=Em(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Em(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Ym.copy(this).projectOnVector(e),this.sub(Ym)}reflect(e){return this.sub(Ym.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Em(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Ym=new X,Xm=new Jm,Zm=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Qm.makeScale(e,t)),this}rotate(e){return this.premultiply(Qm.makeRotation(-e)),this}translate(e,t){return this.premultiply(Qm.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Qm=new Zm,$m=new Zm().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),eh=new Zm().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.20397
3867,1.0569715);function th(){let e={enabled:!0,workingColorSpace:Fp,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=rh(e.r),e.g=rh(e.g),e.b=rh(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=ih(e.r),e.g=ih(e.g),e.b=ih(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?Ip:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return vm(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return vm(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Fp]:{primaries:t,whitePoint:r,transfer:Ip,toXYZ:$m,fromXYZ:eh,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Pp},outputColorSpaceConfig:{drawingBufferColorSpace:Pp}},[Pp]:{primaries:t,whitePoint:r,transfer:Lp,toXYZ:$m,fromXYZ:eh,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Pp}}}),e}var nh=th();function rh(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function ih(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var ah,oh=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ah===void 0&&(ah=um(`canvas`)),ah.width=e.width,ah.height=e.height;let t=ah.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=ah}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=um(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=rh(i[e]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(rh(t[e]/255)*255):t[e]=rh(t[e]);return{data:t,width:e.width,height:e.height}}else return J(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},sh=0,ch=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,`id`,{value:sh++}),this.uuid=Tm(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<`u`&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<`u`&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t===null?e.set(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(lh(r[t].image)):e.push(lh(r[t]))}else e=lh(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function lh(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?oh.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(J(`Texture: Unable to serialize Texture.`),{})}var uh=0,dh=new X,fh=class e extends bm{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=ef,i=ef,a=cf,o=df,s=Of,c=pf,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,`id`,{value:uh++}),this.uuid=Tm(),this.name=``,this.source=new ch(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new Y(0,0),this.repeat=new Y(1,1),this.center=new Y(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Zm,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace
vendor: 4,727 bytes, line 386
386=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(dh).x}get height(){return this.source.getSize(dh).y}get depth(){return this.source.getSize(dh).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){J(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){J(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $d:e.x-=Math.floor(e.x);break;case ef:e.x=e.x<0?0:1;break;case tf:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case $d:e.y-=Math.floor(e.y);break;case ef:e.y=e.y<0?0:1;break;case tf:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};fh.DEFAULT_IMAGE=null,fh.DEFAULT_MAPPING=300,fh.DEFAULT_ANISOTROPY=1;var ph=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}
vendor: 5,510 bytes, line 386
386sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Em(this.x,e.x,t.x),this.y=Em(this.y,e.y,t.y),this.z=Em(this.z,e.z,t.z),this.w=Em(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Em(this.x,e,t),this.y=Em(this.y,e,t),this.z=Em(this.z,e,t),this.w=Em(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Em(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},mh=class extends bm{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:cf,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new ph(0,0,e,t),this.scissorTest=!1,this.viewport=new ph(0,0,e,t);let r=new fh({width:e,height:t,depth:n.depth});this.textures=[];let i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){let t={minFilter:cf,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace
vendor: 48,868 bytes, line 386
386=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new ch(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:`dispose`})}},hh=class extends mh{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},gh=class extends fh{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=nf,this.minFilter=nf,this.wrapR=ef,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},_h=class extends hh{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new gh(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},vh=class extends fh{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=nf,this.minFilter=nf,this.wrapR=ef,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},yh=class extends hh{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new vh(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},bh=class{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Sh.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Sh.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=Sh.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,Sh):Sh.fromBufferAttribute(r,t),Sh.applyMatrix4(e.matrixWorld),this.expandByPoint(Sh);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),Ch.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),Ch.copy(e.boundingBox)),Ch.applyMatrix4(e.matrixWorld),this.union(Ch)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Sh),Sh.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ah),jh.subVectors(this.max,Ah),wh.subVectors(e.a,Ah),Th.subVectors(e.b,Ah),Eh.subVectors(e.c,Ah),Dh.subVectors(Th,wh),Oh.subVectors(Eh,Th),kh.subVectors(wh,Eh);let t=[0,-Dh.z,Dh.y,0,-Oh.z,Oh.y,0,-kh.z,kh.y,Dh.z,0,-Dh.x,Oh.z,0,-Oh.x,kh.z,0,-kh.x,-Dh.y,Dh.x,0,-Oh.y,Oh.x,0,-kh.y,kh.x,0];return!Ph(t,wh,Th,Eh,jh)||(t=[1,0,0,0,1,0,0,0,1],!Ph(t,wh,Th,Eh,jh))?!1:(Mh.crossVectors(Dh,Oh),t=[Mh.x,Mh.y,Mh.z],Ph(t,wh,Th,Eh,jh))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Sh).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Sh).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(xh[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xh[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xh[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xh[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xh[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xh[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xh[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xh[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xh),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},xh=[new X,new X,new X,new X,new X,new X,new X,new X],Sh=new X,Ch=new bh,wh=new X,Th=new X,Eh=new X,Dh=new X,Oh=new X,kh=new X,Ah=new X,jh=new X,Mh=new X,Nh=new X;function Ph(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Nh.fromArray(e,a);let o=i.x*Math.abs(Nh.x)+i.y*Math.abs(Nh.y)+i.z*Math.abs(Nh.z),s=t.dot(Nh),c=n.dot(Nh),l=r.dot(Nh);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Fh=new bh,Ih=new X,Lh=new X,Rh=class{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Fh.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ih.subVectors(e,this.center);let t=Ih.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Ih,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Lh.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ih.copy(e.center).add(Lh)),this.expandByPoint(Ih.copy(e.center).sub(Lh))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},zh=new X,Bh=new X,Vh=new X,Hh=new X,Uh=new X,Wh=new X,Gh=new X,Kh=class{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,zh)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=zh.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(zh.copy(this.origin).addScaledVector(this.direction,t),zh.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Bh.copy(e).add(t).multiplyScalar(.5),Vh.copy(t).sub(e).normalize(),Hh.copy(this.origin).sub(Bh);let i=e.distanceTo(t)*.5,a=-this.direction.dot(Vh),o=Hh.dot(this.direction),s=-Hh.dot(Vh),c=Hh.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Bh).addScaledVector(Vh,d),f}intersectSphere(e,t){zh.subVectors(e.center,this.origin);let n=zh.dot(this.direction),r=zh.dot(zh)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,zh)!==null}intersectTriangle(e,t,n,r,i){Uh.subVectors(t,e),Wh.subVectors(n,e),Gh.crossVectors(Uh,Wh);let a=this.direction.dot(Gh),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Hh.subVectors(this.origin,e);let s=o*this.direction.dot(Wh.crossVectors(Hh,Wh));if(s<0)return null;let c=o*this.direction.dot(Uh.cross(Hh));if(c<0||s+c>a)return null;let l=-o*Hh.dot(Gh);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},qh=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();let t=this.elements,n=e.elements,r=1/Jh.setFromMatrixColumn(e,0).length(),i=1/Jh.setFromMatrixColumn(e,1).length(),a=1/Jh.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Xh,e,Zh)}lookAt(e,t,n){let r=this.elements;return eg.subVectors(e,t),eg.lengthSq()===0&&(eg.z=1),eg.normalize(),Qh.crossVectors(n,eg),Qh.lengthSq()===0&&(Math.abs(n.z)===1?eg.x+=1e-4:eg.z+=1e-4,eg.normalize(),Qh.crossVectors(n,eg)),Qh.normalize(),$h.crossVectors(eg,Qh),r[0]=Qh.x,r[4]=$h.x,r[8]=eg.x,r[1]=Qh.y,r[5]=$h.y,r[9]=eg.y,r[2]=Qh.z,r[6]=$h.z,r[10]=eg.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],ee=r[14],M=r[3],te=r[7],N=r[11],P=r[15];return i[0]=a*x+o*T+s*k+c*M,i[4]=a*S+o*E+s*A+c*te,i[8]=a*C+o*D+s*j+c*N,i[12]=a*w+o*O+s*ee+c*P,i[1]=l*x+u*T+d*k+f*M,i[5]=l*S+u*E+d*A+f*te,i[9]=l*C+u*D+d*j+f*N,i[13]=l*w+u*O+d*ee+f*P,i[2]=p*x+m*T+h*k+g*M,i[6]=p*S+m*E+h*A+g*te,i[10]=p*C+m*D+h*j+g*N,i[14]=p*w+m*O+h*ee+g*P,i[3]=_*x+v*T+y*k+b*M,i[7]=_*S+v*E+y*A+b*te,i[11]=_*C+v*D+y*j+b*N,i[15]=_*w+v*O+y*ee+b*P,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return n.set(1,1,1),t.identity(),this;let i=Jh.set(r[0],r[1],r[2]).length(),a=Jh.set(r[4],r[5],r[6]).length(),o=Jh.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),Yh.copy(this);let s=1/i,c=1/a,l=1/o;return Yh.elements[0]*=s,Yh.elements[1]*=s,Yh.elements[2]*=s,Yh.elements[4]*=c,Yh.elements[5]*=c,Yh.elements[6]*=c,Yh.elements[8]*=l,Yh.elements[9]*=l,Yh.elements[10]*=l,t.setFromRotationMatrix(Yh),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=tm,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=tm,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},Jh=new X,Yh=new qh,Xh=new X(0,0,0),Zh=new X(1,1,1),Qh=new X,$h=new X,eg=new X,tg=new qh,ng=new Jm,rg=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(Em(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-Em(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(Em(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-Em(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(Em(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-Em(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:J(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return tg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(tg,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ng.setFromEuler(this),this.setFromQuaternion(ng,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};rg.DEFAULT_ORDER=`XYZ`;var ig=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!=0}},ag=0,og=new X,sg=new Jm,cg=new qh,lg=new X,ug=new X,dg=new X,fg=new Jm,pg=new X(1,0,0),mg=new X(0,1,0),hg=new X(0,0,1),gg={type:`added`},_g={type:`removed`},vg={type:`childadded`,child:null},yg={type:`childremoved`,child:null},bg=class e extends bm{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,`id`,{value:ag++}),this.uuid=Tm(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new X,n=new rg,r=new Jm,i=new X(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new qh},normalMatrix:{value:new Zm}}),this.matrix=new qh,this.matrixWorld=new qh,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ig,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return sg.setFromAxisAngle(e,t),this.quaternion.multiply(sg),this}rotateOnWorldAxis(e,t){return sg.setFromAxisAngle(e,t),this.quaternion.premultiply(sg),this}rotateX(e){return this.rotateOnAxis(pg,e)}rotateY(e){return this.rotateOnAxis(mg,e)}rotateZ(e){return this.rotateOnAxis(hg,e)}translateOnAxis(e,t){return og.copy(e).applyQuaternion(this.quaternion),this.position.add(og.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(pg,e)}translateY(e){return this.translateOnAxis(mg,e)}translateZ(e){return this.translateOnAxis(hg,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(cg.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?lg.copy(e):lg.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),ug.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?cg.lookAt(ug,lg,this.up):cg.lookAt(lg,ug,this.up),this.quaternion.setFromRotationMatrix(cg),r&&(cg.extractRotation(r.matrixWorld),sg.setFromRotationMatrix(cg),this.quaternion.premultiply(sg.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(_m(`Object3D.add: object can't be added as a child of itself.`,e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(gg),vg.child=e,this.dispatchEvent(vg),vg.child=null):_m(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(_g),yg.child=e,this.dispatchEvent(yg),yg.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),cg.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),cg.multiply(e.parent.matrixWorld)),e.applyMatrix4(cg),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(gg),vg.child=e,this.dispatchEvent(vg),vg.child=null,this}getObjectById(e){return this.getObjectByProperty(`id`,e)}getObjectByName(e){return this.getObjectByProperty(`name`,e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ug,e,dg),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ug,fg,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){let n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){let e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==``&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};bg.DEFAULT_UP=new X(0,1,0),bg.DEFAULT_MATRIX_AUTO_UPDATE=!0,bg.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var xg=new X,Sg=new X,Cg=new X,wg=new X,Tg=new X,Eg=new X,Dg=new X,Og=new X,kg=new X,Ag=new X,jg=new ph,Mg=new ph,Ng=new ph,Pg=class e{constructor(e=new X,t=new X,n=new X){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),xg.subVectors(e,t),r.cross(xg);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){xg.subVectors(r,t),Sg.subVectors(n,t),Cg.subVectors(e,t);let a=xg.dot(xg),o=xg.dot(Sg),s=xg.dot(Cg),c=Sg.dot(Sg),l=Sg.dot(Cg),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,wg)===null?!1:wg.x>=0&&wg.y>=0&&wg.x+wg.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,wg)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,wg.x),s.addScaledVector(a,wg.y),s.addScaledVector(o,wg.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return jg.setScalar(0),Mg.setScalar(0),Ng.setScalar(0),jg.fromBufferAttribute(e,t),Mg.fromBufferAttribute(e,n),Ng.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(jg,i.x),a.addScaledVector(Mg,i.y),a.addScaledVector(Ng,i.z),a}static isFrontFacing(e,t,n,r){return xg.subVectors(n,t),Sg.subVectors(e,t),xg.cross(Sg).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return xg.subVectors(this.c,this.b),Sg.subVectors(this.a,this.b),xg.cross(Sg).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Tg.subVectors(r,n),Eg.subVectors(i,n),Og.subVectors(e,n);let s=Tg.dot(Og),c=Eg.dot(Og);if(s<=0&&c<=0)return t.copy(n);kg.subVectors(e,r);let l=Tg.dot(kg),u=Eg.dot(kg);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Tg,a);Ag.subVectors(e,i);let f=Tg.dot(Ag),p=Eg.dot(Ag);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Eg,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return Dg.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(Dg,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Tg,a).addScaledVector(Eg,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Fg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ig={h:0,s:0,l:0},Lg={h:0,s:0,l:0};function Rg(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var Z=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Pp){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,nh.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=nh.workingColorSpace){return this.r=e,this.g=t,this.b=n,nh.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=nh.workingColorSpace){if(e=Dm(e,1),t=Em(t,0,1),n=Em(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Rg(i,r,e+1/3),this.g=Rg(i,r,e),this.b=Rg(i,r,e-1/3)}return nh.colorSpaceToWorking(this,r),this}setStyle(e,t=Pp){function n(t){t!==void 0&&parseFloat(t)<1&&J(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:J(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);J(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Pp){let n=Fg[e.toLowerCase()];return n===void 0?J(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=rh(e.r),this.g=rh(e.g),this.b=rh(e.b),this}copyLinearToSRGB(e){return this.r=ih(e.r),this.g=ih(e.g),this.b=ih(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Pp){return nh.workingToColorSpace(zg.copy(this),e),Math.round(Em(zg.r*255,0,255))*65536+Math.round(Em(zg.g*255,0,255))*256+Math.round(Em(zg.b*255,0,255))}getHexString(e=Pp){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=nh.workingColorSpace){nh.workingToColorSpace(zg.copy(this),t);let n=zg.r,r=zg.g,i=zg.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4;break}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=nh.workingColorSpace){return nh.workingToColorSpace(zg.copy(this),t),e.r=zg.r,e.g=zg.g,e.b=zg.b,e}getStyle(e=Pp){nh.workingToColorSpace(zg.copy(this),e);let t=zg.r,n=zg.g,r=zg.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(Ig),this.setHSL(Ig.h+e,Ig.s+t,Ig.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Ig),e.getHSL(Lg);let n=Am(Ig.h,Lg.h,t),r=Am(Ig.s,Lg.s,t),i=Am(Ig.l,Lg.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},zg=new Z;Z.NAMES=Fg;var Bg=0,Vg=class extends bm{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,`id`,{value:Bg++}),this.uuid=Tm(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Z(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Rp,this.stencilZFail=Rp,this.stencilZPass=Rp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){J(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){J
vendor: 10,041 bytes, line 386
386(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},
vendor: 20,702 bytes, line 386
386Hg=class extends Vg{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Z(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rg,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Ug=Wg();function Wg(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function Gg(e){Math.abs(e)>65504&&J(`DataUtils.toHalfFloat(): Value out of range.`),e=Em(e,-65504,65504),Ug.floatView[0]=e;let t=Ug.uint32View[0],n=t>>23&511;return Ug.baseTable[n]+((t&8388607)>>Ug.shiftTable[n])}function Kg(e){let t=e>>10;return Ug.uint32View[0]=Ug.mantissaTable[Ug.offsetTable[t]+(e&1023)]+Ug.exponentTable[t],Ug.floatView[0]}var qg=class{static toHalfFloat(e){return Gg(e)}static fromHalfFloat(e){return Kg(e)}},Jg=new X,Yg=new Y,Xg=0,Zg=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,`id`,{value:Xg++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=Gp,this.updateRanges=[],this.gpuType=yf,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Yg.fromBufferAttribute(this,t),Yg.applyMatrix3(e),this.setXY(t,Yg.x,Yg.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Jg.fromBufferAttribute(this,t),Jg.applyMatrix3(e),this.setXYZ(t,Jg.x,Jg.y,Jg.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Jg.fromBufferAttribute(this,t),Jg.applyMatrix4(e),this.setXYZ(t,Jg.x,Jg.y,Jg.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Jg.fromBufferAttribute(this,t),Jg.applyNormalMatrix(e),this.setXYZ(t,Jg.x,Jg.y,Jg.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Jg.fromBufferAttribute(this,t),Jg.transformDirection(e),this.setXYZ(t,Jg.x,Jg.y,Jg.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Gm(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Km(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Gm(t,this.array)),t}setX(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Gm(t,this.array)),t}setY(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Gm(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Gm(t,this.array)),t}setW(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array),r=Km(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array),r=Km(r,this.array),i=Km(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==``&&(e.name=this.name),this.usage!==35044&&(e.usage=this.usage),e}},Qg=class extends Zg{constructor(e,t,n){super(new Int8Array(e),t,n)}},$g=class extends Zg{constructor(e,t,n){super(new Uint8Array(e),t,n)}},e_=class extends Zg{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}},t_=class extends Zg{constructor(e,t,n){super(new Int16Array(e),t,n)}},n_=class extends Zg{constructor(e,t,n){super(new Uint16Array(e),t,n)}},r_=class extends Zg{constructor(e,t,n){super(new Int32Array(e),t,n)}},i_=class extends Zg{constructor(e,t,n){super(new Uint32Array(e),t,n)}},a_=class extends Zg{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Kg(this.array[e*this.itemSize]);return this.normalized&&(t=Gm(t,this.array)),t}setX(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize]=Gg(t),this}getY(e){let t=Kg(this.array[e*this.itemSize+1]);return this.normalized&&(t=Gm(t,this.array)),t}setY(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize+1]=Gg(t),this}getZ(e){let t=Kg(this.array[e*this.itemSize+2]);return this.normalized&&(t=Gm(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize+2]=Gg(t),this}getW(e){let t=Kg(this.array[e*this.itemSize+3]);return this.normalized&&(t=Gm(t,this.array)),t}setW(e,t){return this.normalized&&(t=Km(t,this.array)),this.array[e*this.itemSize+3]=Gg(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array)),this.array[e+0]=Gg(t),this.array[e+1]=Gg(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array),r=Km(r,this.array)),this.array[e+0]=Gg(t),this.array[e+1]=Gg(n),this.array[e+2]=Gg(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array),r=Km(r,this.array),i=Km(i,this.array)),this.array[e+0]=Gg(t),this.array[e+1]=Gg(n),this.array[e+2]=Gg(r),this.array[e+3]=Gg(i),this}},Q=class extends Zg{constructor(e,t,n){super(new Float32Array(e),t,n)}},o_=0,s_=new qh,c_=new bg,l_=new X,u_=new bh,d_=new bh,f_=new X,p_=class e extends bm{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,`id`,{value:o_++}),this.uuid=Tm(),this.name=``,this.type=`BufferGeometry`,this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(om(e)?i_:n_)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new Zm().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return s_.makeRotationFromQuaternion(e),this.applyMatrix4(s_),this}rotateX(e){return s_.makeRotationX(e),this.applyMatrix4(s_),this}rotateY(e){return s_.makeRotationY(e),this.applyMatrix4(s_),this}rotateZ(e){return s_.makeRotationZ(e),this.applyMatrix4(s_),this}translate(e,t,n){return s_.makeTranslation(e,t,n),this.applyMatrix4(s_),this}scale(e,t,n){return s_.makeScale(e,t,n),this.applyMatrix4(s_),this}lookAt(e){return c_.lookAt(e),c_.updateMatrix(),this.applyMatrix4(c_.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(l_).negate(),this.translate(l_.x,l_.y,l_.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Q(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&J(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bh);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_m(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new X(-1/0,-1/0,-1/0),new X(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];u_.setFromBufferAttribute(n),this.morphTargetsRelative?(f_.addVectors(this.boundingBox.min,u_.min),this.boundingBox.expandByPoint(f_),f_.addVectors(this.boundingBox.max,u_.max),this.boundingBox.expandByPoint(f_)):(this.boundingBox.expandByPoint(u_.min),this.boundingBox.expandByPoint(u_.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&_m(`BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.`,this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Rh);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_m(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new X,1/0);return}if(e){let n=this.boundingSphere.center;if(u_.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];d_.setFromBufferAttribute(n),this.morphTargetsRelative?(f_.addVectors(u_.min,d_.min),u_.expandByPoint(f_),f_.addVectors(u_.max,d_.max),u_.expandByPoint(f_)):(u_.expandByPoint(d_.min),u_.expandByPoint(d_.max))}u_.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)f_.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(f_));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)f_.fromBufferAttribute(a,t),o&&(l_.fromBufferAttribute(e,t),f_.add(l_)),r=Math.max(r,n.distanceToSquared(f_))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&_m(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){_m(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv;this.hasAttribute(`tangent`)===!1&&this.setAttribute(`tangent`,new Zg(new Float32Array(4*n.count),4));let a=this.getAttribute(`tangent`),o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new X,s[e]=new X;let c=new X,l=new X,u=new X,d=new Y,f=new Y,p=new Y,m=new X,h=new X;function g(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new X,y=new X,b=new X,x=new X;function S(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e])<0?-1:1;a.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0)n=new Zg(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new X,i=new X,a=new X,o=new X,s=new X,c=new X,l=new X,u=new X;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)f_.fromBufferAttribute(e,t),f_.normalize(),e.setXYZ(t,f_.x,f_.y,f_.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new Zg(a,r,i)}if(this.index===null)return J(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:`dispose`})}},m_=new qh,h_=new Kh,g_=new Rh,__=new X,v_=new X,y_=new X,b_=new X,x_=new X,S_=new X,C_=new X,w_=new X,T_=class extends bg{constructor(e=new p_,t=new Hg){super(),this.isMesh=!0,this.type=`Mesh`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){S_.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(x_.fromBufferAttribute(s,e),a?S_.addScaledVector(x_,r):S_.addScaledVector(x_.sub(t),r))}t.add(S_)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),g_.copy(n.boundingSphere),g_.applyMatrix4(i),h_.copy(e.ray).recast(e.near),!(g_.containsPoint(h_.origin)===!1&&(h_.intersectSphere(g_,__)===null||h_.origin.distanceToSquared(__)>(e.far-e.near)**2))&&(m_.copy(i).invert(),h_.copy(e.ray).applyMatrix4(m_),!(n.boundingBox!==null&&h_.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,h_)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=D_(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=D_(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.pu
vendor: 7,106 bytes, lines 386-390
386sh(r))}}else if(s!==void 0)if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=D_(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=D_(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}};function E_(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;w_.copy(s),w_.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(w_);return l<n.near||l>n.far?null:{distance:l,point:w_.clone(),object:e}}function D_(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,v_),e.getVertexPosition(c,y_),e.getVertexPosition(l,b_);let u=E_(e,t,n,r,v_,y_,b_,C_);if(u){let e=new X;Pg.getBarycoord(C_,v_,y_,b_,e),i&&(u.uv=Pg.getInterpolatedAttribute(i,s,c,l,e,new Y)),a&&(u.uv1=Pg.getInterpolatedAttribute(a,s,c,l,e,new Y)),o&&(u.normal=Pg.getInterpolatedAttribute(o,s,c,l,e,new X),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new X,materialIndex:0};Pg.getNormal(v_,y_,b_,t.normal),u.face=t,u.barycoord=e}return u}var O_=class e extends p_{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Q(c,3)),this.setAttribute(`normal`,new Q(l,3)),this.setAttribute(`uv`,new Q(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new X;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function k_(e){let t={};for(let n in e)for(let r in t[n]={},e[n]){let i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(J(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function A_(e){let t={};for(let n=0;n<e.length;n++){let r=k_(e[n]);for(let e in r)t[e]=r[e]}return t}function j_(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function M_(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:nh.workingColorSpace}var N_={clone:k_,merge:A_},P_=`void main() { 387 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 388}`,F_=`void main() { 389 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 390}`,I_=class extends Vg{constructor(e){super(),this.isShaderMaterial=!0,this.type=`ShaderMaterial`,this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=P_,this.fragmentShader=F_,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=k_(e.uniforms),this.uniformsGroups=j_(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);for(let n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:`t`,value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:`c`,value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:`v2`,value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:`v3`,value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:`v4`,value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:`m3`,value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:`m4`,value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},L_=class extends bg{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new qh,this.projectionMatrix=new qh,this.projectionMatrixInverse=new qh,this.coordinateSystem=tm,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},R_=new X,z_=new Y,B_=new Y,V_=class extends L_{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=wm*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Cm*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 4,124 bytes, line 390
390getEffectiveFOV(){return wm*2*Math.atan(Math.tan(Cm*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){R_.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(R_.x,R_.y).multiplyScalar(-e/R_.z),R_.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(R_.x,R_.y).multiplyScalar(-e/R_.z)}getViewSize(e,t){return this.getViewBounds(e,z_,B_),t.subVectors(B_,z_)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Cm*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},H_=-90,U_=1,W_=class extends bg{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new V_(H_,U_,e,t);r.layers=this.layers,this.add(r);let i=new V_(H_,U_,e,t);i.layers=this.layers,this.add(i);let a=new V_(H_,U_,e,t);a.layers=this.layers,this.add(a);let o=new V_(H_,U_,e,t);o.layers=this.layers,this.add(o);let s=new V_(H_,U_,e,t);s.layers=this.layers,this.add(s);let c=new V_(H_,U_,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},G_=class extends fh{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},K_=class extends hh{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1};this.texture=new G_([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
vendor: 17,035 bytes, lines 390-425
390=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` 391 392 varying vec3 vWorldDirection; 393 394 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 395 396 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 397 398 } 399 400 void main() { 401 402 vWorldDirection = transformDirection( position, modelMatrix ); 403 404 #include <begin_vertex> 405 #include <project_vertex> 406 407 } 408 `,fragmentShader:` 409 410 uniform sampler2D tEquirect; 411 412 varying vec3 vWorldDirection; 413 414 #include <common> 415 416 void main() { 417 418 vec3 direction = normalize( vWorldDirection ); 419 420 vec2 sampleUV = equirectUv( direction ); 421 422 gl_FragColor = texture2D( tEquirect, sampleUV ); 423 424 } 425 `},r=new O_(5,5,5),i=new I_({name:`CubemapFromEquirect`,uniforms:k_(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new T_(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=cf),new W_(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}},q_=class extends bg{constructor(){super(),this.isGroup=!0,this.type=`Group`}},J_={type:`move`},Y_=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new q_,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new q_,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new q_,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:`connected`,data:e}),this}disconnect(e){return this.dispatchEvent({type:`disconnected`,data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position),s=.02,l=.005;c.inputState.pinching&&o>s+l?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=s-l&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(J_)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new q_;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},X_=class e{constructor(e,t=25e-5){this.isFogExp2=!0,this.name=``,this.color=new Z(e),this.density=t}clone(){return new e(this.color,this.density)}toJSON(){return{type:`FogExp2`,name:this.name,color:this.color.getHex(),density:this.density}}},Z_=class e{constructor(e,t=1,n=1e3){this.isFog=!0,this.name=``,this.color=new Z(e),this.near=t,this.far=n}clone(){return new e(this.color,this.near,this.far)}toJSON(){return{type:`Fog`,name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},Q_=class extends bg{constructor(){super(),this.isScene=!0,this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new rg,this.environmentIntensity=1,this.environmentRotation=new rg,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},$_=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=Gp,this.updateRanges=[],this.version=0,this.uuid=Tm()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Tm()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Tm()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},ev=new X,tv=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ev.fromBufferAttribute(this,t),ev.applyMatrix4(e),this.setXYZ(t,ev.x,ev.y,ev.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ev.fromBufferAttribute(this,t),ev.applyNormalMatrix(e),this.setXYZ(t,ev.x,ev.y,ev.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ev.fromBufferAttribute(this,t),ev.transformDirection(e),this.setXYZ(t,ev.x,ev.y,ev.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Gm(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Km(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Km(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Km(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Km(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Km(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Gm(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Gm(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Gm(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Gm(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array),r=Km(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Km(t,this.array),n=Km(n,this.array),r=Km(r,this.array),i=Km(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){gm(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new Zg(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){gm(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},nv=class extends Vg{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new Z(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},rv,iv=new X,av=new X,ov=new X,sv=new Y,cv=new Y,lv=new qh,uv=new X,dv=new X,fv=new X,pv=new Y,mv=new Y,hv=new Y,gv=class extends bg{constructor(e=new nv){if(super(),this.isSprite=!0,this.type=`Sprite`,rv===void 0){rv=new p_;let e=new $_(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);rv.setIndex([0,1,2,0,2,3]),rv.setAttribute(`position`,new tv(e,3,0,!1)),rv.setAttribute(`uv`,new tv(e,2,3,!1))}this.geometry=rv,this.material=e,this.center=new Y(.5,.5),this.count=1}raycast(e,t){e.camera===null&&_m(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),av.setFromMatrixScale(this.matrixWorld),lv.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ov.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&av.multiplyScalar(-ov.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;_v(uv.set(-.5,-.5,0),ov,a,av,r,i),_v(dv.set(.5,-.5,0),ov,a,av,r,i),_v(fv.set(.5,.5,0),ov,a,av,r,i),pv.set(0,0),mv.set(1,0),hv.set(1,1);let o=e.ray.intersectTriangle(uv,dv,fv,!1,iv);if(o===null&&(_v(dv.set(-.5,.5,0),ov,a,av,r,i),mv.set(0,1),o=e.ray.intersectTriangle(uv,fv,dv,!1,iv),o===null))return;let s=e.ray.origin.distanceTo(iv);s<e.near||s>e.far||t.push({distance:s,point:iv.clone(),uv:Pg.getInterpolation(iv,uv,dv,fv,pv,mv,hv,new Y),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function _v(e,t,n,r,i,a){sv.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?cv.copy(sv):(cv.x=a*sv.x-i*sv.y,cv.y=i*sv.x+a*sv.y),e.copy(t),e.x+=cv.x,e.y+=cv.y,e.applyMatrix4(lv)}var vv=new X,yv=new X,bv=class extends bg{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type=`LOD`,Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e<n;e++){let n=t[e];this.addLevel(n.object.clone(),n.distance,n.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);let r=this.levels,i;for(i=0;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){let t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){let e=t.splice(n,1);return this.remove(e[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){let t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){vv.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(vv);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){vv.setFromMatrixPosition(e.matrixWorld),yv.setFromMatrixPosition(this.matrixWorld);let n=vv.distanceTo(yv)/e.zoom;t[0].object.visible=!0;let r,i;for(r=1,i=t.length;r<i;r++){let e=t[r].distance;if(t[r].object.visible&&(e-=e*t[r].hysteresis),n>=e)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){let t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];let n=this.levels;for(let e=0,r=n.length;e<r;e++){let r=n[e];t.object.levels.push({object:r.object.uuid,distance:r.distance,hysteresis:r.hysteresis})}return t}},xv=new X,Sv=new ph,Cv=new ph,wv=new X,Tv=new qh,Ev=new X,Dv=new Rh,Ov=new qh,kv=new Kh,Av=class extends T_{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type=`SkinnedMesh`,this.bindMode=Zd,this.bindMatrix=new qh,this.bindMatrixInverse=new qh,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new bh),this.boundingBox.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,Ev),this.boundingBox.expandByPoint(Ev)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Rh),this.boundingSphere.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e<t.count;e++)this.getVertexPosition(e,Ev),this.boundingSphere.expandByPoint(Ev)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let n=this.material,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Dv.copy(this.boundingSphere),Dv.applyM
vendor: 10,725 bytes, line 425
425atrix4(r),e.ray.intersectsSphere(Dv)!==!1&&(Ov.copy(r).invert(),kv.copy(e.ray).applyMatrix4(Ov),!(this.boundingBox!==null&&kv.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,kv)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new ph,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();r===1/0?e.set(1,0,0,0):e.multiplyScalar(r),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===`attached`?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===`detached`?this.bindMatrixInverse.copy(this.bindMatrix).invert():J(`SkinnedMesh: Unrecognized bindMode: `+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,r=this.geometry;Sv.fromBufferAttribute(r.attributes.skinIndex,e),Cv.fromBufferAttribute(r.attributes.skinWeight,e),xv.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){let r=Cv.getComponent(e);if(r!==0){let i=Sv.getComponent(e);Tv.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(wv.copy(xv).applyMatrix4(Tv),r)}}return t.applyMatrix4(this.bindMatrixInverse)}},jv=class extends bg{constructor(){super(),this.isBone=!0,this.type=`Bone`}},Mv=class extends fh{constructor(e=null,t=1,n=1,r,i,a,o,s,c=nf,l=nf,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Nv=new qh,Pv=new qh,Fv=class e{constructor(e=[],t=[]){this.uuid=Tm(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){J(`Skeleton: Number of inverse bone matrices does not match amount of bones.`),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new qh)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new qh;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){let i=e[r]?e[r].matrixWorld:Pv;Nv.multiplyMatrices(i,t[r]),Nv.toArray(n,r*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new e(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let n=new Mv(t,e,e,Of,yf);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let n=this.bones[t];if(n.name===e)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){let r=e.bones[n],i=t[r];i===void 0&&(J(`Skeleton: No bone found with UUID:`,r),i=new jv),this.bones.push(i),this.boneInverses.push(new qh().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.7,type:`Skeleton`,generator:`Skeleton.toJSON`},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){let i=t[r];e.bones.push(i.uuid);let a=n[r];e.boneInverses.push(a.toArray())}return e}},Iv=class extends Zg{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},Lv=new qh,Rv=new qh,zv=[],Bv=new bh,Vv=new qh,Hv=new T_,Uv=new Rh,Wv=class extends T_{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Iv(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<n;e++)this.setMatrixAt(e,Vv)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new bh),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Lv),Bv.copy(e.boundingBox).applyMatrix4(Lv),this.boundingBox.union(Bv)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Rh),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Lv),Uv.copy(e.boundingSphere).applyMatrix4(Lv),this.boundingSphere.union(Uv)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1;for(let e=0;e<n.length;e++)n[e]=r[i+e]}raycast(e,t){let n=this.matrixWorld,r=this.count;if(Hv.geometry=this.geometry,Hv.material=this.material,Hv.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Uv.copy(this.boundingSphere),Uv.applyMatrix4(n),e.ray.intersectsSphere(Uv)!==!1))for(let i=0;i<r;i++){this.getMatrixAt(i,Lv),Rv.multiplyMatrices(n,Lv),Hv.matrixWorld=Rv,Hv.raycast(e,zv);for(let e=0,n=zv.length;e<n;e++){let n=zv[e];n.instanceId=i,n.object=this,t.push(n)}zv.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Iv(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){let n=t.morphTargetInfluences,r=n.length+1;this.morphTexture===null&&(this.morphTexture=new Mv(new Float32Array(r*this.count),r,this.count,jf,yf));let i=this.morphTexture.source.data.data,a=0;for(let e=0;e<n.length;e++)a+=n[e];let o=this.geometry.morphTargetsRelative?1:1-a,s=r*e;i[s]=o,i.set(n,s+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:`dispose`}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}},Gv=new X,Kv=new X,qv=new Zm,Jv=class{constructor(e=new X(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=Gv.subVectors(n,t).cross(Kv.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(Gv),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||qv.getNormalMatrix(e),r=this.coplanarPoint(Gv).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},Yv=new Rh,Xv=new Y(.5,.5),Zv=new X,Qv=class{constructor(e=new Jv,t=new Jv,n=new Jv,r=new Jv,i=new Jv,a=new Jv){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=tm,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Yv.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Yv.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Yv)}intersectsSprite(e){return Yv.center.set(0,0,0),Yv.radius=.7071067811865476+Xv.distanceTo(e.center),Yv.applyMatrix4(e.matrixWorld),this.intersectsSphere(Yv)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(Zv.x=r.normal.x>
vendor: 4,299 bytes, line 425
4250?e.max.x:e.min.x,Zv.y=r.normal.y>0?e.max.y:e.min.y,Zv.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Zv)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},$v=new qh,ey=new Qv,ty=class e{constructor(){this.coordinateSystem=tm}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if($v.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ey.setFromProjectionMatrix($v,r.coordinateSystem,r.reversedDepth),ey.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if($v.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ey.setFromProjectionMatrix($v,r.coordinateSystem,r.reversedDepth),ey.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if($v.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ey.setFromProjectionMatrix($v,r.coordinateSystem,r.reversedDepth),ey.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if($v.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ey.setFromProjectionMatrix($v,r.coordinateSystem,r.reversedDepth),ey.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){let r=t.cameras[n];if($v.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ey.setFromProjectionMatrix($v,r.coordinateSystem,r.reversedDepth),ey.containsPoint(e))return!0}return!1}clone(){return new e}};function ny(e,t){return e-t}function ry(e,t){return e.z-t.z}function iy(e,t){return t.z-e.z}var ay=class{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,r){let i=this.pool,a=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});let o=i[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=r}reset(){this.list.length=0,this.index=0}},oy=new qh,sy=new Z(1,1,1),cy=new Qv,ly=new ty,uy=new bh,dy=new Rh,fy=new X,py=new X,my=new X,hy=new ay,gy=new T_,_y=[];function vy(e,t,n=0){let r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let i=e.count;for(let a=0;a<i;a++)for(let i=0;i<r;i++)t.setComponent(a+n,i,e.getComponent(a,i))}else t.array.set(e.array,n*r);t.needsUpdate=!0}function yy(e,t){if(e.constructor!==t.constructor){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)t[r]=e[r]}else{let n=Math.min(e.length,t.length);t.set(new e.constructor(e.buffer,0,n))}}var by=class extends T_{constructor(e,t,n=t*2,r){super(new p_,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4),this._matricesTexture=new Mv(new Float32Array(e*e*4),e,e,Of,yf)}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e),this._indirectTexture=new Mv(new Uint32Array(e*e),e,e,Mf,vf)}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);let t=new Mv(new Float32Array(e*e*4).fill(1),e,e,Of,yf);
425t.colorSpace=nh.workingColorSpace,this._colorsTexture=t}_initializeGeometry(e){let t=this.geometry,n=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(let r in e.attributes){let{array:i,itemSize:a,normalized:o}=e.getAttribute(r),s=new Zg(new i.constructor(n*a),a,o);t.setAttribute(r,s)}if(e.getIndex()!==null){let e=n>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Zg(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error(`THREE.BatchedMesh: All geometries must consistently have "index".`);for(let n in t.attributes){if(!e.hasAttribute(n))throw Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);let r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw Error(`THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.`)}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bh);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;let r=t[n].geometryIndex;this.getMatrixAt(n,oy),this.getBoundingBoxAt(r,uy).applyMatrix4(oy),e.union(uy)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Rh);let e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;let r=t[n].geometryIndex;this.getMatrixAt(n,oy),this.getBoundingSphereAt(r,dy).applyMatrix4(oy),e.union(dy)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw Error(`THREE.BatchedMesh: Maximum item count reached.`);let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(ny),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let r=this._matricesTexture;oy.identity().toArray(r.image.data,n*16),r.needsUpdate=!0;let i=this._colorsTexture;return i&&(sy.toArray(i.image.data,n*4),i.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},i=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute(`position`).count:t;let a=e.getIndex();if(a!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?a.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error(`THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.`);let o;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(ny),o=this._availableGeometryIds.shift(),i[o]=r):(o=this._geometryCount,this._geometryCount++,i.push(r)),this.setGeometryAt(o,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,o}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error(`THREE.BatchedMesh: Maximum geometry count reached.`);this._validateGeometry(t);let n=this.geometry,r=n.getIndex()!==null,i=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(r&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw Error(`THREE.BatchedMesh: Reserved space not large enough for provided geometry.`);let s=o.vertexStart,c=o.reservedVertexCount;for(let e in o.vertexCount=t.getAttribute(`position`).count,n.attributes){let r=t.getAttribute(e),i=n.getAttribute(e);vy(r,i,s);let a=r.itemSize;
vendor: 15,313 bytes, line 425
425for(let e=r.count,t=c;e<t;e++){let t=s+e;for(let e=0;e<a;e++)i.setComponent(t,e,0)}i.needsUpdate=!0,i.addUpdateRange(s*a,c*a)}if(r){let e=o.indexStart,n=o.reservedIndexCount;o.indexCount=t.getIndex().count;for(let t=0;t<a.count;t++)i.setX(e+t,s+a.getX(t));for(let t=a.count,r=n;t<r;t++)i.setX(e+t,s);i.needsUpdate=!0,i.addUpdateRange(e,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,t.boundingBox!==null&&(o.boundingBox=t.boundingBox.clone()),o.boundingSphere=null,t.boundingSphere!==null&&(o.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){let t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;let n=this._instanceInfo;for(let t=0,r=n.length;t<r;t++)n[t].active&&n[t].geometryIndex===e&&this.deleteInstance(t);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0,n=this._geometryInfo,r=n.map((e,t)=>t).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),i=this.geometry;for(let a=0,o=n.length;a<o;a++){let o=n[r[a]];if(o.active!==!1){if(i.index!==null){if(o.indexStart!==t){let{indexStart:n,vertexStart:r,reservedIndexCount:a}=o,s=i.index,c=s.array,l=e-r;for(let e=n;e<n+a;e++)c[e]=c[e]+l;s.array.copyWithin(t,n,n+a),s.addUpdateRange(t,a),s.needsUpdate=!0,o.indexStart=t}t+=o.reservedIndexCount}if(o.vertexStart!==e){let{vertexStart:t,reservedVertexCount:n}=o,r=i.attributes;for(let i in r){let a=r[i],{array:o,itemSize:s}=a;o.copyWithin(e*s,t*s,(t+n)*s),a.addUpdateRange(e*s,n*s),a.needsUpdate=!0}o.vertexStart=e}e+=o.reservedVertexCount,o.start=i.index?o.indexStart:o.vertexStart,this._nextIndexStart=i.index?o.indexStart+o.reservedIndexCount:0,this._nextVertexStart=o.vertexStart+o.reservedVertexCount}}return this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){let e=new bh,t=n.index,i=n.attributes.position;for(let n=r.start,a=r.start+r.count;n<a;n++){let r=n;t&&(r=t.getX(r)),e.expandByPoint(fy.fromBufferAttribute(i,r))}r.boundingBox=e}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){let t=new Rh;this.getBoundingBoxAt(e,uy),uy.getCenter(t.center);let i=n.index,a=n.attributes.position,o=0;for(let e=r.start,n=r.start+r.count;e<n;e++){let n=e;i&&(n=i.getX(n)),fy.fromBufferAttribute(a,n),o=Math.max(o,t.center.distanceToSquared(fy))}t.radius=Math.sqrt(o),r.boundingSphere=t}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);let n=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);let n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){let t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(ny);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);let r=new Int32Array(e),i=new Int32Array(e);yy(this._multiDrawCounts,r),yy(this._multiDrawStarts,i),this._multiDrawCounts=r,this._multiDrawStarts=i,this._maxInstanceCount=e;let a=this._indirectTexture,o=this._matricesTexture,s=this._colorsTexture;a.dispose(),this._initIndirectTexture(),yy(a.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),yy(o.image.data,this._matricesTexture.image.data),s&&(s.dispose(),this._initColorsTexture(),yy(s.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){let n=[...this._geometryInfo].filter(e=>e.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);let r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new p_,this._initializeGeometry(r));let i=this.geometry;for(let e in r.index&&yy(r.index.array,i.index.array),r.attributes)yy(r.attributes[e].array,i.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;gy.material=this.material,gy.geometry.index=a.index,gy.geometry.attributes=a.attributes,gy.geometry.boundingBox===null&&(gy.geometry.boundingBox=new bh),gy.geometry.boundingSphere===null&&(gy.geometry.boundingSphere=new Rh);for(let a=0,o=n.length;a<o;a++){if(!n[a].visible||!n[a].active)continue;let o=n[a].geometryIndex,s=r[o];gy.geometry.setDrawRange(s.start,s.count),this.getMatrixAt(a,gy.matrixWorld).premultiply(i),this.getBoundingBoxAt(o,gy.geometry.boundingBox),this.getBoundingSphereAt(o,gy.geometry.boundingSphere),gy.raycast(e,_y);for(let e=0,n=_y.length;e<n;e++){let n=_y[e];n.object=this,n.batchId=a,t.push(n)}_y.length=0}gy.material=null,gy.geometry.index=null,gy.geometry.attributes={},gy.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox===null?null:e.boundingBox.clone(),this.boundingSphere=e.boundingSphere===null?null:e.boundingSphere.clone(),this._geometryInfo=e._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox===null?null:e.boundingBox.clone(),boundingSphere:e.boundingSphere===null?null:e.boundingSphere.clone()})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=r.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,s=this._instanceInfo,c=this._multiDrawStarts,l=this._multiDrawCounts,u=this._geometryInfo,d=this.perObjectFrustumCulled,f=this._indirectTexture,p=f.image.data,m=n.isArrayCamera?ly:cy;d&&!n.isArrayCamera&&(oy.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),cy.setFromProjectionMatrix(oy,n.coordinateSystem,n.reversedDepth));let h=0;if(this.sortObjects){oy.copy(this.matrixWorld).invert(),fy.setFromMatrixPosition(n.matrixWorld).applyMatrix4(oy),py.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(oy);for(let e=0,t=s.length;e<t;e++)if(s[e].visible&&s[e].active){let t=s[e].geometryIndex;this.getMatrixAt(e,oy),this.getBoundingSphereAt(t,dy).applyMatrix4(oy);let r=!1;if(d&&(r=!m.intersectsSphere(dy,n)),!r){let n=u[t],r=my.subVectors(dy.center,fy).dot(py);hy.push(n.start,n.count,r,e)}}let e=hy.list,t=this.customSort;t===null?e.sort(i.transparent?iy:ry):t.call(this,e,n);for(let t=0,n=e.length;t<n;t++){let n=e[t];c[h]=n.start*o,l[h]=n.count,p[h]=n.index,h++}hy.reset()}else for(let e=0,t=s.length;e<t;e++)if(s[e].visible&&s[e].active){let t=s[e].geometryIndex,r=!1;if(d&&(this.getMatrixAt(e,oy),this.getBoundingSphereAt(t,dy).applyMatrix4(oy),r=!m.intersectsSphere(dy,n)),!r){let n=u[t];c[h]=n.start*o,l[h]=n.count,p[h]=e,h++}}f.needsUpdate=!0,this._multiDrawCount=h,this._visibilityChanged=!1}onBeforeShadow(e,t,n,r,i,a){this.onBeforeRender(e,null,r,i,a)}},xy=class extends Vg{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new Z(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},Sy=new X,Cy=new X,wy=new qh,Ty=new Kh,Ey=new Rh,Dy=new X,Oy=new X,ky=class extends bg{constructor(e=new p_,t=new xy){super(),this.isLine=!0,this.type=`Line`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)Sy.fromBufferAttribute(t,e-1),Cy.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Sy.distanceTo(Cy);e.setAttribute(`lineDistance`,new Q(n,1))}else J(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ey.copy(n.boundingSphere),Ey.applyMatrix4(r),Ey.radius+=i,e.ray.intersectsSphere(Ey)===!1)return;wy.copy(r).invert(),Ty.copy(e.ray).applyMatrix4(wy);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=Ay(this,e,Ty,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=Ay(this,e,Ty,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=Ay(this,e,Ty,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=Ay(this,e,Ty,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function Ay(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(Sy.fromBufferAttribute(s,i),Cy.fromBufferAttribute(s,a),n.distanceSqToSegment(Sy,Cy,Dy,Oy)>r)return;Dy.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(Dy);if(!(c<t.near||c>t.far))return{distance:c,point:Oy.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var jy=new X,My=new X,Ny=class extends ky{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)jy.fromBufferAttribute(t,e),My.fromBufferAttribute(t,e+1),n[e]=e===0?0:n[e-1],n[e+1]=n[e]+jy.distanceTo(My);e.setAttribute(`lineDistance`,new Q(n,1))}else J(`LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}},Py=class extends ky{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type=`LineLoop`}},Fy=class extends Vg{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new Z(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},Iy=new qh,Ly=new Kh,Ry=new Rh,zy=new X,By=class extends bg{constructor(e=new p_,t=new Fy){super(),this.isPoints=!0,this.type=`Points`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ry.copy(n.boundingSphere),Ry.applyMatrix4(r),Ry.radius+=i,e.ray.intersectsSphere(Ry)===!1)return;Iy.copy(r).invert(),Ly.copy(e.ray).applyMatrix4(Iy);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);zy.fromBufferAttribute(l,n),Vy(zy,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)zy.fromBufferAttribute(l,a),Vy(zy,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function Vy(e,t,n,r,i,a,o){let s=Ly.distanceSqToPoint(e);if(s<n){let n=new X;Ly.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var Hy=class extends fh{constructor(e,t,n,r,i=cf,a=cf,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let l=this;
425function u(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u)}`requestVideoFrameCallback`in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!(`requestVideoFrameCallback`in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}},Uy=class extends Hy{constructor(e,t,n,r,i,a,o,s){super({},e,t,n,r,i,a,o,s),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}},Wy=class extends fh{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=nf,this.minFilter=nf,this.generateMipmaps=!1,this.needsUpdate=!0}},Gy=class extends fh{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},Ky=class extends Gy{constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=ef,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},qy=class extends Gy{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},Jy=class extends fh{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},Yy=class extends fh{constructor(e,t,n=vf,r,i,a,o=nf,s=nf,c,l=kf,u=1){if(l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new ch(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Xy=class extends Yy{constructor(e,t=vf,n=301,r,i,a=nf,o=nf,s,c=kf){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},Zy=class extends fh{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},Qy=class e extends p_{constructor(e=1,t=1,n=4,r=8,i=1){super(),this.type=`CapsuleGeometry`,this.parameters={radius:e,height:t,capSegments:n,radialSegments:r,heightSegments:i}
vendor: 10,419 bytes, line 425
425,t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),i=Math.max(1,Math.floor(i));let a=[],o=[],s=[],c=[],l=t/2,u=Math.PI/2*e,d=t,f=2*u+d,p=n*2+i,m=r+1,h=new X,g=new X;for(let _=0;_<=p;_++){let v=0,y=0,b=0,x=0;if(_<=n){let t=_/n,r=t*Math.PI/2;y=-l-e*Math.cos(r),b=e*Math.sin(r),x=-e*Math.cos(r),v=t*u}else if(_<=n+i){let r=(_-n)/i;y=-l+r*t,b=e,x=0,v=u+r*d}else{let t=(_-n-i)/n,r=t*Math.PI/2;y=l+e*Math.sin(r),b=e*Math.cos(r),x=e*Math.sin(r),v=u+d+t*u}let S=Math.max(0,Math.min(1,v/f)),C=0;_===0?C=.5/r:_===p&&(C=-.5/r);for(let e=0;e<=r;e++){let t=e/r,n=t*Math.PI*2,i=Math.sin(n),a=Math.cos(n);g.x=-b*a,g.y=y,g.z=b*i,o.push(g.x,g.y,g.z),h.set(-b*a,x,b*i),h.normalize(),s.push(h.x,h.y,h.z),c.push(t+C,S)}if(_>0){let e=(_-1)*m;for(let t=0;t<r;t++){let n=e+t,r=e+t+1,i=_*m+t,o=_*m+t+1;a.push(n,r,i),a.push(r,o,i)}}}this.setIndex(a),this.setAttribute(`position`,new Q(o,3)),this.setAttribute(`normal`,new Q(s,3)),this.setAttribute(`uv`,new Q(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.height,t.capSegments,t.radialSegments,t.heightSegments)}},$y=class e extends p_{constructor(e=1,t=32,n=0,r=Math.PI*2){super(),this.type=`CircleGeometry`,this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);let i=[],a=[],o=[],s=[],c=new X,l=new Y;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let i=0,u=3;i<=t;i++,u+=3){let d=n+i/t*r;c.x=e*Math.cos(d),c.y=e*Math.sin(d),a.push(c.x,c.y,c.z),o.push(0,0,1),l.x=(a[u]/e+1)/2,l.y=(a[u+1]/e+1)/2,s.push(l.x,l.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute(`position`,new Q(a,3)),this.setAttribute(`normal`,new Q(o,3)),this.setAttribute(`uv`,new Q(s,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.segments,t.thetaStart,t.thetaLength)}},eb=class e extends p_{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=Math.PI*2){super(),this.type=`CylinderGeometry`,this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};let c=this;r=Math.floor(r),i=Math.floor(i);let l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new Q(u,3)),this.setAttribute(`normal`,new Q(d,3)),this.setAttribute(`uv`,new Q(f,2));function _(){let a=new X,_=new X,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){let a=m[r][n],o=m[r+1][n],s=m[r+1][n+1],c=m[r][n+1];(e>0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new Y,m=new X,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e<r;e++){let t=i+e,r=b+e;n===!0?l.push(r,r+1,t):l.push(r+1,r,t),_+=3}c.addGroup(g,_,n===!0?1:2),g+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},tb=class e extends eb{constructor(e=1,t=1,n=32,r=1,i=!1,a=0,o=Math.PI*2){super(0,e,t,n,r,i,a,o),this.type=`ConeGeometry`,this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}static fromJSON(t){return new e(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},nb=class e extends p_{constructor(e=[],t=[],n=1,r=0){super(),this.type=`PolyhedronGeometry`,this.parameters={vertices:e,indices:t,radius:n,detail:r};let i=[],a=[];o(r),c(n),l(),this.setAttribute(`position`,new Q(i,3)),this.setAttribute(`normal`,new Q(i.slice(),3)),this.setAttribute(`uv`,new Q(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(e){let n=new X,r=new X,i=new X;for(let a=0;a<t.length;a+=3)f(t[a+0],n),f(t[a+1],r),f(t[a+2],i),s(n,r,i,e)}function s(e,t,n,r){let i=r+1,a=[];for(let r=0;r<=i;r++){a[r]=[];let o=e.clone().lerp(n,r/i),s=t.clone().lerp(n,r/i),c=i-r;for(let e=0;e<=c;e++)e===0&&r===i?a[r][e]=o:a[r][e]=o.clone().lerp(s,e/c)}for(let e=0;e<i;e++)for(let t=0;t<2*(i-e)-1;t++){let n=Math.floor(t/2);t%2==0?(d(a[e][n+1]),d(a[e+1][n]),d(a[e][n])):(d(a[e][n+1]),d(a[e+1][n+1]),d(a[e+1][n]))}}function c(e){let t=new X;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}function l(){let e=new X;for(let t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];let n=h(e)/2/Math.PI+.5,r=g(e)/Math.PI+.5;a.push(n,1-r)}p(),u()}function u(){for(let e=0;e<a.length;e+=6){let t=a[e+0],n=a[e+2],r=a[e+4];Math.max(t,n,r)>.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new X,t=new X,n=new X,r=new X,o=new Y,s=new Y,c=new Y;for(let l=0,u=0;l<i.length;l+=9,u+=6){e.set(i[l+0],i[l+1],i[l+2]),t.set(i[l+3],i[l+4],i[l+5]),n.set(i[l+6],i[l+7],i[l+8]),o.set(a[u+0],a[u+1]),s.set(a[u+2],a[u+3]),c.set(a[u+4],a[u+5]),r.copy(e).add(t).add(n).divideScalar(3);let d=h(r);m(o,u+0,e,d),m(s,u+2,t,d),m(c,u+4,n,d)}}function m(e,t,n,r){r<0&&e.x===1&&(a[t]=e.x-1),n.x===0&&n.z===0&&(a[t]=r/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function g(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.vertices,t.indices,t.radius,t.detail)}},rb=class e extends nb{constructor(e=1,t=0){let n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];super(i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type=`DodecahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},ib=new X,ab=new X,ob=new X,sb=new Pg,cb=class extends p_{constructor(e=null,t=1){if(super(),this.type=`EdgesGeometry`,this.parameters={geometry:e,thresholdAngle:t},e!==null){let n=10**4,r=Math.cos(Cm*t),i=e.getIndex(),a=e.getAttribute(`position`),o=i?i.count:a.count,s=[0,0,0],c=[`a`,`b`,`c`],l=[,,,],u={},d=[];for(let e=0;e<o;e+=3){i?(s[0]=i.getX(e),s[1]=i.getX(e+1),s[2]=i.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);let{a:t,b:o,c:f}=sb;if(t.fromBufferAttribute(a,s[0]),o.fromBufferAttribute(a,s[1]),f.fromBufferAttribute(a,s[2]),sb.getNormal(ob),l[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,l[1]=`${Math.round(o.x*n)},${Math.round(o.y*n)},${Math.round(o.z*n)}`,l[2]=`${Math.round(f.x*n)},${Math.round(f.y*n)},${Math.round(f.z*n)}`,!(l[0]===l[1]||l[1]===l[2]||l[2]===l[0]))for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],i=l[t],a=sb[c[e]],o=sb[c[t]],f=`${n}_${i}`,p=`${i}_${n}`;p in u&&u[p]?(ob.dot(u[p].normal)<=r&&(d.push(a.x,a.y,a.z),d.push(o.x,o.y,o.z)),u[p]=null):f in u||(u[f]={index0:s[e],index1:s[t],normal:ob.clone()})}}for(let e in u)if(u[e]){let{index0:t,index1:n}=u[e];ib.fromBufferAttribute(a,t),ab.fromBufferAttribute(a,n),d.push(ib.x,ib.y,ib.z),d.push(ab.x,ab.y,ab.z)}this.setAttribute(`position`,new Q(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}},lb=class{constructor(){this.type=`Curve`,this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){J(`Curve: .getPoint() not implemented.`)}getPointAt(e,t){let n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){let n=this.getLengths(),r=0,i=n.length,a;a=t||e*n[i-1];let o=0,s=i-1,c;for(;o<=s;)if(r=Math.floor(o+(s-o)/2),c=n[r]-a,c<0)o=r+1;else if(c>0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1]-l,d=(a-l)/u;return(r+d)/(i-1)}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new Y:new X);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new X,r=[],i=[],a=[],o=new X,s=new qh;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new X)}i[0]=new X,a[0]=new X;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(Em(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(Em(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.t
vendor: 5,916 bytes, line 425
425ype,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},ub=class extends lb{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new Y){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},db=class extends ub{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function fb(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}var pb=new X,mb=new fb,hb=new fb,gb=new fb,_b=class extends lb{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new X){let n=t,r=this.points,i=r.length,a=(i-(this.closed?0:1))*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(pb.subVectors(r[0],r[1]).add(r[0]),c=pb);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2<i?l=r[(o+2)%i]:(pb.subVectors(r[i-1],r[i-2]).add(r[i-1]),l=pb),this.curveType===`centripetal`||this.curveType===`chordal`){let e=this.curveType===`chordal`?.5:.25,t=c.distanceToSquared(u)**+e,n=u.distanceToSquared(d)**+e,r=d.distanceToSquared(l)**+e;n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),mb.initNonuniformCatmullRom(c.x,u.x,d.x,l.x,t,n,r),hb.initNonuniformCatmullRom(c.y,u.y,d.y,l.y,t,n,r),gb.initNonuniformCatmullRom(c.z,u.z,d.z,l.z,t,n,r)}else this.curveType===`catmullrom`&&(mb.initCatmullRom(c.x,u.x,d.x,l.x,this.tension),hb.initCatmullRom(c.y,u.y,d.y,l.y,this.tension),gb.initCatmullRom(c.z,u.z,d.z,l.z,this.tension));return n.set(mb.calc(s),hb.calc(s),gb.calc(s)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new X().fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};function vb(e,t,n,r,i){let a=(r-t)*.5,o=(i-n)*.5,s=e*e,c=e*s;return(2*n-2*r+a+o)*c+(-3*n+3*r-2*a-o)*s+a*e+n}function yb(e,t){let n=1-e;return n*n*t}function bb(e,t){return 2*(1-e)*e*t}function xb(e,t){return e*e*t}function Sb(e,t,n,r){return yb(e,t)+bb(e,n)+xb(e,r)}function Cb(e,t){let n=1-e;return n*n*n*t}function wb(e,t){let n=1-e;return 3*n*n*e*t}function Tb(e,t){return 3*(1-e)*e*e*t}function Eb(e,t){return e*e*e*t}function Db(e,t,n,r,i){return Cb(e,t)+wb(e,n)+Tb(e,r)+Eb(e,i)}var Ob=class extends lb{constructor(e=new Y,t=new Y,n=new Y,r=new Y){super(),this.isCubicBezierCurve=!0,this.type=`CubicBezierCurve`,this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Y){let n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Db(e,r.x,i.x,a.x,o.x),Db(e,r.y,i.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},kb=class extends lb{constructor(e=new X,t=new X,n=new X,r=new X){super(),this.isCubicBezierCurve3=!0,this.type=`CubicBezierCurve3`,this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new X){let n=t,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Db(e,r.x,i.x,a.x,o.x),Db(e,r.y,i.y,a.y,o.y),Db(e,r.z,i.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},Ab=class extends lb{constructor(e=new Y,t=new Y){super(),this.isLineCurve=!0,this.type=`LineCurve`,this.v1=e,this.v2=t}getPoint(e,t=new Y){let n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 4,354 bytes, line 425
425getTangent(e,t=new Y){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},jb=class extends lb{constructor(e=new X,t=new X){super(),this.isLineCurve3=!0,this.type=`LineCurve3`,this.v1=e,this.v2=t}getPoint(e,t=new X){let n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new X){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Mb=class extends lb{constructor(e=new Y,t=new Y,n=new Y){super(),this.isQuadraticBezierCurve=!0,this.type=`QuadraticBezierCurve`,this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Y){let n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(Sb(e,r.x,i.x,a.x),Sb(e,r.y,i.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Nb=class extends lb{constructor(e=new X,t=new X,n=new X){super(),this.isQuadraticBezierCurve3=!0,this.type=`QuadraticBezierCurve3`,this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new X){let n=t,r=this.v0,i=this.v1,a=this.v2;return n.set(Sb(e,r.x,i.x,a.x),Sb(e,r.y,i.y,a.y),Sb(e,r.z,i.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Pb=class extends lb{constructor(e=[]){super(),this.isSplineCurve=!0,this.type=`SplineCurve`,this.points=e}getPoint(e,t=new Y){let n=t,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[a===0?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(vb(o,s.x,c.x,l.x,u.x),vb(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new Y().fromArray(n))}return this}},Fb=Object.freeze({__proto__:null,ArcCurve:db,CatmullRomCurve3:_b,CubicBezierCurve:Ob,CubicBezierCurve3:kb,EllipseCurve:ub,LineCurve:Ab,LineCurve3:jb,QuadraticBezierCurve:Mb,QuadraticBezierCurve3:Nb,SplineCurve:Pb}),Ib=class extends lb{constructor(){super(),this.type=`CurvePath`,this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let n=e.isVector2===!0?`LineCurve`:`LineCurve3`;this.curves.push(new Fb[n](t,e))}return this}getPoint(e,t){let n=e*this.getLength(),r=this.getCurveLengths(),i=0;for(;i<r.length;){if(r[i]>=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t=[],n;for(let r=0,i=this.curves;r<i.length;r++){let a=i[r],o=a.isEllipseCurve?e*2:a.isLineCurve||a.isLineCurve3?1:a.isS
vendor: 7,892 bytes, line 425
425plineCurve?e*a.points.length:e,s=a.getPoints(o);for(let e=0;e<s.length;e++){let r=s[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){let n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let n=e.curves[t];this.curves.push(new Fb[n.type]().fromJSON(n))}return this}},Lb=class extends Ib{constructor(e){super(),this.type=`Path`,this.currentPoint=new Y,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let n=new Ab(this.currentPoint.clone(),new Y(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){let i=new Mb(this.currentPoint.clone(),new Y(e,t),new Y(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,a){let o=new Ob(this.currentPoint.clone(),new Y(e,t),new Y(n,r),new Y(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(e){let t=new Pb([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,a){let o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this}absarc(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this}ellipse(e,t,n,r,i,a,o,s){let c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,r,i,a,o,s),this}absellipse(e,t,n,r,i,a,o,s){let c=new ub(e,t,n,r,i,a,o,s);if(this.curves.length>0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Rb=class extends Lb{constructor(e){super(e),this.uuid=Tm(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){let n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let n=e.holes[t];this.holes.push(new Lb().fromJSON(n))}return this}};function zb(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length,a=Bb(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;let s,c,l;if(r&&(a=qb(e,t,a,n)),e.length>80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;a<i;a+=n){let n=e[a],i=e[a+1];n<s&&(s=n),i<c&&(c=i),n>t&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return Hb(a,o,n,s,c,l,0),o}function Bb(e,t,n,r,i){let a;if(i===_x(e,t,n,r)>0)for(let i=t;i<n;i+=r)a=mx(i/r|0,e[i],e[i+1],a);else for(let i=n-r;i>=t;i-=r)a=mx(i/r|0,e[i],e[i+1],a);return a&&ox(a,a.next)&&(hx(a),a=a.next),a}function Vb(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&(ox(n,n.next)||ax(n.prev,n,n.next)===0)){if(hx(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function Hb(e,t,n,r,i,a,o){if(!e)return;!o&&a&&Qb(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?Wb(e,r,i,a):Ub(e)){t.push(c.i,e.i,l.i),hx(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=Gb(Vb(e),t),Hb(e,t,n,r,i,a,2)):o===2&&Kb(e,t,n,r,i,a):Hb(Vb(e),t,n,r,i,a,1);break}}}function Ub(e){let t=e.prev,n=e,r=e.next;if(ax(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&rx(i,s,a,c,o,l,m.x,m.y)&&ax(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Wb(e,t,n,r){let i=e.prev,a=e,o=e.next;if(ax(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=ex(p,m,t,n,r),v=ex(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&rx(s,u,c,d,l,f,y.x,y.y)&&ax(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&rx(s,u,c,d,l,f,b.x,b.y)&&ax(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&rx(s,u,c,d,l,f,y.x,y.y)&&ax(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&rx(s,u,c,d,l,f,b.x,b.y)&&ax(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Gb(e,t){let n=e;do{let r=n.prev,i=n.next.next;!ox(r,i)&&sx(r,n,n.next,i)&&dx(r,i)&&dx(i,r)&&(t.push(r.i,n.i,i.i),hx(n),hx(n.next),n=e=i),n=n.next}while(n!==e);return Vb(n)}function Kb(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&ix(o,e)){let s=px(o,e);o=Vb(o,o.next),s=Vb(s,s.next),Hb(o,t,n,r,i,a,0),Hb(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function qb(e,t,n,r){let i=[];for(let n=0,a=t.length;n<a;n++){let o=Bb(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1);o===o.next&&(o.steiner=!0),i.push(tx(o))}i.sort(Jb);for(let e=0;e<i.length;e++)n=Yb(i[e],n);return n}function Jb(e,t){let n=e.x-t.x;return n===0&&(n=e.y-t.y,n===0&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x))),n}function Yb(e,t){let n=Xb(e,t);if(!n)return t;let r=px(n,e);return Vb(r,r.next),Vb(n,n.next)}function Xb(e,t){let n=t,r=e.x,i=e.y,a=-1/0,o;if(ox(e,n))return n;do{if(ox(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x<n.next.x?n:n.next,e===r))return o}n=n.next}while(n!==t);if(!o)return null;let s=o,c=o.x,l=o.y,u=1/0;n=o;do{if(r>=n.x&&n.x>=c&&r!==n.x&&nx(i<l?r:a,i,c,l,i<l?a:r,i,n.x,n.y)){let t=Math.abs(i-n.y)/(r-n.x);dx(n,e)&&(t<u||t===u&&(n.x>o.x||n.x===o.x&&Zb(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function Zb(e,t){return ax(e.prev,e,t.prev)<0&&ax(t.next,e,e.next)<0}function Qb(e,t,n,r){let i=e;do i.z===0&&(i.z=ex(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,$b(i)}function $b(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e<n&&(s++,o=o.nextZ,o);e++);let c=n;for(;s>0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function ex(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function tx(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function nx(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function rx(e,t,n,r,i,a,o,s){return!(e===o&&t===s)&&nx(e,t,n,r,i,a,o,s)}function ix(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!ux(e,t)&&(dx(e,t)&&dx(t,e)&&fx(e,t)&&(ax(e.prev,e,t.prev)||ax(e,t.prev,t))||ox(e,t)&&ax(e.prev,e,e.next)>0&&ax(t.prev,t,t.next)>0)}function ax(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ox(e,t){return e.x===t.x&&e.y===t.y}function sx(e,t,n,r){let i=lx(ax(e,t,n)),a=lx(ax(e,t,r)),o=lx(ax(n,r,e)),s=lx(ax(n,r,t));
425return!!(i!==a&&o!==s||i===0&&cx(e,n,t)||a===0&&cx(e,r,t)||o===0&&cx(n,e,r)||s===0&&cx(n,t,r))}function cx(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function lx(e){return e>0?1:e<0?-1:0}function ux(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&sx(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function dx(e,t){return ax(e.prev,e,e.next)<0?ax(e,t,e.next)>=0&&ax(e,e.prev,t)>=0:ax(e,t,e.prev)<0||ax(e,e.next,t)<0}function fx(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function px(e,t){let n=gx(e.i,e.x,e.y),r=gx(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function mx(e,t,n,r){let i=gx(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function hx(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function gx(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function _x(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}var vx=class{static triangulate(e,t,n=2){return zb(e,t,n)}},yx=class e{static area(e){let t=e.length,n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return n*.5}static isClockWise(t){return e.area(t)<0}static triangulateShape(e,t){let n=[],r=[],i=[];bx(e),xx(n,e);let a=e.length;t.forEach(bx);for(let e=0;e<t.length;e++)r.push(a),a+=t[e].length,xx(n,t[e]);let o=vx.triangulate(n,r);for(let e=0;e<o.length;e+=3)i.push(o.slice(e,e+3));return i}};function bx(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function xx(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}var Sx=class e extends p_{constructor(e=new Rb([new Y(.5,.5),new Y(-.5,.5),new Y(-.5,-.5),new Y(.5,-.5)]),t={}){super(),this.type=`ExtrudeGeometry`,this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++){let n=e[t];a(n)}this.setAttribute(`position`,new Q(r,3)),this.setAttribute(`uv`,new Q(i,2)),this.computeVertexNormals();function a(e){let a=[],o=t.curveSegments===void 0?12:t.curveSegments,s=t.steps===void 0?1:t.steps,c=t.depth===void 0?1:t.depth,l=t.bevelEnabled===void 0?!0:t.bevelEnabled,u=t.bevelThickness===void 0?.2:t.bevelThickness,d=t.bevelSize===void 0?u-.1:t.bevelSize,f=t.bevelOffset===void 0?0:t.bevelOffset,p=t.bevelSegments===void 0?3:t.bevelSegments,m=t.extrudePath,h=t.UVGenerator===void 0?Cx:t.UVGenerator,g,_=!1,v,y,b,x;if(m){g=m.getSpacedPoints(s),_=!0,l=!1;let e=m.isCatmullRomCurve3?m.closed:!1;v=m.computeFrenetFrames(s,e),y=new X,b=new X,x=new X}l||(p=0,u=0,d=0,f=0);let S=e.extractPoints(o),C=S.shape,w=S.holes;if(!yx.isClockWise(C)){C=C.reverse();for(let e=0,t=w.length;e<t;e++){let t=w[e];yx.isClockWise(t)&&(w[e]=t.reverse())}}function T(e){let t=1e-10;t*t;let n=e[0];for(let t=1;t<=e.length;t++){let r=t%e.length,i=e[r],a=i.x-n.x,o=i.y-n.y,s=a*a+o*o,c=Math.max(Math.abs(i.x),Math.abs(i.y),Math.abs(n.x),Math.abs(n.y));if(s<=10000000000000001e-36*c*c){e.splice(r,1),t--;continue}n=i}}T(C),w.forEach(T);let E=w.length,D=C;for(let e=0;e<E;e++){let t=w[e];C=C.concat(t)}function O(e,t,n){return t||_m(`ExtrudeGeometry: vec does not exist`),e.clone().addScaledVector(t,n)}let k=C.length;function A(e,t,n){let r,i,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=o*o+s*s,d=o*l-s*c;if(Math.abs(d)>2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new Y(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new Y(r/a,i/a)}let j=[];for(let e=0,t=D.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),j[e]=A(D[e],D[n],D[r]);let ee=[],M,te=j.concat();for(let e=0,t=E;e<t;e++){let t=w[e];M=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),M[e]=A(t[e],t[r],t[i]);ee.push(M),te=te.concat(M)}let N;
vendor: 38,037 bytes, line 425
425if(p===0)N=yx.triangulateShape(D,w);else{let e=[],t=[];for(let n=0;n<p;n++){let r=n/p,i=u*Math.cos(r*Math.PI/2),a=d*Math.sin(r*Math.PI/2)+f;for(let t=0,n=D.length;t<n;t++){let n=O(D[t],j[t],a);L(n.x,n.y,-i),r===0&&e.push(n)}for(let e=0,n=E;e<n;e++){let n=w[e];M=ee[e];let o=[];for(let e=0,t=n.length;e<t;e++){let t=O(n[e],M[e],a);L(t.x,t.y,-i),r===0&&o.push(t)}r===0&&t.push(o)}}N=yx.triangulateShape(e,t)}let P=N.length,F=d+f;for(let e=0;e<k;e++){let t=l?O(C[e],te[e],F):C[e];_?(b.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),x.copy(g[0]).add(b).add(y),L(x.x,x.y,x.z)):L(t.x,t.y,0)}for(let e=1;e<=s;e++)for(let t=0;t<k;t++){let n=l?O(C[t],te[t],F):C[t];_?(b.copy(v.normals[e]).multiplyScalar(n.x),y.copy(v.binormals[e]).multiplyScalar(n.y),x.copy(g[e]).add(b).add(y),L(x.x,x.y,x.z)):L(n.x,n.y,c/s*e)}for(let e=p-1;e>=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=D.length;e<t;e++){let t=O(D[e],j[e],r);L(t.x,t.y,c+n)}for(let e=0,t=w.length;e<t;e++){let t=w[e];M=ee[e];for(let e=0,i=t.length;e<i;e++){let i=O(t[e],M[e],r);_?L(i.x,i.y+g[s-1].y,g[s-1].x+n):L(i.x,i.y,c+n)}}}I(),ne();function I(){let e=r.length/3;if(l){let e=0,t=k*e;for(let e=0;e<P;e++){let n=N[e];ie(n[2]+t,n[1]+t,n[0]+t)}e=s+p*2,t=k*e;for(let e=0;e<P;e++){let n=N[e];ie(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<P;e++){let t=N[e];ie(t[2],t[1],t[0])}for(let e=0;e<P;e++){let t=N[e];ie(t[0]+k*s,t[1]+k*s,t[2]+k*s)}}n.addGroup(e,r.length/3-e,0)}function ne(){let e=r.length/3,t=0;re(D,t),t+=D.length;for(let e=0,n=w.length;e<n;e++){let n=w[e];re(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}function re(e,t){let n=e.length;for(;--n>=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e<n;e++){let n=k*e,a=k*(e+1);R(t+r+n,t+i+n,t+i+a,t+r+a)}}}function L(e,t,n){a.push(e),a.push(t),a.push(n)}function ie(e,t,i){ae(e),ae(t),ae(i);let a=r.length/3,o=h.generateTopUV(n,r,a-3,a-2,a-1);oe(o[0]),oe(o[1]),oe(o[2])}function R(e,t,i,a){ae(e),ae(t),ae(a),ae(t),ae(i),ae(a);let o=r.length/3,s=h.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);oe(s[0]),oe(s[1]),oe(s[3]),oe(s[1]),oe(s[2]),oe(s[3])}function ae(e){r.push(a[e*3+0]),r.push(a[e*3+1]),r.push(a[e*3+2])}function oe(e){i.push(e.x),i.push(e.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return wx(t,n,e)}static fromJSON(t,n){let r=[];for(let e=0,i=t.shapes.length;e<i;e++){let i=n[t.shapes[e]];r.push(i)}let i=t.options.extrudePath;return i!==void 0&&(t.options.extrudePath=new Fb[i.type]().fromJSON(i)),new e(r,t.options)}},Cx={generateTopUV:function(e,t,n,r,i){let a=t[n*3],o=t[n*3+1],s=t[r*3],c=t[r*3+1],l=t[i*3],u=t[i*3+1];return[new Y(a,o),new Y(s,c),new Y(l,u)]},generateSideWallUV:function(e,t,n,r,i,a){let o=t[n*3],s=t[n*3+1],c=t[n*3+2],l=t[r*3],u=t[r*3+1],d=t[r*3+2],f=t[i*3],p=t[i*3+1],m=t[i*3+2],h=t[a*3],g=t[a*3+1],_=t[a*3+2];return Math.abs(s-u)<Math.abs(o-l)?[new Y(o,1-c),new Y(l,1-d),new Y(f,1-m),new Y(h,1-_)]:[new Y(s,1-c),new Y(u,1-d),new Y(p,1-m),new Y(g,1-_)]}};function wx(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){let r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);return n.options=Object.assign({},t),t.extrudePath!==void 0&&(n.options.extrudePath=t.extrudePath.toJSON()),n}var Tx=class e extends nb{constructor(e=1,t=0){let n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];super(r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type=`IcosahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},Ex=class e extends p_{constructor(e=[new Y(0,-.5),new Y(.5,0),new Y(0,.5)],t=12,n=0,r=Math.PI*2){super(),this.type=`LatheGeometry`,this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Em(r,0,Math.PI*2);let i=[],a=[],o=[],s=[],c=[],l=1/t,u=new X,d=new Y,f=new X,p=new X,m=new X,h=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:h=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,f.x=g*1,f.y=-h,f.z=g*0,m.copy(f),f.normalize(),s.push(f.x,f.y,f.z);break;case e.length-1:s.push(m.x,m.y,m.z);break;default:h=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,f.x=g*1,f.y=-h,f.z=g*0,p.copy(f),f.x+=m.x,f.y+=m.y,f.z+=m.z,f.normalize(),s.push(f.x,f.y,f.z),m.copy(p)}for(let i=0;i<=t;i++){let f=n+i*l*r,p=Math.sin(f),m=Math.cos(f);for(let n=0;n<=e.length-1;n++){u.x=e[n].x*p,u.y=e[n].y,u.z=e[n].x*m,a.push(u.x,u.y,u.z),d.x=i/t,d.y=n/(e.length-1),o.push(d.x,d.y);let r=s[3*n+0]*p,l=s[3*n+1],f=s[3*n+0]*m;c.push(r,l,f)}}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){let r=t+n*e.length,a=r,o=r+e.length,s=r+e.length+1,c=r+1;i.push(a,o,c),i.push(s,c,o)}this.setIndex(i),this.setAttribute(`position`,new Q(a,3)),this.setAttribute(`uv`,new Q(o,2)),this.setAttribute(`normal`,new Q(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.points,t.segments,t.phiStart,t.phiLength)}},Dx=class e extends nb{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type=`OctahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},Ox=class e extends p_{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Q(p,3)),this.setAttribute(`normal`,new Q(m,3)),this.setAttribute(`uv`,new Q(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},kx=class e extends p_{constructor(e=.5,t=1,n=32,r=1,i=0,a=Math.PI*2){super(),this.type=`RingGeometry`,this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},n=Math.max(3,n),r=Math.max(1,r);let o=[],s=[],c=[],l=[],u=e,d=(t-e)/r,f=new X,p=new Y;for(let e=0;e<=r;e++){for(let e=0;e<=n;e++){let r=i+e/n*a;f.x=u*Math.cos(r),f.y=u*Math.sin(r),s.push(f.x,f.y,f.z),c.push(0,0,1),p.x=(f.x/t+1)/2,p.y=(f.y/t+1)/2,l.push(p.x,p.y)}u+=d}for(let e=0;e<r;e++){let t=e*(n+1);for(let e=0;e<n;e++){let r=e+t,i=r,a=r+n+1,s=r+n+2,c=r+1;o.push(i,a,c),o.push(a,s,c)}}this.setIndex(o),this.setAttribute(`position`,new Q(s,3)),this.setAttribute(`normal`,new Q(c,3)),this.setAttribute(`uv`,new Q(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}},Ax=class e extends p_{constructor(e=new Rb([new Y(0,.5),new Y(-.5,-.5),new Y(.5,-.5)]),t=12){super(),this.type=`ShapeGeometry`,this.parameters={shapes:e,curveSegments:t};let n=[],r=[],i=[],a=[],o=0,s=0;if(Array.isArray(e)===!1)c(e);else for(let t=0;t<e.length;t++)c(e[t]),this.addGroup(o,s,t),o+=s,s=0;this.setIndex(n),this.setAttribute(`position`,new Q(r,3)),this.setAttribute(`normal`,new Q(i,3)),this.setAttribute(`uv`,new Q(a,2));function c(e){let o=r.length/3,c=e.extractPoints(t),l=c.shape,u=c.holes;yx.isClockWise(l)===!1&&(l=l.reverse());for(let e=0,t=u.length;e<t;e++){let t=u[e];yx.isClockWise(t)===!0&&(u[e]=t.reverse())}let d=yx.triangulateShape(l,u);for(let e=0,t=u.length;e<t;e++){let t=u[e];l=l.concat(t)}for(let e=0,t=l.length;e<t;e++){let t=l[e];r.push(t.x,t.y,0),i.push(0,0,1),a.push(t.x,t.y)}for(let e=0,t=d.length;e<t;e++){let t=d[e],r=t[0]+o,i=t[1]+o,a=t[2]+o;n.push(r,i,a),s+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes;return jx(t,e)}static fromJSON(t,n){let r=[];for(let e=0,i=t.shapes.length;e<i;e++){let i=n[t.shapes[e]];r.push(i)}return new e(r,t.curveSegments)}};function jx(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){let r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}var Mx=class e extends p_{constructor(e=1,t=32,n=16,r=0,i=Math.PI*2,a=0,o=Math.PI){super(),this.type=`SphereGeometry`,this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));let s=Math.min(a+o,Math.PI),c=0,l=[],u=new X,d=new X,f=[],p=[],m=[],h=[];for(let f=0;f<=n;f++){let g=[],_=f/n,v=0;f===0&&a===0?v=.5/t:f===n&&s===Math.PI&&(v=-.5/t);for(let n=0;n<=t;n++){let s=n/t;u.x=-e*Math.cos(r+s*i)*Math.sin(a+_*o),u.y=e*Math.cos(a+_*o),u.z=e*Math.sin(r+s*i)*Math.sin(a+_*o),p.push(u.x,u.y,u.z),d.copy(u).normalize(),m.push(d.x,d.y,d.z),h.push(s+v,1-_),g.push(c++)}l.push(g)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){let t=l[e][r+1],i=l[e][r],o=l[e+1][r],c=l[e+1][r+1];(e!==0||a>0)&&f.push(t,i,c),(e!==n-1||s<Math.PI)&&f.push(i,o,c)}this.setIndex(f),this.setAttribute(`position`,new Q(p,3)),this.setAttribute(`normal`,new Q(m,3)),this.setAttribute(`uv`,new Q(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}},Nx=class e extends nb{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type=`TetrahedronGeometry`,this.parameters={radius:e,detail:t}}static fromJSON(t){return new e(t.radius,t.detail)}},Px=class e extends p_{constructor(e=1,t=.4,n=12,r=48,i=Math.PI*2){super(),this.type=`TorusGeometry`,this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);let a=[],o=[],s=[],c=[],l=new X,u=new X,d=new X;for(let a=0;a<=n;a++)for(let f=0;f<=r;f++){let p=f/r*i,m=a/n*Math.PI*2;u.x=(e+t*Math.cos(m))*Math.cos(p),u.y=(e+t*Math.cos(m))*Math.sin(p),u.z=t*Math.sin(m),o.push(u.x,u.y,u.z),l.x=e*Math.cos(p),l.y=e*Math.sin(p),d.subVectors(u,l).normalize(),s.push(d.x,d.y,d.z),c.push(f/r),c.push(a/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){let n=(r+1)*e+t-1,i=(r+1)*(e-1)+t-1,o=(r+1)*(e-1)+t,s=(r+1)*e+t;a.push(n,i,s),a.push(i,o,s)}this.setIndex(a),this.setAttribute(`position`,new Q(o,3)),this.setAttribute(`normal`,new Q(s,3)),this.setAttribute(`uv`,new Q(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}},Fx=class e extends p_{constructor(e=1,t=.4,n=64,r=8,i=2,a=3){super(),this.type=`TorusKnotGeometry`,this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},n=Math.floor(n),r=Math.floor(r);let o=[],s=[],c=[],l=[],u=new X,d=new X,f=new X,p=new X,m=new X,h=new X,g=new X;for(let o=0;o<=n;++o){let v=o/n*i*Math.PI*2;_(v,i,a,e,f),_(v+.01,i,a,e,p),h.subVectors(p,f),g.addVectors(p,f),m.crossVectors(h,g),g.crossVectors(m,h),m.normalize(),g.normalize();for(let e=0;e<=r;++e){let i=e/r*Math.PI*2,a=-t*Math.cos(i),p=t*Math.sin(i);u.x=f.x+(a*g.x+p*m.x),u.y=f.y+(a*g.y+p*m.y),u.z=f.z+(a*g.z+p*m.z),s.push(u.x,u.y,u.z),d.subVectors(u,f).normalize(),c.push(d.x,d.y,d.z),l.push(o/n),l.push(e/r)}}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){let n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),a=(r+1)*e+t,s=(r+1)*(e-1)+t;o.push(n,i,s),o.push(i,a,s)}this.setIndex(o),this.setAttribute(`position`,new Q(s,3)),this.setAttribute(`normal`,new Q(c,3)),this.setAttribute(`uv`,new Q(l,2));function _(e,t,n,r,i){let a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}},Ix=class e extends p_{constructor(e=new Nb(new X(-1,-1,0),new X(-1,1,0),new X(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type=`TubeGeometry`,this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};let a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;let o=new X,s=new X,c=new Y,l=new X,u=[],d=[],f=[],p=[];m(),this.setIndex(p),this.setAttribute(`position`,new Q(u,3)),this.setAttribute(`normal`,new Q(d,3)),this.setAttribute(`uv`,new Q(f,2));function m(){for(let e=0;e<t;e++)h(e);h(i===!1?t:0),_(),g()}function h(i){l=e.getPointAt(i/t,l);let c=a.normals[i],f=a.binormals[i];for(let e=0;e<=r;e++){let t=e/r*Math.PI*2,i=Math.sin(t),a=-Math.cos(t);s.x=a*c.x+i*f.x,s.y=a*c.y+i*f.y,s.z=a*c.z+i*f.z,s.normalize(),d.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,u.push(o.x,o.y,o.z)}}function g(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){let n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),a=(r+1)*e+t,o=(r+1)*(e-1)+t;p.push(n,i,o),p.push(i,a,o)}}function _(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)c.x=e/t,c.y=n/r,f.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(t){return new e(new Fb[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}},Lx=class extends p_{constructor(e=null){if(super(),this.type=`WireframeGeometry`,this.parameters={geometry:e},e!==null){let t=[],n=new Set,r=new X,i=new X;if(e.index!==null){let a=e.attributes.position,o=e.index,s=e.groups;s.length===0&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,c=s.length;e<c;++e){let c=s[e],l=c.start,u=c.count;for(let e=l,s=l+u;e<s;e+=3)for(let s=0;s<3;s++){let c=o.getX(e+s),l=o.getX(e+(s+1)%3);r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,l),Rx(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{let a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let o=0;o<3;o++){let s=3*e+o,c=3*e+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,c),Rx(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute(`position`,new Q(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}};function Rx(e,t,n){let r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}var zx=Object.freeze({__proto__:null,BoxGeometry:O_,CapsuleGeometry:Qy,CircleGeometry:$y,ConeGeometry:tb,CylinderGeometry:eb,DodecahedronGeometry:rb,EdgesGeometry:cb,ExtrudeGeometry:Sx,IcosahedronGeometry:Tx,LatheGeometry:Ex,OctahedronGeometry:Dx,PlaneGeometry:Ox,PolyhedronGeometry:nb,RingGeometry:kx,ShapeGeometry:Ax,SphereGeometry:Mx,TetrahedronGeometry:Nx,TorusGeometry:Px,TorusKnotGeometry:Fx,TubeGeometry:Ix,WireframeGeometry:Lx}),Bx=class extends Vg{constructor(e){super(),this.isShadowMaterial=!0,this.type=`ShadowMaterial`,this.color=new Z(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}},Vx=class extends I_{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawShaderMaterial`}},Hx=class extends Vg{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type=`MeshStandardMaterial`,this.defines={STANDARD:``},this.color=new Z(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rg,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:``},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},Ux=class extends Hx{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Y(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,`reflectivity`,{get:function(){return Em(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Z(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Z(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Z(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},Wx=class extends Vg{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type=`MeshPhongMaterial`,this.color=new Z(16777215),this.specular=new Z(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rg,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},Gx=class extends Vg{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:``},this.type=`MeshToonMaterial`,this.color=new Z(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Kx=class extends Vg{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type=`MeshNormalMaterial`,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}},qx=class extends Vg{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type=`MeshLambertMaterial`,this.color=new Z(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Z(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rg,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},Jx=class extends Vg{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=Ap,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},Yx=class extends Vg{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},Xx=class extends Vg{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:``},this.type=`MeshMatcapMaterial`,this.color=new Z(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:``},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}},Zx=class extends xy{constructor(e){super(),this.isLineDashedMaterial=!0,this.type=`LineDashedMaterial`,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};function Qx(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}function $x(e){function t(t,n){return e[t]-e[n]}let n=e.length,r=Array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(t),r}function eS(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function tS(e,t,n,r){let i=1,a=e[0];for(;a!==void 0&&a[r]===void 0;)a=e[i++];if(a===void 0)return;let o=a[r];if(o!==void 0)if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push(...o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}function nS(e,t,n,r,i=30){let a=e.clone();a.name=t;let o=[];for(let e=0;e<a.tracks.length;++e){let t=a.tracks[e],s=t.getValueSize(),c=[],l=[];for(let e=0;e<t.times.length;++e){let a=t.times[e]*i;if(!(a<n||a>=r)){c.push(t.times[e]);for(let n=0;n<s;++n)l.push(t.values[e*s+n])}}c.length!==0&&(t.times=Qx(c,t.times.constructor),t.values=Qx(l,t.values.constructor),o.push(t))}a.tracks=o;let s=1/0;for(let e=0;e<a.tracks.length;++e)s>a.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e<a.tracks.length;++e)a.tracks[e].shift(-1*s);return a.resetDuration(),a}function rS(e,t=0,n=e,r=30){r<=0&&(r=30);let i=n.tracks.length,a=t/r;for(let t=0;t<i;++t){let r=n.tracks[t],i=r.ValueTypeName;if(i===`bool`||i===`string`)continue;let o=e.tracks.find(function(e){return e.name===r.name&&e.ValueTypeName===i});if(o===void 0)continue;let s=0,c=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=c/3);let l=0,u=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=u/3);let d=r.times.length-1,f;if(a<=r.times[0]){let e=s,t=c-s;f=r.values.slice(e,t)}else if(a>=r.times[d]){let e=d*c+s,t=e+c-s;f=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=s,n=c-s;e.evaluate(a),f=e.resultBuffer.slice(t,n)}i===`quaternion`&&new Jm().fromArray(f).normalize().conjugate().toArray(f);let p=o.times.length;for(let e=0;e<p;++e){let t=e*u+l;if(i===`quaternion`)Jm.multiplyQuaternionsFlat(o.values,t,f,0,o.values,t);else{let e=u-l*2;for(let n=0;n<e;++n)o.values[t+n]-=f[n]}}}return e.blendMode=kp,e}var iS=class{static convertArray(e,t){return Qx(e,t)}static isTypedArray(e){return lm(e)}static getKeyframeOrder(e){return $x(e)}static sortedArray(e,t,n){return eS(e,t,n)}static flattenJSON(e,t,n,r){tS(e,t,n,r)}static subclip(e,t,n,r,i=30){return nS(e,t,n,r,i)}static makeClipAdditive(e,t=0,n=e,r=30){return rS(e,t,n,r)}},aS=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e<r)){for(let a=n+2;;){if(r===void 0){if(e<i)break forward_scan;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break seek}a=t.length;break linear_scan}if(!(e>=i)){let o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n<a;){let r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],i===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw Error(`call to abstract method`)}intervalChanged_(){}},oS=class extends aS{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Tp,endingEnd:Tp}}intervalChanged_(e,t,n){let r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case Ep:i=e,o=2*t-n;break;case Dp:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(s===void 0)switch(this.getSettings_().endingEnd){case Ep:a=e,s=2*n-t;break;case Dp:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}let c=(n-t)*.5,l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),m=p*p,h=m*p,g=-d*h+2*d*m-d*p,_=(1+d)*h+(-1.5-2*d)*m+(-.5+d)*p+1,v=(-1-f)*h+(1.5+f)*m+.5*p,y=f*h-f*m;for(let e=0;e!==o;++e)i[e]=g*a[l+e]+_*a[c+e]+v*a[s+e]+y*a[u+e];return i}},sS=class extends aS{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l;for(let e=0;e!==o;++e)i[e]=a[c+e]*u+a[s+e]*l;return i}},cS=class extends aS{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}},lS=class{constructor(e,t,n,r){if(e===void 0)throw Error(`THREE.KeyframeTrack: track name is undefined`);if(t===void 0||t.length===0)throw Error(`THREE.KeyframeTrack: no keyframes in track named `+e);this.name=e,this.times=Qx(t,this.TimeBufferType),this.values=Qx(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Qx(e.times,Array),values:Qx(e.values,Array)};let t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new cS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new sS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new oS(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Sp:t=this.InterpolantFactoryMethodDiscrete;break;case Cp:t=this.InterpolantFactoryMethodLinear;break;case wp:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let t=`unsupported interpolation for `+this.ValueTypeName+` keyframe track named `+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return J(`KeyframeTrack:`,t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Sp;case this.InterpolantFactoryMethodLinear:return Cp;case this.InterpolantFactoryMethodSmooth:return wp}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){let n=this.times,r=n.length,i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;a!==-1&&n[a]>t;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(_m(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(_m(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){_m(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){_m(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&lm(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){_m(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===wp,i=e.length-1,a=1;for(let o=1;o<i;++o){let i=!1,s=e[o];if(s!==e[o+1]&&(o!==1||s!==e[0]))if(r)i=!0;else{let e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){let n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}if(i){if(o!==a){e[a]=e[o];let r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};lS.prototype.ValueTypeName=``,lS.prototype.TimeBufferType=Float32Array,lS.prototype.ValueBufferType=Float32Array,lS.prototype.DefaultInterpolation=Cp;var uS=class extends lS{constructor(e,t,n){super(e,t,n)}};uS.prototype.ValueTypeName=`bool`,uS.prototype.ValueBufferType=Array,uS.prototype.DefaultInterpolation=Sp,uS.prototype.InterpolantFactoryMethodLinear=void 0,uS.prototype.InterpolantFactoryMethodSmooth=void 0;var dS=class extends lS{constructor(e,t,n,r){super(e,t,n,r)}};dS.prototype.ValueTypeName=`color`;var fS=class extends lS{constructor(e,t,n,r){super(e,t,n,r)}};fS.prototype.ValueTypeName=`number`;var pS=class extends aS{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;
vendor: 6,106 bytes, line 425
425c+=4)Jm.slerpFlat(i,0,a,c-o,a,c,s);return i}},mS=class extends lS{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new pS(this.times,this.values,this.getValueSize(),e)}};mS.prototype.ValueTypeName=`quaternion`,mS.prototype.InterpolantFactoryMethodSmooth=void 0;var hS=class extends lS{constructor(e,t,n){super(e,t,n)}};hS.prototype.ValueTypeName=`string`,hS.prototype.ValueBufferType=Array,hS.prototype.DefaultInterpolation=Sp,hS.prototype.InterpolantFactoryMethodLinear=void 0,hS.prototype.InterpolantFactoryMethodSmooth=void 0;var gS=class extends lS{constructor(e,t,n,r){super(e,t,n,r)}};gS.prototype.ValueTypeName=`vector`;var _S=class{constructor(e=``,t=-1,n=[],r=Op){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Tm(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(yS(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||`{}`),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(lS.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e<i;e++){let o=[],s=[];o.push((e+i-1)%i,e,(e+1)%i),s.push(0,1,0);let c=$x(o);o=eS(o,1,c),s=eS(s,1,c),!r&&o[0]===0&&(o.push(i),s.push(s[0])),a.push(new fS(`.morphTargetInfluences[`+t[e].name+`]`,o,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){let t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){let n=e[t],a=n.name.match(i);if(a&&a.length>1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(J(`AnimationClip: parseAnimation() is deprecated and will be removed with r185`),!e)return _m(`AnimationClip: No animation in JSONLoader data.`),null;let n=function(e,t,n,r,i){if(n.length!==0){let a=[],o=[];tS(n,a,o,r),a.length!==0&&i.push(new e(t,a,o))}},r=[],i=e.name||`default`,a=e.fps||30,o=e.blendMode,s=e.length||-1,c=e.hierarchy||[];for(let e=0;e<c.length;e++){let i=c[e].keys;if(!(!i||i.length===0))if(i[0].morphTargets){let e={},t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let n=0;n<i[t].morphTargets.length;n++)e[i[t].morphTargets[n]]=-1;for(let n in e){let e=[],a=[];for(let r=0;r!==i[t].morphTargets.length;++r){let r=i[t];e.push(r.time),a.push(r.morphTarget===n?1:0)}r.push(new fS(`.morphTargetInfluence[`+n+`]`,e,a))}s=e.length*a}else{let a=`.bones[`+t[e].name+`]`;n(gS,a+`.position`,i,`pos`,r),n(mS,a+`.quaternion`,i,`rot`,r),n(gS,a+`.scale`,i,`scl`,r)}}return r.length===0?null:new this(i,s,r,o)}resetDuration(){let e=this.tracks,t=0;for(let n=0,r=e.length;n!==r;++n){let e=this.tracks[n];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e&&=this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());let t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}};function vS(e){switch(e.toLowerCase()){case`scalar`:case`double`:case`float`:case`number`:case`integer`:return fS;case`vector`:case`vector2`:case`vector3`:case`vector4`:return gS;case`color`:return dS;case`quaternion`:return mS;case`bool`:case`boolean`:return uS;case`string`:return hS}throw Error(`THREE.KeyframeTrack: Unsupported typeName: `+e)}function yS(e){if(e.type===void 0)throw Error(`THREE.KeyframeTrack: track type undefined, can not parse`);let t=vS(e.type);if(e.times===void 0){let t=[],n=[];tS(e.keys,t,n,`value`),e.times=t,e.values=n}return t.parse===void 0?new t(e.name,e.times,e.values,e.interpolation):t.parse(e)}var bS={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},xS=class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t<n;t+=2){let n=c[t],r=c[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||=new AbortController,this._abortController}},SS=new xS,CS=class{constructor(e){this.manager=e===void 0?SS:e,this.crossOrigin=`anonymous`,this.withCredentials=!1,this.path=``,this.resourcePath=``,this.requestHeader={}}load(){}loadAsync(e,t){let n=this;return new Promise(function(r,i){n.load(e,r,t,i)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};CS.DEFAULT_MATERIAL_NAME=`__DEFAULT`;var wS={}
vendor: 57,772 bytes, line 425
425,TS=class extends Error{constructor(e,t){super(e),this.response=t}},ES=class extends CS{constructor(e){super(e),this.mimeType=``,this.responseType=``,this._abortController=new AbortController}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=bS.get(`file:${e}`);if(i!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(i),this.manager.itemEnd(e)},0),i;if(wS[e]!==void 0){wS[e].push({onLoad:t,onProgress:n,onError:r});return}wS[e]=[],wS[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&J(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=wS[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e<t;e++){let t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}},t=>{e.error(t)})}}});return new Response(c)}else throw new TS(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{bS.add(`file:${e}`,t);let n=wS[e];delete wS[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onLoad&&r.onLoad(t)}}).catch(t=>{let n=wS[e];if(n===void 0)throw this.manager.itemError(e),t;delete wS[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},DS=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new ES(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):_m(t),i.manager.itemError(e)}},n,r)}parse(e){let t=[];for(let n=0;n<e.length;n++){let r=_S.parse(e[n]);t.push(r)}return t}},OS=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=this,a=[],o=new Gy,s=new ES(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);let c=0;function l(l){s.load(e[l],function(e){let n=i.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},c+=1,c===6&&(n.mipmapCount===1&&(o.minFilter=cf),o.image=a,o.format=n.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)l(t);else s.load(e,function(e){let n=i.parse(e,!0);if(n.isCubemap){let e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)a[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),a[t].format=n.format,a[t].width=n.width,a[t].height=n.height}o.image=a}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;n.mipmapCount===1&&(o.minFilter=cf),o.format=n.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}},kS=new WeakMap,AS=class extends CS{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=bS.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);else{let e=kS.get(a);e===void 0&&(e=[],kS.set(a,e)),e.push({onLoad:t,onError:r})}return a}let o=um(`img`);function s(){l(),t&&t(this);let n=kS.get(this)||[];for(let e=0;e<n.length;e++){let t=n[e];t.onLoad&&t.onLoad(this)}kS.delete(this),i.manager.itemEnd(e)}function c(t){l(),r&&r(t),bS.remove(`image:${e}`);let n=kS.get(this)||[];for(let e=0;e<n.length;e++){let r=n[e];r.onError&&r.onError(t)}kS.delete(this),i.manager.itemError(e),i.manager.itemEnd(e)}function l(){o.removeEventListener(`load`,s,!1),o.removeEventListener(`error`,c,!1)}return o.addEventListener(`load`,s,!1),o.addEventListener(`error`,c,!1),e.slice(0,5)!==`data:`&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),bS.add(`image:${e}`,o),i.manager.itemStart(e),o.src=e,o}},jS=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=new G_;i.colorSpace=Pp;let a=new AS(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function s(n){a.load(e[n],function(e){i.images[n]=e,o++,o===6&&(i.needsUpdate=!0,t&&t(i))},void 0,r)}for(let t=0;t<e.length;++t)s(t);return i}},MS=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Mv,o=new ES(this.manager);return o.setResponseType(`arraybuffer`),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,function(e){let n;try{n=i.parse(e)}catch(e){if(r!==void 0)r(e);else{e(e);return}}n.image===void 0?n.data!==void 0&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data):a.image=n.image,a.wrapS=n.wrapS===void 0?ef:n.wrapS,a.wrapT=n.wrapT===void 0?ef:n.wrapT,a.magFilter=n.magFilter===void 0?cf:n.magFilter,a.minFilter=n.minFilter===void 0?cf:n.minFilter,a.anisotropy=n.anisotropy===void 0?1:n.anisotropy,n.colorSpace!==void 0&&(a.colorSpace=n.colorSpace),n.flipY!==void 0&&(a.flipY=n.flipY),n.format!==void 0&&(a.format=n.format),n.type!==void 0&&(a.type=n.type),n.mipmaps!==void 0&&(a.mipmaps=n.mipmaps,a.minFilter=df),n.mipmapCount===1&&(a.minFilter=cf),n.generateMipmaps!==void 0&&(a.generateMipmaps=n.generateMipmaps),a.needsUpdate=!0,t&&t(a,n)},n,r),a}},NS=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=new fh,a=new AS(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,t!==void 0&&t(i)},n,r),i}},PS=class extends bg{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new Z(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},FS=class extends PS{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type=`HemisphereLight`,this.position.copy(bg.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Z(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){let t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}},IS=new qh,LS=new X,RS=new X,zS=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Y(512,512),this.mapType=pf,this.map=null,this.mapPass=null,this.matrix=new qh,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Qv,this._frameExtents=new Y(1,1),this._viewportCount=1,this._viewports=[new ph(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;LS.setFromMatrixPosition(e.matrixWorld),t.position.copy(LS),RS.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(RS),t.updateMatrixWorld(),IS.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(IS,t.coordinateSystem,t.reversedDepth),t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(IS)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},BS=class extends zS{constructor(){super(new V_(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,n=wm*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},VS=class extends PS{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type=`SpotLight`,this.position.copy(bg.DEFAULT_UP),this.updateMatrix(),this.target=new bg,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new BS}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},HS=class extends zS{constructor(){super(new V_(90,1,.5,500)),this.isPointLightShadow=!0}},US=class extends PS{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type=`PointLight`,this.distance=n,this.decay=r,this.shadow=new HS}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},WS=class extends L_{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},GS=class extends zS{constructor(){super(new WS(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},KS=class extends PS{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(bg.DEFAULT_UP),this.updateMatrix(),this.target=new bg,this.shadow=new GS}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},qS=class extends PS{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},JS=class extends PS{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type=`RectAreaLight`,this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},YS=class{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new X)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],1.092548*(n*r)),t.addScaledVector(a[5],1.092548*(r*i)),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],1.092548*(n*i)),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){let n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],2*.511664*r),t.addScaledVector(a[2],2*.511664*i),t.addScaledVector(a[3],2*.511664*n),t.addScaledVector(a[4],2*.429043*n*r),t.addScaledVector(a[5],2*.429043*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],2*.429043*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){let n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){let n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){let n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}},XS=class extends PS{constructor(e=new YS,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}},ZS=class e extends CS{constructor(e){super(e),this.textures={}}load(e,t,n,r){let i=this,a=new ES(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):_m(t),i.manager.itemError(e)}},n,r)}parse(e){let t=this.textures;function n(e){return t[e]===void 0&&J(`MaterialLoader: Undefined texture`,e),t[e]}let r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new Z().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(r.allowOverride=e.allowOverride),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors==`number`?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let t in e.uniforms){let i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case`t`:r.uniforms[t].value=n(i.value);break;case`c`:r.uniforms[t].value=new Z().setHex(i.value);break;case`v2`:r.uniforms[t].value=new Y().fromArray(i.value);break;case`v3`:r.uniforms[t].value=new X().fromArray(i.value);break;case`v4`:r.uniforms[t].value=new ph().fromArray(i.value);break;case`m3`:r.uniforms[t].value=new Zm().fromArray(i.value);break;case`m4`:r.uniforms[t].value=new qh().fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)r.extensions[t]=e.extensions[t];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),r.normalScale=new Y().fromArray(t)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Y().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(t){return e.createMaterialFromType(t)}static createMaterialFromType(e){return new{ShadowMaterial:Bx,SpriteMaterial:nv,RawShaderMaterial:Vx,ShaderMaterial:I_,PointsMaterial:Fy,MeshPhysicalMaterial:Ux,MeshStandardMaterial:Hx,MeshPhongMaterial:Wx,MeshToonMaterial:Gx,MeshNormalMaterial:Kx,MeshLambertMaterial:qx,MeshDepthMaterial:Jx,MeshDistanceMaterial:Yx,MeshBasicMaterial:Hg,MeshMatcapMaterial:Xx,LineDashedMaterial:Zx,LineBasicMaterial:xy,Material:Vg}[e]}},QS=class{static extractUrlBase(e){let t=e.lastIndexOf(`/`);return t===-1?`./`:e.slice(0,t+1)}static resolveURL(e,t){return typeof e!=`string`||e===``?``:(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,`$1`)),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},$S=class extends p_{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type=`InstancedBufferGeometry`,this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},eC=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new ES(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):_m(t),i.manager.itemError(e)}},n,r)}parse(e){let t={},n={};function r(e,n){if(t[n]!==void 0)return t[n];let r=e.interleavedBuffers[n],a=i(e,r.buffer),o=new $_(cm(r.type,a),r.stride);return o.uuid=r.uuid,t[n]=o,o}function i(e,t){if(n[t]!==void 0)return n[t];let r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}let a=e.isInstancedBufferGeometry?new $S:new p_,o=e.data.index;if(o!==void 0){let e=cm(o.type,o.array);a.setIndex(new Zg(e,1))}let s=e.data.attributes;for(let t in s){let n=s[t],i;if(n.isInterleavedBufferAttribute)i=new tv(r(e.data,n.data),n.itemSize,n.offset,n.normalized);else{let e=cm(n.type,n.array);i=new(n.isInstancedBufferAttribute?Iv:Zg)(e,n.itemSize,n.normalized)}n.name!==void 0&&(i.name=n.name),n.usage!==void 0&&i.setUsage(n.usage),a.setAttribute(t,i)}let c=e.data.morphAttributes;if(c)for(let t in c){let n=c[t],i=[];for(let t=0,a=n.length;t<a;t++){let a=n[t],o;o=a.isInterleavedBufferAttribute?new tv(r(e.data,a.data),a.itemSize,a.offset,a.normalized):new Zg(cm(a.type,a.array),a.itemSize,a.normalized),a.name!==void 0&&(o.name=a.name),i.push(o)}a.morphAttributes[t]=i}e.data.morphTargetsRelative&&(a.morphTargetsRelative=!0);let l=e.data.groups||e.data.drawcalls||e.data.offsets;if(l!==void 0)for(let e=0,t=l.length;e!==t;++e){let t=l[e];a.addGroup(t.start,t.count,t.materialIndex)}let u=e.data.boundingSphere;return u!==void 0&&(a.boundingSphere=new Rh().fromJSON(u)),e.name&&(a.name=e.name),e.userData&&(a.userData=e.userData),a}},tC=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=this,a=this.path===``?QS.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;let o=new ES(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(n){let a=null;try{a=JSON.parse(n)}catch(t){r!==void 0&&r(t),t(`ObjectLoader: Can't parse `+e+`.`,t.message);return}let o=a.metadata;if(o===void 0||o.type===void 0||o.type.toLowerCase()===`geometry`){r!==void 0&&r(Error(`THREE.ObjectLoader: Can't load `+e)),_m(`ObjectLoader: Can't load `+e);return}i.parse(a,t)},n,r)}async loadAsync(e,t){let n=this,r=this.path===``?QS.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;let i=new ES(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);let a=await i.loadAsync(e,t),o=JSON.parse(a),s=o.metadata;if(s===void 0||s.type===void 0||s.type.toLowerCase()===`geometry`)throw Error(`THREE.ObjectLoader: Can't load `+e);return await n.parseAsync(o)}parse(e,t){let n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,function(){t!==void 0&&t(c)}),o=this.parseTextures(e.textures,a),s=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,i,s,o,n),l=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,l),this.bindLightTargets(c),t!==void 0){let e=!1;for(let t in a)if(a[t].data instanceof HTMLImageElement){e=!0;break}e===!1&&t(c)}return c}async parseAsync(e){let t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o,a,t),c=this.parseSkeletons(e.skeletons,s);return this.bindSkeletons(s,c),this.bindLightTargets(s),s}parseShapes(e){let t={};if(e!==void 0)for(let n=0,r=e.length;n<r;n++){let r=new Rb().fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){let n={},r={};if(t.traverse(function(e){e.isBone&&(r[e.uuid]=e)}),e!==void 0)for(let t=0,i=e.length;t<i;t++){let i=new Fv().fromJSON(e[t],r);n[i.uuid]=i}return n}parseGeometries(e,t){let n={};if(e!==void 0){let r=new eC;for(let i=0,a=e.length;i<a;i++){let a,o=e[i];switch(o.type){case`BufferGeometry`:case`InstancedBufferGeometry`:a=r.parse(o);break;default:o.type in zx?a=zx[o.type].fromJSON(o,t):J(`ObjectLoader: Unsupported geometry type "${o.type}"`)}a.uuid=o.uuid,o.name!==void 0&&(a.name=o.name),o.userData!==void 0&&(a.userData=o.userData),n[o.uuid]=a}}return n}parseMaterials(e,t){let n={},r={};if(e!==void 0){let i=new ZS;i.setTextures(t);for(let t=0,a=e.length;t<a;t++){let a=e[t];n[a.uuid]===void 0&&(n[a.uuid]=i.parse(a)),r[a.uuid]=n[a.uuid]}}return r}parseAnimations(e){let t={};if(e!==void 0)for(let n=0;n<e.length;n++){let r=e[n],i=_S.parse(r);t[i.uuid]=i}return t}parseImages(e,t){let n=this,r={},i;function a(e){return n.manager.itemStart(e),i.load(e,function(){n.manager.itemEnd(e)},void 0,function(){n.manager.itemError(e),n.manager.itemEnd(e)})}function o(e){if(typeof e==`string`){let t=e;return a(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}else if(e.data)return{data:cm(e.type,e.data),width:e.width,height:e.height};else return null}if(e!==void 0&&e.length>0){i=new AS(new xS(t)),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){let n=e[t],i=n.url;if(Array.isArray(i)){let e=[];for(let t=0,n=i.length;t<n;t++){let n=i[t],r=o(n);r!==null&&(r instanceof HTMLImageElement?e.push(r):e.push(new Mv(r.data,r.width,r.height)))}r[n.uuid]=new ch(e)}else{let e=o(n.url);r[n.uuid]=new ch(e)}}}return r}async parseImagesAsync(e){let t=this,n={},r;async function i(e){if(typeof e==`string`){let n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}else if(e.data)return{data:cm(e.type,e.data),width:e.width,height:e.height};else return null}if(e!==void 0&&e.length>0){r=new AS(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){let r=e[t],a=r.url;if(Array.isArray(a)){let e=[];for(let t=0,n=a.length;t<n;t++){let n=a[t],r=await i(n);r!==null&&(r instanceof HTMLImageElement?e.push(r):e.push(new Mv(r.data,r.width,r.height)))}n[r.uuid]=new ch(e)}else{let e=await i(r.url);n[r.uuid]=new ch(e)}}}return n}parseTextures(e,t){function n(e,t){return typeof e==`number`?e:(J(`ObjectLoader.parseTexture: Constant should be in numeric form.`,e),t[e])}let r={};if(e!==void 0)for(let i=0,a=e.length;i<a;i++){let a=e[i];a.image===void 0&&J(`ObjectLoader: No "image" specified for`,a.uuid),t[a.image]===void 0&&J(`ObjectLoader: Undefined image`,a.image);let o=t[a.image],s=o.data,c;Array.isArray(s)?(c=new G_,s.length===6&&(c.needsUpdate=!0)):(c=s&&s.data?new Mv:new fh,s&&(c.needsUpdate=!0)),c.source=o,c.uuid=a.uuid,a.name!==void 0&&(c.name=a.name),a.mapping!==void 0&&(c.mapping=n(a.mapping,nC)),a.channel!==void 0&&(c.channel=a.channel),a.offset!==void 0&&c.offset.fromArray(a.offset),a.repeat!==void 0&&c.repeat.fromArray(a.repeat),a.center!==void 0&&c.center.fromArray(a.center),a.rotation!==void 0&&(c.rotation=a.rotation),a.wrap!==void 0&&(c.wrapS=n(a.wrap[0],rC),c.wrapT=n(a.wrap[1],rC)),a.format!==void 0&&(c.format=a.format),a.internalFormat!==void 0&&(c.internalFormat=a.internalFormat),a.type!==void 0&&(c.type=a.type),a.colorSpace!==void 0&&(c.colorSpace=a.colorSpace),a.minFilter!==void 0&&(c.minFilter=n(a.minFilter,iC)),a.magFilter!==void 0&&(c.magFilter=n(a.magFilter,iC)),a.anisotropy!==void 0&&(c.anisotropy=a.anisotropy),a.flipY!==void 0&&(c.flipY=a.flipY),a.generateMipmaps!==void 0&&(c.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(c.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(c.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(c.compareFunction=a.compareFunction),a.userData!==void 0&&(c.userData=a.userData),r[a.uuid]=c}return r}parseObject(e,t,n,r,i){let a;function o(e){return t[e]===void 0&&J(`ObjectLoader: Undefined geometry`,e),t[e]}function s(e){if(e!==void 0){if(Array.isArray(e)){let t=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];n[i]===void 0&&J(`ObjectLoader: Undefined material`,i),t.push(n[i])}return t}return n[e]===void 0&&J(`ObjectLoader: Undefined material`,e),n[e]}}function c(e){return r[e]===void 0&&J(`ObjectLoader: Undefined texture`,e),r[e]}let l,u;switch(e.type){case`Scene`:a=new Q_,e.background!==void 0&&(Number.isInteger(e.background)?a.background=new Z(e.background):a.background=c(e.background)),e.environment!==void 0&&(a.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type===`Fog`?a.fog=new Z_(e.fog.color,e.fog.near,e.fog.far):e.fog.type===`FogExp2`&&(a.fog=new X_(e.fog.color,e.fog.density)),e.fog.name!==``&&(a.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(a.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(a.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&a.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(a.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&a.environmentRotation.fromArray(e.environmentRotation);break;case`PerspectiveCamera`:a=new V_(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(a.focus=e.focus),e.zoom!==void 0&&(a.zoom=e.zoom),e.filmGauge!==void 0&&(a.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(a.filmOffset=e.filmOffset),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case`OrthographicCamera`:a=new WS(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(a.zoom=e.zoom),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case`AmbientLight`:a=new qS(e.color,e.intensity);break;case`DirectionalLight`:a=new KS(e.color,e.intensity),a.target=e.target||``;break;case`PointLight`:a=new US(e.color,e.intensity,e.distance,e.decay);break;case`RectAreaLight`:a=new JS(e.color,e.intensity,e.width,e.height);break;case`SpotLight`:a=new VS(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),a.target=e.target||``;break;case`HemisphereLight`:a=new FS(e.color,e.groundColor,e.intensity);break;case`LightProbe`:a=new XS(new YS().fromArray(e.sh),e.intensity);break;case`SkinnedMesh`:l=o(e.geometry),u=s(e.material),a=new Av(l,u),e.bindMode!==void 0&&(a.bindMode=e.bindMode),e.bindMatrix!==void 0&&a.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(a.skeleton=e.skeleton);break;case`Mesh`:l=o(e.geometry),u=s(e.material),a=new T_(l,u);break;case`InstancedMesh`:l=o(e.geometry),u=s(e.material);let t=e.count,n=e.instanceMatrix,r=e.instanceColor;a=new Wv(l,u,t),a.instanceMatrix=new Iv(new Float32Array(n.array),16),r!==void 0&&(a.instanceColor=new Iv(new Float32Array(r.array),r.itemSize));break;case`BatchedMesh`:l=o(e.geometry),u=s(e.material),a=new by(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,u),a.geometry=l,a.perObjectFrustumCulled=e.perObjectFrustumCulled,a.sortObjects=e.sortObjects,a._drawRanges=e.drawRanges,a._reservedRanges=e.reservedRanges,a._geometryInfo=e.geometryInfo.map(e=>{let t=null,n=null;return e.boundingBox!==void 0&&(t=new bh().fromJSON(e.boundingBox)),e.boundingSphere!==void 0&&(n=new Rh().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(a.boundingSphere=new Rh().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(a.boundingBox=new bh().fromJSON(e.boundingBox));break;case`LOD`:a=new bv;break;case`Line`:a=new ky(o(e.geometry),s(e.material));break;case`LineLoop`:a=new Py(o(e.geometry),s(e.material));break;case`LineSegments`:a=new Ny(o(e.geometry),s(e.material));break;case`PointCloud`:case`Points`:a=new By(o(e.geometry),s(e.material));break;case`Sprite`:a=new gv(s(e.material));break;case`Group`:a=new q_;break;case`Bone`:a=new jv;break;default:a=new bg}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix===void 0?(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)):(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){let o=e.children;for(let e=0;e<o.length;e++)a.add(this.parseObject(o[e],t,n,r,i))}if(e.animations!==void 0){let t=e.animations;for(let e=0;e<t.length;e++){let n=t[e];a.animations.push(i[n])}}if(e.type===`LOD`){e.autoUpdate!==void 0&&(a.autoUpdate=e.autoUpdate);let t=e.levels;for(let e=0;e<t.length;e++){let n=t[e],r=a.getObjectByProperty(`uuid`,n.object);r!==void 0&&a.addLevel(r,n.distance,n.hysteresis)}}return a}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(e){if(e.isSkinnedMesh===!0&&e.skeleton!==void 0){let n=t[e.skeleton];n===void 0?J(`ObjectLoader: No skeleton found with UUID:`,e.skeleton):e.bind(n,e.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){let n=t.target,r=e.getObjectByProperty(`uuid`,n);r===void 0?t.target=new bg:t.target=r}})}},nC={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306},rC={RepeatWrapping:$d,ClampToEdgeWrapping:ef,MirroredRepeatWrapping:tf},iC={NearestFilter:nf,NearestMipmapNearestFilter:rf,NearestMipmapLinearFilter:of,LinearFilter:cf,LinearMipmapNearestFilter:lf,LinearMipmapLinearFilter:df},aC=new WeakMap,oC=class extends CS{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>`u`&&J(`ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&J(`ImageBitmapLoader: fetch() not supported.`),this.options={premultiplyAlpha:`none`},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=bS.get(`image-bitmap:${e}`);if(a!==void 0){if(i.manager.itemStart(e),a.then){a.then(n=>{if(aC.has(a)===!0)r&&r(aC.get(a)),i.manager.itemError(e),i.manager.itemEnd(e);else return t&&t(n),i.manager.itemEnd(e),n});return}return setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a}let o={};o.credentials=this.crossOrigin===`anonymous`?`same-origin`:`include`,o.headers=this.requestHeader,o.signal=typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:`none`}))}).then(function(n){return bS.add(`image-bitmap:${e}`,n),t&&t(n),i.manager.itemEnd(e),n}).catch(function(t){r&&r(t),aC.set(s,t),bS.remove(`image-bitmap:${e}`),i.manager.itemError(e),i.manager.itemEnd(e)});bS.add(`image-bitmap:${e}`,s),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},sC,cC=class{static getContext(){return sC===void 0&&(sC=new(window.AudioContext||window.webkitAudioContext)),sC}static setContext(e){sC=e}},lC=class extends CS{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new ES(this.manager);a.setResponseType(`arraybuffer`),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(e){try{let n=e.slice(0);cC.getContext().decodeAudioData(n,function(e){t(e)}).catch(o)}catch(e){o(e)}},n,r);function o(t){r?r(t):_m(t),i.manager.itemError(e)}}},uC=new qh,dC=new qh,fC=new qh,pC=class{constructor(){this.type=`StereoCamera`,this.aspect=1,this.eyeSep=.064,this.cameraL=new V_,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new V_,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,fC.copy(e.projectionMatrix);let n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(Cm*t.fov*.5)/t.zoom,a,o;dC.elements[12]=-n,uC.elements[12]=n,a=-i*t.aspect+r,o=i*t.aspect+r,fC.elements[0]=2*t.near/(o-a),fC.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(fC),a=-i*t.aspect-r,o=i*t.aspect-r,fC.elements[0]=2*t.near/(o-a),fC.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(fC)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(dC),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(uC)}},mC=class extends V_{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},hC=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}},gC=new X,_C=new Jm,vC=new X,yC=new X,bC=new X,xC=class extends bg{constructor(){super(),this.type=`AudioListener`,this.context=cC.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new hC}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter===null?this.gain.disconnect(this.context.destination):(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(gC,_C,vC),yC.set(0,0,-1).applyQuaternion(_C),bC.set(0,1,0).applyQuaternion(_C),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(gC.x,e),t.positionY.linearRampToValueAtTime(gC.y,e),t.positionZ.linearRampToValueAtTime(gC.z,e),t.forwardX.linearRampToValueAtTime(yC.x,e),t.forwardY.linearRampToValueAtTime(yC.y,e),t.forwardZ.linearRampToValueAtTime(yC.z,e),t.upX.linearRampToValueAtTime(bC.x,e),t.upY.linearRampToValueAtTime(bC.y,e),t.upZ.linearRampToValueAtTime(bC.z,e)}else t.setPosition(gC.x,gC.y,gC.z),t.setOrientation(yC.x,yC.y,yC.z,bC.x,bC.y,bC.z)}},SC=class extends bg{constructor(e){super(),this.type=`Audio`,this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType=`empty`,this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType=`audioNode`,this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaNode`,this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaStreamNode`,this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType=`buffer`,this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){J(`Audio: Audio is already playing.`);return}if(this.hasPlaybackControl===!1){J(`Audio: this Audio has no playback control.`);return}this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){J(`Audio: this Audio has no playback control.`);return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress%=this.duration||this.buffer.duration),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){J(`Audio: this Audio has no playback control.`);return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||=[],this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){J(`Audio: this Audio has no playback control.`);return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(J(`Audio: this Audio has no playback control.`),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){J(`Audio: this Audio has no playback control.`);return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType===`buffer`?(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this):(J(`Audio: Audio source type cannot be copied.`),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}},CC=new X,wC=new Jm,TC=new X,EC=new X,DC=class extends SC{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel=`HRTF`,this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(CC,wC,TC),EC.set(0,0,1).applyQuaternion(wC);let t=this.panner;if(t.positionX){let e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(CC.x,e),t.positionY.linearRampToValueAtTime(CC.y,e),t.positionZ.linearRampToValueAtTime(CC.z,e),t.orientationX.linearRampToValueAtTime(EC.x,e),t.orientationY.linearRampToValueAtTime(EC.y,e),t.orientationZ.linearRampToValueAtTime(EC.z,e)}else t.setPosition(CC.x,CC.y,CC.z),t.setOrientation(EC.x,EC.y,EC.z)}},OC=class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0,t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}},kC=class{constructor(e,t,n){this.binding=e,this.valueSize=n;let r,i,a;switch(t){case`quaternion`:r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case`string`:case`bool`:r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=Array(n*5);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(a===0){for(let e=0;e!==r;++e)n[i+e]=n[e];a=t}else{a+=t;let e=t/a;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=a}accumulateAdditive(e){let t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){let e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){Jm.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){let a=this._workIndex*i;Jm.multiplyQuaternionsFlat(e,a,e,t,e,n),Jm.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){let a=1-r;for(let o=0;o!==i;++o){let i=t+o;e[i]=e[i]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){let i=t+a;e[i]=e[i]+e[n+a]*r}}},AC=`\\[\\]\\.:\\/`,jC=RegExp(`[`+AC+`]`,`g`),MC=`[^`+AC+`]`,NC=`[^`+AC.replace(`\\.`,``)+`]`,PC=`((?:WC+[\\/:])*)`.replace(`WC`,MC),FC=`(WCOD+)?`.replace(`WCOD`,NC),IC=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,MC),LC=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,MC),RC=RegExp(`^`+PC+FC+IC+LC+`$`),zC=[`material`,`materials`,`bones`,`map`],BC=class{constructor(e,t,n){let r=n||VC.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},VC=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(jC,``)}static parseTrackName(e){let t=RC.exec(e);if(t===null)throw Error(`PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);zC.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r<e.length;r++){let i=e[r];if(i.name===t||i.uuid===t)return i;let a=n(i.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,148 bytes, line 425
425_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let t=this.node,n=this.parsedPath,r=n.objectName,i=n.propertyName,a=n.propertyIndex;if(t||(t=e.findNode(this.rootNode,n.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){J(`PropertyBinding: No target node found for track: `+this.path+`.`);return}if(r){let e=n.objectIndex;switch(r){case`materials`:if(!t.material){_m(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.materials){_m(`PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.`,this);return}t=t.material.materials;break;case`bones`:if(!t.skeleton){_m(`PropertyBinding: Can not bind to bones as node does not have a skeleton.`,this);return}t=t.skeleton.bones;for(let n=0;n<t.length;n++)if(t[n].name===e){e=n;break}break;case`map`:if(`map`in t){t=t.map;break}if(!t.material){_m(`PropertyBinding: Can not bind to material as node does not have a material.`,this);return}if(!t.material.map){_m(`PropertyBinding: Can not bind to material.map as node.material does not have a map.`,this);return}t=t.material.map;break;default:if(t[r]===void 0){_m(`PropertyBinding: Can not bind to objectName of node undefined.`,this);return}t=t[r]}if(e!==void 0){if(t[e]===void 0){_m(`PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.`,this,t);return}t=t[e]}}let o=t[i];if(o===void 0){let e=n.nodeName;_m(`PropertyBinding: Trying to update property for track: `+e+`.`+i+` but it wasn't found.`,t);return}let s=this.Versioning.None;this.targetObject=t,t.isMaterial===!0?s=this.Versioning.NeedsUpdate:t.isObject3D===!0&&(s=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(a!==void 0){if(i===`morphTargetInfluences`){if(!t.geometry){_m(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.`,this);return}if(!t.geometry.morphAttributes){_m(`PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.`,this);return}t.morphTargetDictionary[a]!==void 0&&(a=t.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=a}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};VC.Composite=BC,VC.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},VC.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},VC.prototype.GetterByBindingType=[VC.prototype._getValue_direct,VC.prototype._getValue_array,VC.prototype._getValue_arrayElement,VC.prototype._getValue_toArray],VC.prototype.SetterByBindingTypeAndVersioning=[[VC.prototype._setValue_direct,VC.prototype._setValue_direct_setNeedsUpdate,VC.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[VC.prototype._setValue_array,VC.prototype._setValue_array_setNeedsUpdate,VC.prototype._setValue_array_setMatr
vendor: 4,269 bytes, line 425
425ixWorldNeedsUpdate],[VC.prototype._setValue_arrayElement,VC.prototype._setValue_arrayElement_setNeedsUpdate,VC.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[VC.prototype._setValue_fromArray,VC.prototype._setValue_fromArray_setNeedsUpdate,VC.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var HC=class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Tm(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){let e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,a=i.length,o,s=e.length,c=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){let u=arguments[l],d=u.uuid,f=t[d];if(f===void 0){f=s++,t[d]=f,e.push(u);for(let e=0,t=a;e!==t;++e)i[e].push(new VC(u,n[e],r[e]))}else if(f<c){o=e[f];let s=--c,l=e[s];t[l.uuid]=f,e[f]=l,t[d]=s,e[s]=u;for(let e=0,t=a;e!==t;++e){let t=i[e],a=t[s],o=t[f];t[f]=a,o===void 0&&(o=new VC(u,n[e],r[e])),t[s]=o}}else e[f]!==o&&_m(`AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.`)}this.nCachedObjects_=c}remove(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a],s=o.uuid,c=t[s];if(c!==void 0&&c>=i){let a=i++,l=e[a];t[l.uuid]=c,e[c]=l,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){let t=n[e],r=t[a],i=t[c];t[c]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){let s=arguments[o].uuid,c=t[s];if(c!==void 0)if(delete t[s],c<i){let o=--i,s=e[o],l=--a,u=e[l];t[s.uuid]=c,e[c]=s,t[u.uuid]=o,e[o]=u,e.pop();for(let e=0,t=r;e!==t;++e){let t=n[e],r=t[o],i=t[l];t[c]=r,t[o]=i,t.pop()}}else{let i=--a,o=e[i];i>0&&(t[o.uuid]=c),e[c]=o,e.pop();for(let e=0,t=r;e!==t;++e){let t=n[e];t[c]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){let n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(r!==void 0)return i[r];let a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=l,r=s.length;n!==r;++n){let r=s[n];u[n]=new VC(r,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}},UC=class{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;let i=t.tracks,a=i.length,o=Array(a),s={endingStart:Tp,endingEnd:Tp};for(let e=0;e!==a;++e){let t=i[e].createInterpolant(null);o[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=bp,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}
vendor: 4,096 bytes, line 425
425fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){let n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);let s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/a,c[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}let i=this._startTime;if(i!==null){let r=(e-i)*n;r<0||n===0?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);let a=this._updateTime(t),o=this._updateWeight(e);if(o>0){let e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case kp:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case Op:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===xp;if(e===0)return i===-1?r:a&&(i&1)==1?t-r:r;if(n===2200){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break handle_stop}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e<0?-1:1})}}else{if(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=t||r<0){let n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);let o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e>0?1:-1});else{if(o===1){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:`loop`,action:this,loopDelta:n})}}else this.time=r;if(a&&(i&1)==1)return t-r}return r}_setEndings(e,t,n){let r=this._interpolantSettings;n?(r.endingStart=Ep,r.endingEnd=Ep):(e?r.endingStart=this.zeroSlopeAtStart?Ep:Tp:r.endingStart=Dp,t?r.endingEnd=this.zeroSlopeAtEnd?Ep:Tp:r.endingEnd=Dp)}_scheduleFading(e,t,n){let r=this._mixer,i=r.time,a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);let o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}},WC=new Float32Array(1),GC=class extends bm{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];l===void 0&&(l={}
vendor: 8,038 bytes, line 425
425,c[s]=l);for(let e=0;e!==i;++e){let i=r[e],c=i.name,u=l[c];if(u!==void 0)++u.referenceCount,a[e]=u;else{if(u=a[e],u!==void 0){u._cacheIndex===null&&(++u.referenceCount,this._addInactiveBinding(u,s,c));continue}let r=t&&t._propertyBindings[e].binding.parsedPath;u=new kC(VC.create(n,c,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,c),a[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];n.useCount++===0&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){let r=this._actions,i=this._actionsByClip,a=i[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{let t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){let t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;let i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null;let u=o.actionByRoot,d=(e._localRoot||this._root).uuid;delete u[d],s.length===0&&delete a[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];--n.referenceCount===0&&this._removeInactiveBinding(n)}}_lendAction(e){let t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){let t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){let r=this._bindingsByRootAndName,i=this._bindings,a=r[t];a===void 0&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){let t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[i],Object.keys(o).length===0&&delete a[r]}_lendBinding(e){let t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){let t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return n===void 0&&(n=new sS(new Float32Array(2),new Float32Array(2),1,WC),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){let t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){let r=t||this._root,i=r.uuid,a=typeof e==`string`?_S.findByName(r,e):e,o=a===null?e:a.uuid,s=this._actionsByClip[o],c=null;if(n===void 0&&(n=a===null?Op:a.blendMode),s!==void 0){let e=s.actionByRoot[i];if(e!==void 0&&e.blendMode===n)return e;c=s.knownActions[0],a===null&&(a=c._clip)}if(a===null)return null;let l=new UC(this,a,t,n);return this._bindAction(l,c),this._addInactiveAction(l,o,i),l}existingAction(e,t){let n=t||this._root,r=n.uuid,i=typeof e==`string`?_S.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return o===void 0?null:o.actionByRoot[r]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o)t[o]._update(r,e,i,a);let o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(i!==void 0){let e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){let r=e[n];this._deactivateAction(r);let i=r._cacheIndex,a=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,a._cacheIndex=i,t[i]=a,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){let t=e.uuid,n=this._actionsByClip;for(let e in n){let r=n[e].actionByRoot[t];r!==void 0&&(this._deactivateAction(r),this._removeInactiveAction(r))}let r=this._bindingsByRootAndName[t];if(r!==void 0)for(let e in r){let t=r[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){let n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}},KC=class extends mh{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=n,this.texture=new vh(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},qC=class e{constructor(e){this.value=e}clone(){return new e(this.value.clone===void 0?this.value:this.value.clone())}},JC=0,YC=class extends bm{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,`id`,{value:JC++}),this.name=``,this.usage=Gp,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){let t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:`dispose`})}copy(e){this.name=e.name,this.usage=e.usage;let t=e.uniforms;this.uniforms.length=0;for(let e=0,n=t.length;e<n;e++){let n=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0;e<n.length;e++)this.uniforms.push(n[e].clone())}return this}clone(){return new this.constructor().copy(this)}},XC=class extends $_{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}},ZC=class{constructor(e,t,n,r,i,a=!1){this.isGLBufferAttribute=!0,this.name=``,this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.normalized=a,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}},QC=new qh,$C=class{constructor(e,t,n=0,r=1/0){this.ray=new Kh(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new ig,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):_m(`Raycaster:
425Unsupported camera type: `+t.type)}setFromXRController(e){return QC.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(QC),this}intersectObject(e,t=!0,n=[]){return tw(e,this,n,t),n.sort(ew),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)tw(e[r],this,n,t);return n.sort(ew),n}};function ew(e,t){return e.distance-t.distance}function tw(e,t,n,r){let i=!0;if(e.layers.test(t.layers)&&e.raycast(t,n)===!1&&(i=!1),i===!0&&r===!0){let r=e.children;for(let e=0,i=r.length;e<i;e++)tw(r[e],t,n,!0)}}var nw=class{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=rw.bind(this),e.addEventListener(`visibilitychange`,this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener(`visibilitychange`,this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e===void 0?performance.now():e)-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function rw(){this._document.hidden===!1&&this.reset()}var iw=class{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){let e=1e-6;return this.phi=Em(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Em(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},aw=class{constructor(e=1,t=0,n=0){this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}},ow=class e{constructor(t,n,r,i){e.prototype.isMatrix2=!0,this.elements=[1,0,0,1],t!==void 0&&this.set(t,n,r,i)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){let i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}},sw=new Y,cw=class{constructor(e=new Y(1/0,1/0),t=new Y(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=sw.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,sw).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},lw=new X,uw=new X,dw=new X,fw=new X,pw=new X,mw=new X,hw=new X,gw=class{constructor(e=new X,t=new X){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){lw.subVectors(e,this.start),uw.subVectors(this.end,this.start);let n=uw.dot(uw),r=uw.dot(lw)/n;return t&&(r=Em(r,0,1)),r}closestPointToPoint(e,t,n){let r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}
vendor: 7,116 bytes, line 425
425distanceSqToLine3(e,t=mw,n=hw){let r=1e-8*1e-8,i,a,o=this.start,s=e.start,c=this.end,l=e.end;dw.subVectors(c,o),fw.subVectors(l,s),pw.subVectors(o,s);let u=dw.dot(dw),d=fw.dot(fw),f=fw.dot(pw);if(u<=r&&d<=r)return t.copy(o),n.copy(s),t.sub(n),t.dot(t);if(u<=r)i=0,a=f/d,a=Em(a,0,1);else{let e=dw.dot(pw);if(d<=r)a=0,i=Em(-e/u,0,1);else{let t=dw.dot(fw),n=u*d-t*t;i=n===0?0:Em((t*f-e*d)/n,0,1),a=(t*i+f)/d,a<0?(a=0,i=Em(-e/u,0,1)):a>1&&(a=1,i=Em((t-e)/u,0,1))}}return t.copy(o).add(dw.multiplyScalar(i)),n.copy(s).add(fw.multiplyScalar(a)),t.sub(n),t.dot(t)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},_w=new X,vw=class extends bg{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type=`SpotLightHelper`;let n=new p_,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){let n=e/32*Math.PI*2,i=t/32*Math.PI*2;r.push(Math.cos(n),Math.sin(n),1,Math.cos(i),Math.sin(i),1)}n.setAttribute(`position`,new Q(r,3)),this.cone=new Ny(n,new xy({fog:!1,toneMapped:!1})),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),_w.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_w),this.color===void 0?this.cone.material.color.copy(this.light.color):this.cone.material.color.set(this.color)}},yw=new X,bw=new qh,xw=new qh,Sw=class extends Ny{constructor(e){let t=Cw(e),n=new p_,r=[],i=[];for(let e=0;e<t.length;e++){let n=t[e];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(0,0,0),i.push(0,0,0))}n.setAttribute(`position`,new Q(r,3)),n.setAttribute(`color`,new Q(i,3));let a=new xy({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,a),this.isSkeletonHelper=!0,this.type=`SkeletonHelper`,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;let o=new Z(255),s=new Z(65280);this.setColors(o,s)}updateMatrixWorld(e){let t=this.bones,n=this.geometry,r=n.getAttribute(`position`);xw.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){let i=t[e];i.parent&&i.parent.isBone&&(bw.multiplyMatrices(xw,i.matrixWorld),yw.setFromMatrixPosition(bw),r.setXYZ(n,yw.x,yw.y,yw.z),bw.multiplyMatrices(xw,i.parent.matrixWorld),yw.setFromMatrixPosition(bw),r.setXYZ(n+1,yw.x,yw.y,yw.z),n+=2)}n.getAttribute(`position`).needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){let n=this.geometry.getAttribute(`color`);for(let r=0;r<n.count;r+=2)n.setXYZ(r,e.r,e.g,e.b),n.setXYZ(r+1,t.r,t.g,t.b);return n.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}};function Cw(e){let t=[];e.isBone===!0&&t.push(e);for(let n=0;n<e.children.length;n++)t.push(...Cw(e.children[n]));return t}var ww=class extends T_{constructor(e,t,n){let r=new Mx(t,4,2),i=new Hg({wireframe:!0,fog:!1,toneMapped:!1});super(r,i),this.light=e,this.color=n,this.type=`PointLightHelper`,this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color===void 0?this.material.color.copy(this.light.color):this.material.color.set(this.color)}},Tw=new X,Ew=new Z,Dw=new Z,Ow=class extends bg{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type=`HemisphereLightHelper`;let r=new Dx(t);r.rotateY(Math.PI*.5),this.material=new Hg({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);let i=r.getAttribute(`position`),a=new Float32Array(i.count*3);r.setAttribute(`color`,new Zg(a,3)),this.add(new T_(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{let t=e.geometry.getAttribute(`color`);Ew.copy(this.light.color),Dw.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){let r=e<n/2?Ew:Dw;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(Tw.setFromMatrixPosition(this.light.matrixWorld).negate())}},kw=class extends Ny{constructor(e=10,t=10,n=4473924,r=8947848){n=new Z(n),r=new Z(r);let i=t/2,a=e/t,o=e/2,s=[],c=[];for(let e=0,l=0,u=-o;e<=t;e++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);let t=e===i?n:r;t.toArray(c,l),l+=3,t.toArray(c,l),l+=3,t.toArray(c,l),l+=3,t.toArray(c,l),l+=3}let l=new p_;l.setAttribute(`position`,new Q(s,3)),l.setAttribute(`color`,new Q(c,3));let u=new xy({vertexColors:!0,toneMapped:!1});super(l,u),this.type=`GridHelper`}dispose(){this.geometry.dispose(),this.material.dispose()}},Aw=class extends Ny{constructor(e=10,t=16,n=8,r=64,i=4473924,a=8947848){i=new Z(i),a=new Z(a);let o=[],s=[];if(t>1)for(let n=0;n<t;n++){let r=n/t*(Math.PI*2),c=Math.sin(r)*e,l=Math.cos(r)*e;o.push(0,0,0),o.push(c,0,l);let u=n&1?i:a;s.push(u.r,u.g,u.b),s.push(u.r,u.g,u.b)}for(let t=0;t<n;t++){let c=t&1?i:a,l=e-e/n*t;for(let e=0;e<r;e++){let t=e/r*(Math.PI*2),n=Math.sin(t)*l,i=Math.cos(t)*l;o.push(n,0,i),s.push(c.r,c.g,c.b),t=(e+1)/r*(Math.PI*2),n=Math.sin(t)*l,i=Math.cos(t)*l,o.push(n,0,i),s.push(c.r,c.g,c.b)}}let c=new p_;c.setAttribute(`position`,new Q(o,3)),c.setAttribute(`color`,new Q(s,3));let l=new xy({vertexColors:!0,toneMapped:!1});super(c,l),this.type=`PolarGridHelper`}dispose(){this.geometry.dispose(),this.material.dispose()}},jw=new X,Mw=new X,Nw=new X,Pw=class extends bg{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type=`DirectionalLightHelper`,t===void 0&&(t=1);let r=new p_;r.setAttribute(`position`,new Q([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let i=new xy({fog:!1,toneMapped:!1});this.lightPlane=new ky(r,i),this.add(this.lightPlane),r=new p_,r.setAttribute(`position`,new Q([0,0,0,0,0,1],3)),this.targetLine=new ky(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),jw.setFromMatrixPosition(this.light.matrixWorld),Mw.setFromMatrixPosition(this.light.target.matrixWorld),Nw.subVectors(Mw,jw),this.lightPlane.lookAt(Mw),this.color===void 0?(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)):(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)),this.targetLine.lookAt(Mw),this.targetLine.scale.z
425=Nw.length()}},Fw=new X,Iw=new L_,Lw=class extends Ny{constructor(e){let t=new p_,n=new xy({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],a={};o(`n1`,`n2`),o(`n2`,`n4`),o(`n4`,`n3`),o(`n3`,`n1`),o(`f1`,`f2`),o(`f2`,`f4`),o(`f4`,`f3`),o(`f3`,`f1`),o(`n1`,`f1`),o(`n2`,`f2`),o(`n3`,`f3`),o(`n4`,`f4`),o(`p`,`n1`),o(`p`,`n2`),o(`p`,`n3`),o(`p`,`n4`),o(`u1`,`u2`),o(`u2`,`u3`),o(`u3`,`u1`),o(`c`,`t`),o(`p`,`c`),o(`cn1`,`cn2`),o(`cn3`,`cn4`),o(`cf1`,`cf2`),o(`cf3`,`cf4`);function o(e,t){s(e),s(t)}function s(e){r.push(0,0,0),i.push(0,0,0),a[e]===void 0&&(a[e]=[]),a[e].push(r.length/3-1)}t.setAttribute(`position`,new Q(r,3)),t.setAttribute(`color`,new Q(i,3)),super(t,n),this.type=`CameraHelper`,this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();let c=new Z(16755200),l=new Z(16711680),u=new Z(43775),d=new Z(16777215),f=new Z(3355443);this.setColors(c,l,u,d,f)}setColors(e,t,n,r,i){let a=this.geometry.getAttribute(`color`);return a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,n.r,n.g,n.b),a.setXYZ(33,n.r,n.g,n.b),a.setXYZ(34,n.r,n.g,n.b),a.setXYZ(35,n.r,n.g,n.b),a.setXYZ(36,n.r,n.g,n.b),a.setXYZ(37,n.r,n.g,n.b),a.setXYZ(38,r.r,r.g,r.b),a.setXYZ(39,r.r,r.g,r.b),a.setXYZ(40,i.r,i.g,i.b),a.setXYZ(41,i.r,i.g,i.b),a.setXYZ(42,i.r,i.g,i.b),a.setXYZ(43,i.r,i.g,i.b),a.setXYZ(44,i.r,i.g,i.b),a.setXYZ(45,i.r,i.g,i.b),a.setXYZ(46,i.r,i.g,i.b),a.setXYZ(47,i.r,i.g,i.b),a.setXYZ(48,i.r,i.g,i.b),a.setXYZ(49,i.r,i.g,i.b),a.needsUpdate=!0,this}update(){let e=this.geometry,t=this.pointMap,n,r;if(Iw.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)n=1,r=0;else if(this.camera.coordinateSystem===2e3)n=-1,r=1;else if(this.camera.coordinateSystem===2001)n=0,r=1;else throw Error(`THREE.CameraHelper.update(): Invalid coordinate system: `+this.camera.coordinateSystem);Rw(`c`,t,e,Iw,0,0,n),Rw(`t`,t,e,Iw,0,0,r),Rw(`n1`,t,e,Iw,-1,-1,n),Rw(`n2`,t,e,Iw,1,-1,n),Rw(`n3`,t,e,Iw,-1,1,n),Rw(`n4`,t,e,Iw,1,1,n),Rw(`f1`,t,e,Iw,-1,-1,r),Rw(`f2`,t,e,Iw,1,-1,r),Rw(`f3`,t,e,Iw,-1,1,r),Rw(`f4`,t,e,Iw,1,1,r),Rw(`u1`,t,e,Iw,1*.7,1*1.1,n),Rw(`u2`,t,e,Iw,-1*.7,1*1.1,n),Rw(`u3`,t,e,Iw,0,2,n),Rw(`cf1`,t,e,Iw,-1,0,r),Rw(`cf2`,t,e,Iw,1,0,r),Rw(`cf3`,t,e,Iw,0,-1,r),Rw(`cf4`,t,e,Iw,0,1,r),Rw(`cn1`,t,e,Iw,-1,0,n),Rw(`cn2`,t,e,Iw,1,0,n),Rw(`cn3`,t,e,Iw,0,-1,n),Rw(`cn4`,t,e,Iw,0,1,n),e.getAttribute(`position`).needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function Rw(e,t,n,r,i,a,o){Fw.set(i,a,o).unproject(r);let s=t[e];if(s!==void 0){let e=n.getAttribute(`position`);for(let t=0,n=s.length;t<n;t++)e.setXYZ(s[t],Fw.x,Fw.y,Fw.z)}}var zw=new bh,Bw=class extends Ny{constructor(e,t=16776960){let n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new p_;i.setIndex(new Zg(n,1)),i.setAttribute(`position`,new Zg(r,3)),super(i,new xy({color:t,toneMapped:!1})),this.object=e,this.type=`BoxHelper`,this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&zw.setFromObject(this.object),zw.isEmpty())return;let e=zw.min,t=zw.max,n=this.geometry.attributes.position,r=n.array;r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=t.y,r[5]=t.z,r[6]=e.x,r[7]=e.y,r[8]=t.z,r[9]=t.x,r[10]=e.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=e.z,r[15]=e.x,r[16]=t.y,r[17]=e.z,r[18]=e.x,r[19]=e.
vendor: 10,377 bytes, line 425
425y,r[20]=e.z,r[21]=t.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Vw=class extends Ny{constructor(e,t=16776960){let n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],i=new p_;i.setIndex(new Zg(n,1)),i.setAttribute(`position`,new Q(r,3)),super(i,new xy({color:t,toneMapped:!1})),this.box=e,this.type=`Box3Helper`,this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}},Hw=class extends ky{constructor(e,t=1,n=16776960){let r=n,i=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],a=new p_;a.setAttribute(`position`,new Q(i,3)),a.computeBoundingSphere(),super(a,new xy({color:r,toneMapped:!1})),this.type=`PlaneHelper`,this.plane=e,this.size=t;let o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],s=new p_;s.setAttribute(`position`,new Q(o,3)),s.computeBoundingSphere(),this.add(new T_(s,new Hg({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},Uw=new X,Ww,Gw,Kw=class extends bg{constructor(e=new X(0,0,1),t=new X(0,0,0),n=1,r=16776960,i=n*.2,a=i*.2){super(),this.type=`ArrowHelper`,Ww===void 0&&(Ww=new p_,Ww.setAttribute(`position`,new Q([0,0,0,0,1,0],3)),Gw=new tb(.5,1,5,1),Gw.translate(0,-.5,0)),this.position.copy(t),this.line=new ky(Ww,new xy({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new T_(Gw,new Hg({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Uw.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Uw,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},qw=class extends Ny{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new p_;r.setAttribute(`position`,new Q(t,3)),r.setAttribute(`color`,new Q(n,3));let i=new xy({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new Z,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Jw=class{constructor(){this.type=`ShapePath`,this.color=new Z,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Lb,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=new Rb;i.curves=r.curves,t.push(i)}return t}function n(e,t){let n=t.length,r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=t[i],o=t[a],s=o.x-n.x,c=o.y-n.y;if(Math.abs(c)>2**-52){if(c<0&&(n=t[a],s=-s,o=t[i],c=-c),e.y<n.y||e.y>o.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=c*(e.x-n.x)-s*(e.y-n.y);if(t===0)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}let r=yx.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,o,s,c=[];if(i.length===1)return o=i[0],s=new Rb,s.curves=o.curves,c.push(s),c;let l=!r(i[0].getPoints());l=e?!l:l;let u=[],d=[],f=[],p=0,m;d[p]=void 0,f[p]=[];for(let t=0,n=i.length;t<n;t++)o=i[t],m=o.getPoints(),a=r(m),a=e?!a:a,a?(!l&&d[p]&&p++,d[p]={s:new Rb,p:m},d[p].s.curves=o.curves,l&&p++,f[p]=[]):f[p].push({h:o,p:m[0]});if(!d[0])return t(i);if(d.length>1){let e=!1,t=0;for(let e=0,t=d.length;e<t;e++)u[e]=[];for(let r=0,i=d.length;r<i;r++){let i=f[r];for(let a=0;a<i.length;a++){let o=i[a],s=!0;for(let i=0;i<d.length;i++)n(o.p,d[i].p)&&(r!==i&&t++,s?(s=!1,u[i].push(o)):e=!0);s&&u[r].push(o)}}t>0&&e===!1&&(f=u)}let h;for(let e=0,t=d.length;e<t;e++){s=d[e].s,c.push(s),h=f[e];for(let e=0,t=h.length;e<t;e++)s.holes.push(h[e].h)}return c}},Yw=class extends bm{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){J(`Controls: connect() now requires an element.`);return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}};function Xw(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}function Zw(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}function Qw(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}function $w(e,t,n,r){let i=eT(r);switch(n){case Ef:return e*t;case jf:return e*t/i.components*i.byteLength;case Mf:return e*t/i.components*i.byteLength;case Nf:return e*t*2/i.components*i.byteLength;case Pf:return e*t*2/i.components*i.byteLength;case Df:return e*t*3/i.components*i.byteLength;case Of:return e*t*4/i.components*i.byteLength;case If:return e*t*4/i.components*i.byteLength;case Lf:case Rf:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case zf:case Bf:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Hf:case Wf:return Math.max(e,16)*Math.max(t,8)/4;case Vf:case Uf:return Math.max(e,8)*Math.max(t,8)/2;case Gf:case Kf:case Jf:case Yf:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case qf:case Xf:case Zf:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Qf:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case $f:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case ep:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case tp:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case np:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case rp:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case ip:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case ap:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case op:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case sp:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case cp:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case lp:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case up:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case dp:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case fp:case pp:case mp:return Math.ceil(e/4)*Math.ceil(t/4)*16;case hp:case gp:return Math.ceil(e/4)*Math.ceil(t/4)*8;case _p:case vp:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function eT(e){switch(e){case pf:case mf:return{byteLength:1,components:1};case gf:case hf:case bf:return{byteLength:2,components:1};case xf:case Sf:return{byteLength:2,components:4};case vf:case _f:case yf:return{byteLength:4,components:1};case wf:case Tf:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${e}.`)}var tT=class{static contain(e,t){return Xw(e,t)}static cover(e,t){return Zw(e,t)}static fill(e){return Qw(e)}static getByteLength(e,t,n,r){return $w(e,t,n,r)}};typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`182`}})),typeof window<`u`&&(window.__THREE__?J(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`182`);var nT=c({ACESFilmicToneMapping:()=>4,AddEquation:()=>100,AddOperation:()=>2,AdditiveAnimationBlendMode:()=>kp,AdditiveBlending:()=>2,AgXToneMapping:()=>6,AlphaFormat:()=>Ef,AlwaysCompare:()=>519,AlwaysDepth:()=>1,AlwaysStencilFunc:()=>519,AmbientLight:()=>qS,AnimationAction:()=>UC,AnimationClip:()=>_S,AnimationLoader:()=>DS,AnimationMixer:()=>GC,AnimationObjectGroup:()=>HC,AnimationUtils:()=>iS,ArcCurve:()=>db,ArrayCamera:()=>mC,ArrowHelper:()=>Kw,AttachedBindMode:()=>Zd,Audio:()=>SC,AudioAnalyser:()=>OC,AudioContext:()=>cC,AudioListener:()=>xC,AudioLoader:()=>lC,AxesHelper:()=>qw,BackSide:()=>1,BasicDepthPacking:()=>Ap,BasicShadowMap:()=>0,BatchedMesh:()=>by,Bone:()=>jv,BooleanKeyframeTrack:()=>uS,Box2:()=>cw,Box3:()=>bh,Box3Helper:()=>Vw,BoxGeometry:()=>O_,BoxHelper:()=>Bw,BufferAttribute:()=>Zg,BufferGeometry:()=>p_,BufferGeometryLoader:()=>eC,ByteType:()=>mf,Cache:()=>bS,Camera:()=>L_,CameraHelper:()=>Lw,CanvasTexture:()=>Jy,CapsuleGeometry:()=>Qy,CatmullRomCurve3:()=>_b,CineonToneMapping:()=>3,CircleGeometry:()=>$y,ClampToEdgeWrapping:()=>ef,Clock:()=>hC,Color:()=>Z,ColorKeyframeTrack:()=>dS,ColorManagement:()=>nh,CompressedArrayTexture:()=>Ky,CompressedCubeTexture:()=>qy,CompressedTexture:()=>Gy,CompressedTextureLoader:()=>OS,ConeGeometry:()=>tb,ConstantAlphaFactor:()=>213,ConstantColorFactor:()=>211,Controls:()=>Yw,CubeCamera:()=>W_,CubeDepthTexture:()=>Xy,CubeReflectionMapping:()=>301,CubeRefractionMapping:()=>302,CubeTexture:()=>G_,CubeTextureLoader:()=>jS,CubeUVReflectionMapping:()=>306,CubicBezierCurve:()=>Ob,CubicBezierCurve3:()=>kb,CubicInterpolant:()=>
425oS,CullFaceBack:()=>1,CullFaceFront:()=>2,CullFaceFrontBack:()=>3,CullFaceNone:()=>0,Curve:()=>lb,CurvePath:()=>Ib,CustomBlending:()=>5,CustomToneMapping:()=>5,CylinderGeometry:()=>eb,Cylindrical:()=>aw,Data3DTexture:()=>vh,DataArrayTexture:()=>gh,DataTexture:()=>Mv,DataTextureLoader:()=>MS,DataUtils:()=>qg,DecrementStencilOp:()=>Vp,DecrementWrapStencilOp:()=>Up,DefaultLoadingManager:()=>SS,DepthFormat:()=>kf,DepthStencilFormat:()=>Af,DepthTexture:()=>Yy,DetachedBindMode:()=>Qd,DirectionalLight:()=>KS,DirectionalLightHelper:()=>Pw,DiscreteInterpolant:()=>cS,DodecahedronGeometry:()=>rb,DoubleSide:()=>2,DstAlphaFactor:()=>206,DstColorFactor:()=>208,DynamicCopyUsage:()=>Qp,DynamicDrawUsage:()=>Kp,DynamicReadUsage:()=>Yp,EdgesGeometry:()=>cb,EllipseCurve:()=>ub,EqualCompare:()=>514,EqualDepth:()=>4,EqualStencilFunc:()=>514,EquirectangularReflectionMapping:()=>303,EquirectangularRefractionMapping:()=>304,Euler:()=>rg,EventDispatcher:()=>bm,ExternalTexture:()=>Zy,ExtrudeGeometry:()=>Sx,FileLoader:()=>ES,Float16BufferAttribute:()=>a_,Float32BufferAttribute:()=>Q,FloatType:()=>yf,Fog:()=>Z_,FogExp2:()=>X_,FramebufferTexture:()=>Wy,FrontSide:()=>0,Frustum:()=>Qv,FrustumArray:()=>ty,GLBufferAttribute:()=>ZC,GLSL1:()=>`100`,GLSL3:()=>em,GreaterCompare:()=>516,GreaterDepth:()=>6,GreaterEqualCompare:()=>518,GreaterEqualDepth:()=>5,GreaterEqualStencilFunc:()=>518,GreaterStencilFunc:()=>516,GridHelper:()=>kw,Group:()=>q_,HalfFloatType:()=>bf,HemisphereLight:()=>FS,HemisphereLightHelper:()=>Ow,IcosahedronGeometry:()=>Tx,ImageBitmapLoader:()=>oC,ImageLoader:()=>AS,ImageUtils:()=>oh,IncrementStencilOp:()=>Bp,IncrementWrapStencilOp:()=>Hp,InstancedBufferAttribute:()=>Iv,InstancedBufferGeometry:()=>$S,InstancedInterleavedBuffer:()=>XC,InstancedMesh:()=>Wv,Int16BufferAttribute:()=>t_,Int32BufferAttribute:()=>r_,Int8BufferAttribute:()=>Qg,IntType:()=>_f,InterleavedBuffer:()=>$_,InterleavedBufferAttribute:()=>tv,Interpolant:()=>aS,InterpolateDiscrete:()=>Sp,InterpolateLinear:()=>Cp,InterpolateSmooth:()=>wp,InterpolationSamplingMode:()=>am,InterpolationSamplingType:()=>im,InvertStencilOp:()=>Wp,KeepStencilOp:()=>Rp,KeyframeTrack:()=>lS,LOD:()=>bv,LatheGeometry:()=>Ex,Layers:()=>ig,LessCompare:()=>513,LessDepth:()=>2,LessEqualCompare:()=>515,LessEqualDepth:()=>3,LessEqualStencilFunc:()=>515,LessStencilFunc:()=>513,Light:()=>PS,LightProbe:()=>XS,Line:()=>ky,Line3:()=>gw,LineBasicMaterial:()=>xy,LineCurve:()=>Ab,LineCurve3:()=>jb,LineDashedMaterial:()=>Zx,LineLoop:()=>Py,LineSegments:()=>Ny,LinearFilter:()=>cf,LinearInterpolant:()=>sS,LinearMipMapLinearFilter:()=>ff,LinearMipMapNearestFilter:()=>uf,LinearMipmapLinearFilter:()=>df,LinearMipmapNearestFilter:()=>lf,LinearSRGBColorSpace:()=>Fp,LinearToneMapping:()=>1,LinearTransfer:()=>Ip,Loader:()=>CS,LoaderUtils:()=>QS,LoadingManager:()=>xS,LoopOnce:()=>yp,LoopPingPong:()=>xp,LoopRepeat:()=>bp,MOUSE:()=>Yd,Material:()=>Vg,MaterialLoader:()=>ZS,MathUtils:()=>qm,Matrix2:()=>ow,Matrix3:()=>Zm,Matrix4:()=>qh,MaxEquation:()=>104,Mesh:()=>T_,MeshBasicMaterial:()=>Hg,MeshDepthMaterial:()=>Jx,MeshDistanceMaterial:()=>Yx,MeshLambertMaterial:()=>qx,MeshMatcapMaterial:()=>Xx,MeshNormalMaterial:()=>Kx,MeshPhongMaterial:()=>Wx,MeshPhysicalMaterial:()=>Ux,MeshStandardMaterial:()=>Hx,MeshToonMaterial:()=>Gx,MinEquation:()=>103,MirroredRepeatWrapping:()=>tf,MixOperation:()=>1,MultiplyBlending:()=>4,MultiplyOperation:()=>0,NearestFilter:()=>nf,NearestMipMapLinearFilter:()=>sf,NearestMipMapNearestFilter:()=>af,NearestMipmapLinearFilter:()=>of,NearestMipmapNearestFilter:()=>rf,NeutralToneMapping:()=>7,NeverCompare:()=>512,NeverDepth:()=>0,NeverStencilFunc:()=>512,NoBlending:()=>0,NoColorSpace:()=>``,NoNormalPacking:()=>``,NoToneMapping:()=>0,NormalAnimationBlendMode:()=>Op,NormalBlending:()=>1,NormalGAPacking:()=>`ga`,NormalRGPacking:()=>`rg`,NotEqualCompare:()=>517,NotEqualDepth:()=>7,NotEqualStencilFunc:()=>517,NumberKeyframeTrack:()=>fS,Object3D:()=>bg,ObjectLoader:()=>tC,ObjectSpaceNormalMap:()=>1,OctahedronGeometry:()=>Dx,OneFactor:()=>201,OneMinusConstantAlphaFactor:()=>214,OneMinusConstantColorFactor:()=>212,OneMinusDstAlphaFactor:()=>207,OneMinusDstColorFactor:()=>209,OneMinusSrcAlphaFactor:()=>205,OneMinusSrcColorFactor:()=>
425203,OrthographicCamera:()=>WS,PCFShadowMap:()=>1,PCFSoftShadowMap:()=>2,PMREMGenerator:()=>DT,Path:()=>Lb,PerspectiveCamera:()=>V_,Plane:()=>Jv,PlaneGeometry:()=>Ox,PlaneHelper:()=>Hw,PointLight:()=>US,PointLightHelper:()=>ww,Points:()=>By,PointsMaterial:()=>Fy,PolarGridHelper:()=>Aw,PolyhedronGeometry:()=>nb,PositionalAudio:()=>DC,PropertyBinding:()=>VC,PropertyMixer:()=>kC,QuadraticBezierCurve:()=>Mb,QuadraticBezierCurve3:()=>Nb,Quaternion:()=>Jm,QuaternionKeyframeTrack:()=>mS,QuaternionLinearInterpolant:()=>pS,R11_EAC_Format:()=>Jf,RED_GREEN_RGTC2_Format:()=>_p,RED_RGTC1_Format:()=>hp,REVISION:()=>`182`,RG11_EAC_Format:()=>Xf,RGBADepthPacking:()=>jp,RGBAFormat:()=>Of,RGBAIntegerFormat:()=>If,RGBA_ASTC_10x10_Format:()=>lp,RGBA_ASTC_10x5_Format:()=>op,RGBA_ASTC_10x6_Format:()=>sp,RGBA_ASTC_10x8_Format:()=>cp,RGBA_ASTC_12x10_Format:()=>up,RGBA_ASTC_12x12_Format:()=>dp,RGBA_ASTC_4x4_Format:()=>Qf,RGBA_ASTC_5x4_Format:()=>$f,RGBA_ASTC_5x5_Format:()=>ep,RGBA_ASTC_6x5_Format:()=>tp,RGBA_ASTC_6x6_Format:()=>np,RGBA_ASTC_8x5_Format:()=>rp,RGBA_ASTC_8x6_Format:()=>ip,RGBA_ASTC_8x8_Format:()=>ap,RGBA_BPTC_Format:()=>fp,RGBA_ETC2_EAC_Format:()=>qf,RGBA_PVRTC_2BPPV1_Format:()=>Wf,RGBA_PVRTC_4BPPV1_Format:()=>Uf,RGBA_S3TC_DXT1_Format:()=>Rf,RGBA_S3TC_DXT3_Format:()=>zf,RGBA_S3TC_DXT5_Format:()=>Bf,RGBDepthPacking:()=>Mp,RGBFormat:()=>Df,RGBIntegerFormat:()=>Ff,RGB_BPTC_SIGNED_Format:()=>pp,RGB_BPTC_UNSIGNED_Format:()=>mp,RGB_ETC1_Format:()=>Gf,RGB_ETC2_Format:()=>Kf,RGB_PVRTC_2BPPV1_Format:()=>Hf,RGB_PVRTC_4BPPV1_Format:()=>Vf,RGB_S3TC_DXT1_Format:()=>Lf,RGDepthPacking:()=>Np,RGFormat:()=>Nf,RGIntegerFormat:()=>Pf,RawShaderMaterial:()=>Vx,Ray:()=>Kh,Raycaster:()=>$C,RectAreaLight:()=>JS,RedFormat:()=>jf,RedIntegerFormat:()=>Mf,ReinhardToneMapping:()=>2,RenderTarget:()=>mh,RenderTarget3D:()=>KC,RepeatWrapping:()=>$d,ReplaceStencilOp:()=>zp,ReverseSubtractEquation:()=>102,RingGeometry:()=>kx,SIGNED_R11_EAC_Format:()=>Yf,SIGNED_RED_GREEN_RGTC2_Format:()=>vp,SIGNED_RED_RGTC1_Format:()=>gp,SIGNED_RG11_EAC_Format:()=>Zf,SRGBColorSpace:()=>Pp,SRGBTransfer:()=>Lp,Scene:()=>Q_,ShaderChunk:()=>aT,ShaderLib:()=>oT,ShaderMaterial:()=>I_,ShadowMaterial:()=>Bx,Shape:()=>Rb,ShapeGeometry:()=>Ax,ShapePath:()=>Jw,ShapeUtils:()=>yx,ShortType:()=>hf,Skeleton:()=>Fv,SkeletonHelper:()=>Sw,SkinnedMesh:()=>Av,Source:()=>ch,Sphere:()=>Rh,SphereGeometry:()=>Mx,Spherical:()=>iw,SphericalHarmonics3:()=>YS,SplineCurve:()=>Pb,SpotLight:()=>VS,SpotLightHelper:()=>vw,Sprite:()=>gv,SpriteMaterial:()=>nv,SrcAlphaFactor:()=>204,SrcAlphaSaturateFactor:()=>210,SrcColorFactor:()=>202,StaticCopyUsage:()=>Zp,StaticDrawUsage:()=>Gp,StaticReadUsage:()=>Jp,StereoCamera:()=>pC,StreamCopyUsage:()=>$p,StreamDrawUsage:()=>qp,StreamReadUsage:()=>Xp,StringKeyframeTrack:()=>hS,SubtractEquation:()=>101,SubtractiveBlending:()=>3,TOUCH:()=>Xd,TangentSpaceNormalMap:()=>0,TetrahedronGeometry:()=>Nx,Texture:()=>fh,TextureLoader:()=>NS,TextureUtils:()=>tT,Timer:()=>nw,TimestampQuery:()=>rm,TorusGeometry:()=>Px,TorusKnotGeometry:()=>Fx,Triangle:()=>Pg,TriangleFanDrawMode:()=>2,TriangleStripDrawMode:()=>1,TrianglesDrawMode:()=>0,TubeGeometry:()=>Ix,UVMapping:()=>300,Uint16BufferAttribute:()=>n_,Uint32BufferAttribute:()=>i_,Uint8BufferAttribute:()=>$g,Uint8ClampedBufferAttribute:()=>e_,Uniform:()=>qC,UniformsGroup:()=>YC,UniformsLib:()=>$,UniformsUtils:()=>N_,UnsignedByteType:()=>pf,UnsignedInt101111Type:()=>Tf,UnsignedInt248Type:()=>Cf,UnsignedInt5999Type:()=>wf,UnsignedIntType:()=>vf,UnsignedShort4444Type:()=>xf,UnsignedShort5551Type:()=>Sf,UnsignedShortType:()=>gf,VSMShadowMap:()=>3,Vector2:()=>Y,Vector3:()=>X,Vector4:()=>ph,VectorKeyframeTrack:()=>gS,VideoFrameTexture:()=>Uy,VideoTexture:()=>Hy,WebGL3DRenderTarget:()=>yh,WebGLArrayRenderTarget:()=>_h,WebGLCoordinateSystem:()=>tm,WebGLCubeRenderTarget:()=>K_,WebGLRenderTarget:()=>hh,WebGLRenderer:()=>yO,WebGLUtils:()=>sO,WebGPUCoordinateSystem:()=>nm,WebXRController:()=>Y_,WireframeGeometry:()=>Lx,WrapAroundEnding:()=>Dp,ZeroCurvatureEnding:()=>Tp,ZeroFactor:()=>200,ZeroSlopeEnding:()=>Ep,ZeroStencilOp:()=>0,createCanvasElement:()=>dm,error:()=>_m,getConsoleFunction:()=>hm,log:()=>gm,setConsoleFunction:()=>mm,warn:()=>J,warnOnce:()=>vm});function rT(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function iT(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>
vendor: 1,078 bytes, line 425
425e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function i(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function a(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function o(e,i){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let a=t.get(e);if(a===void 0)t.set(e,n(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);r(a.buffer,e,i),a.version=e.version}}return{get:i,remove:a,update:o}}var aT
vendor: 6,590 bytes, lines 425-584
425={alphahash_fragment:`#ifdef USE_ALPHAHASH 426 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 427#endif`,alphahash_pars_fragment:`#ifdef USE_ALPHAHASH 428 const float ALPHA_HASH_SCALE = 0.05; 429 float hash2D( vec2 value ) { 430 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 431 } 432 float hash3D( vec3 value ) { 433 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 434 } 435 float getAlphaHashThreshold( vec3 position ) { 436 float maxDeriv = max( 437 length( dFdx( position.xyz ) ), 438 length( dFdy( position.xyz ) ) 439 ); 440 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 441 vec2 pixScales = vec2( 442 exp2( floor( log2( pixScale ) ) ), 443 exp2( ceil( log2( pixScale ) ) ) 444 ); 445 vec2 alpha = vec2( 446 hash3D( floor( pixScales.x * position.xyz ) ), 447 hash3D( floor( pixScales.y * position.xyz ) ) 448 ); 449 float lerpFactor = fract( log2( pixScale ) ); 450 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 451 float a = min( lerpFactor, 1.0 - lerpFactor ); 452 vec3 cases = vec3( 453 x * x / ( 2.0 * a * ( 1.0 - a ) ), 454 ( x - 0.5 * a ) / ( 1.0 - a ), 455 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 456 ); 457 float threshold = ( x < ( 1.0 - a ) ) 458 ? ( ( x < a ) ? cases.x : cases.y ) 459 : cases.z; 460 return clamp( threshold , 1.0e-6, 1.0 ); 461 } 462#endif`,alphamap_fragment:`#ifdef USE_ALPHAMAP 463 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 464#endif`,alphamap_pars_fragment:`#ifdef USE_ALPHAMAP 465 uniform sampler2D alphaMap; 466#endif`,alphatest_fragment:`#ifdef USE_ALPHATEST 467 #ifdef ALPHA_TO_COVERAGE 468 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 469 if ( diffuseColor.a == 0.0 ) discard; 470 #else 471 if ( diffuseColor.a < alphaTest ) discard; 472 #endif 473#endif`,alphatest_pars_fragment:`#ifdef USE_ALPHATEST 474 uniform float alphaTest; 475#endif`,aomap_fragment:`#ifdef USE_AOMAP 476 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 477 reflectedLight.indirectDiffuse *= ambientOcclusion; 478 #if defined( USE_CLEARCOAT ) 479 clearcoatSpecularIndirect *= ambientOcclusion; 480 #endif 481 #if defined( USE_SHEEN ) 482 sheenSpecularIndirect *= ambientOcclusion; 483 #endif 484 #if defined( USE_ENVMAP ) && defined( STANDARD ) 485 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 486 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 487 #endif 488#endif`,aomap_pars_fragment:`#ifdef USE_AOMAP 489 uniform sampler2D aoMap; 490 uniform float aoMapIntensity; 491#endif`,batching_pars_vertex:`#ifdef USE_BATCHING 492 #if ! defined( GL_ANGLE_multi_draw ) 493 #define gl_DrawID _gl_DrawID 494 uniform int _gl_DrawID; 495 #endif 496 uniform highp sampler2D batchingTexture; 497 uniform highp usampler2D batchingIdTexture; 498 mat4 getBatchingMatrix( const in float i ) { 499 int size = textureSize( batchingTexture, 0 ).x; 500 int j = int( i ) * 4; 501 int x = j % size; 502 int y = j / size; 503 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 504 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 505 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 506 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 507 return mat4( v1, v2, v3, v4 ); 508 } 509 float getIndirectIndex( const in int i ) { 510 int size = textureSize( batchingIdTexture, 0 ).x; 511 int x = i % size; 512 int y = i / size; 513 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 514 } 515#endif 516#ifdef USE_BATCHING_COLOR 517 uniform sampler2D batchingColorTexture; 518 vec3 getBatchingColor( const in float i ) { 519 int size = textureSize( batchingColorTexture, 0 ).x; 520 int j = int( i ); 521 int x = j % size; 522 int y = j / size; 523 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb; 524 } 525#endif`,batching_vertex:`#ifdef USE_BATCHING 526 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 527#endif`,begin_vertex:`vec3 transformed = vec3( position ); 528#ifdef USE_ALPHAHASH 529 vPosition = vec3( position ); 530#endif`,beginnormal_vertex:`vec3 objectNormal = vec3( normal ); 531#ifdef USE_TANGENT 532 vec3 objectTangent = vec3( tangent.xyz ); 533#endif`,bsdfs:`float G_BlinnPhong_Implicit( ) { 534 return 0.25; 535} 536float D_BlinnPhong( const in float shininess, const in float dotNH ) { 537 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 538} 539vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 540 vec3 halfDir = normalize( lightDir + viewDir ); 541 float dotNH = saturate( dot( normal, halfDir ) ); 542 float dotVH = saturate( dot( viewDir, halfDir ) ); 543 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 544 float G = G_BlinnPhong_Implicit( ); 545 float D = D_BlinnPhong( shininess, dotNH ); 546 return F * ( G * D ); 547} // validated`,iridescence_fragment:`#ifdef USE_IRIDESCENCE 548 const mat3 XYZ_TO_REC709 = mat3( 549 3.2404542, -0.9692660, 0.0556434, 550 -1.5371385, 1.8760108, -0.2040259, 551 -0.4985314, 0.0415560, 1.0572252 552 ); 553 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 554 vec3 sqrtF0 = sqrt( fresnel0 ); 555 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 556 } 557 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 558 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 559 } 560 float IorToFresnel0( float transmittedIor, float incidentIor ) { 561 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 562 } 563 vec3 evalSensitivity( float OPD, vec3 shift ) { 564 float phase = 2.0 * PI * OPD * 1.0e-9; 565 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 566 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 567 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 568 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 569 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 570 xyz /= 1.0685e-7; 571 vec3 rgb = XYZ_TO_REC709 * xyz; 572 return rgb; 573 } 574 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 575 vec3 I; 576 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 577 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 578 float cosTheta2Sq = 1.0 - sinTheta2Sq; 579 if ( cosTheta2Sq < 0.0 ) { 580 return vec3( 1.0 ); 581 } 582 float cosTheta2 = sqrt( cosTheta2Sq ); 583 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 584 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
vendor: 6,671 bytes, lines 585-766
585 float T121 = 1.0 - R12; 586 float phi12 = 0.0; 587 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 588 float phi21 = PI - phi12; 589 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 590 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 591 vec3 phi23 = vec3( 0.0 ); 592 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 593 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 594 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 595 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 596 vec3 phi = vec3( phi21 ) + phi23; 597 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 598 vec3 r123 = sqrt( R123 ); 599 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 600 vec3 C0 = R12 + Rs; 601 I = C0; 602 vec3 Cm = Rs - T121; 603 for ( int m = 1; m <= 2; ++ m ) { 604 Cm *= r123; 605 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 606 I += Cm * Sm; 607 } 608 return max( I, vec3( 0.0 ) ); 609 } 610#endif`,bumpmap_pars_fragment:`#ifdef USE_BUMPMAP 611 uniform sampler2D bumpMap; 612 uniform float bumpScale; 613 vec2 dHdxy_fwd() { 614 vec2 dSTdx = dFdx( vBumpMapUv ); 615 vec2 dSTdy = dFdy( vBumpMapUv ); 616 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 617 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 618 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 619 return vec2( dBx, dBy ); 620 } 621 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 622 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 623 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 624 vec3 vN = surf_norm; 625 vec3 R1 = cross( vSigmaY, vN ); 626 vec3 R2 = cross( vN, vSigmaX ); 627 float fDet = dot( vSigmaX, R1 ) * faceDirection; 628 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 629 return normalize( abs( fDet ) * surf_norm - vGrad ); 630 } 631#endif`,clipping_planes_fragment:`#if NUM_CLIPPING_PLANES > 0 632 vec4 plane; 633 #ifdef ALPHA_TO_COVERAGE 634 float distanceToPlane, distanceGradient; 635 float clipOpacity = 1.0; 636 #pragma unroll_loop_start 637 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 638 plane = clippingPlanes[ i ]; 639 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 640 distanceGradient = fwidth( distanceToPlane ) / 2.0; 641 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 642 if ( clipOpacity == 0.0 ) discard; 643 } 644 #pragma unroll_loop_end 645 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 646 float unionClipOpacity = 1.0; 647 #pragma unroll_loop_start 648 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 649 plane = clippingPlanes[ i ]; 650 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 651 distanceGradient = fwidth( distanceToPlane ) / 2.0; 652 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 653 } 654 #pragma unroll_loop_end 655 clipOpacity *= 1.0 - unionClipOpacity; 656 #endif 657 diffuseColor.a *= clipOpacity; 658 if ( diffuseColor.a == 0.0 ) discard; 659 #else 660 #pragma unroll_loop_start 661 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 662 plane = clippingPlanes[ i ]; 663 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 664 } 665 #pragma unroll_loop_end 666 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 667 bool clipped = true; 668 #pragma unroll_loop_start 669 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 670 plane = clippingPlanes[ i ]; 671 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 672 } 673 #pragma unroll_loop_end 674 if ( clipped ) discard; 675 #endif 676 #endif 677#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0 678 varying vec3 vClipPosition; 679 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 680#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0 681 varying vec3 vClipPosition; 682#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0 683 vClipPosition = - mvPosition.xyz; 684#endif`,color_fragment:`#if defined( USE_COLOR_ALPHA ) 685 diffuseColor *= vColor; 686#elif defined( USE_COLOR ) 687 diffuseColor.rgb *= vColor; 688#endif`,color_pars_fragment:`#if defined( USE_COLOR_ALPHA ) 689 varying vec4 vColor; 690#elif defined( USE_COLOR ) 691 varying vec3 vColor; 692#endif`,color_pars_vertex:`#if defined( USE_COLOR_ALPHA ) 693 varying vec4 vColor; 694#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 695 varying vec3 vColor; 696#endif`,color_vertex:`#if defined( USE_COLOR_ALPHA ) 697 vColor = vec4( 1.0 ); 698#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 699 vColor = vec3( 1.0 ); 700#endif 701#ifdef USE_COLOR 702 vColor *= color; 703#endif 704#ifdef USE_INSTANCING_COLOR 705 vColor.xyz *= instanceColor.xyz; 706#endif 707#ifdef USE_BATCHING_COLOR 708 vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); 709 vColor.xyz *= batchingColor.xyz; 710#endif`,common:`#define PI 3.141592653589793 711#define PI2 6.283185307179586 712#define PI_HALF 1.5707963267948966 713#define RECIPROCAL_PI 0.3183098861837907 714#define RECIPROCAL_PI2 0.15915494309189535 715#define EPSILON 1e-6 716#ifndef saturate 717#define saturate( a ) clamp( a, 0.0, 1.0 ) 718#endif 719#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 720float pow2( const in float x ) { return x*x; } 721vec3 pow2( const in vec3 x ) { return x*x; } 722float pow3( const in float x ) { return x*x*x; } 723float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 724float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 725float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 726highp float rand( const in vec2 uv ) { 727 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 728 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 729 return fract( sin( sn ) * c ); 730} 731#ifdef HIGH_PRECISION 732 float precisionSafeLength( vec3 v ) { return length( v ); } 733#else 734 float precisionSafeLength( vec3 v ) { 735 float maxComponent = max3( abs( v ) ); 736 return length( v / maxComponent ) * maxComponent; 737 } 738#endif 739struct IncidentLight { 740 vec3 color; 741 vec3 direction; 742 bool visible; 743}; 744struct ReflectedLight { 745 vec3 directDiffuse; 746 vec3 directSpecular; 747 vec3 indirectDiffuse; 748 vec3 indirectSpecular; 749}; 750#ifdef USE_ALPHAHASH 751 varying vec3 vPosition; 752#endif 753vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 754 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 755} 756vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 757 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 758} 759bool isPerspectiveMatrix( mat4 m ) { 760 return m[ 2 ][ 3 ] == - 1.0; 761} 762vec2 equirectUv( in vec3 dir ) { 763 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 764 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 765 return vec2( u, v ); 766}
vendor: 5,202 bytes, lines 767-904
767vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 768 return RECIPROCAL_PI * diffuseColor; 769} 770vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 771 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 772 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 773} 774float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 775 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 776 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 777} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV 778 #define cubeUV_minMipLevel 4.0 779 #define cubeUV_minTileSize 16.0 780 float getFace( vec3 direction ) { 781 vec3 absDirection = abs( direction ); 782 float face = - 1.0; 783 if ( absDirection.x > absDirection.z ) { 784 if ( absDirection.x > absDirection.y ) 785 face = direction.x > 0.0 ? 0.0 : 3.0; 786 else 787 face = direction.y > 0.0 ? 1.0 : 4.0; 788 } else { 789 if ( absDirection.z > absDirection.y ) 790 face = direction.z > 0.0 ? 2.0 : 5.0; 791 else 792 face = direction.y > 0.0 ? 1.0 : 4.0; 793 } 794 return face; 795 } 796 vec2 getUV( vec3 direction, float face ) { 797 vec2 uv; 798 if ( face == 0.0 ) { 799 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 800 } else if ( face == 1.0 ) { 801 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 802 } else if ( face == 2.0 ) { 803 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 804 } else if ( face == 3.0 ) { 805 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 806 } else if ( face == 4.0 ) { 807 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 808 } else { 809 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 810 } 811 return 0.5 * ( uv + 1.0 ); 812 } 813 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 814 float face = getFace( direction ); 815 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 816 mipInt = max( mipInt, cubeUV_minMipLevel ); 817 float faceSize = exp2( mipInt ); 818 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 819 if ( face > 2.0 ) { 820 uv.y += faceSize; 821 face -= 3.0; 822 } 823 uv.x += face * faceSize; 824 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 825 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 826 uv.x *= CUBEUV_TEXEL_WIDTH; 827 uv.y *= CUBEUV_TEXEL_HEIGHT; 828 #ifdef texture2DGradEXT 829 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 830 #else 831 return texture2D( envMap, uv ).rgb; 832 #endif 833 } 834 #define cubeUV_r0 1.0 835 #define cubeUV_m0 - 2.0 836 #define cubeUV_r1 0.8 837 #define cubeUV_m1 - 1.0 838 #define cubeUV_r4 0.4 839 #define cubeUV_m4 2.0 840 #define cubeUV_r5 0.305 841 #define cubeUV_m5 3.0 842 #define cubeUV_r6 0.21 843 #define cubeUV_m6 4.0 844 float roughnessToMip( float roughness ) { 845 float mip = 0.0; 846 if ( roughness >= cubeUV_r1 ) { 847 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 848 } else if ( roughness >= cubeUV_r4 ) { 849 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 850 } else if ( roughness >= cubeUV_r5 ) { 851 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 852 } else if ( roughness >= cubeUV_r6 ) { 853 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 854 } else { 855 mip = - 2.0 * log2( 1.16 * roughness ); } 856 return mip; 857 } 858 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 859 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 860 float mipF = fract( mip ); 861 float mipInt = floor( mip ); 862 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 863 if ( mipF == 0.0 ) { 864 return vec4( color0, 1.0 ); 865 } else { 866 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 867 return vec4( mix( color0, color1, mipF ), 1.0 ); 868 } 869 } 870#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal; 871#ifdef USE_TANGENT 872 vec3 transformedTangent = objectTangent; 873#endif 874#ifdef USE_BATCHING 875 mat3 bm = mat3( batchingMatrix ); 876 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 877 transformedNormal = bm * transformedNormal; 878 #ifdef USE_TANGENT 879 transformedTangent = bm * transformedTangent; 880 #endif 881#endif 882#ifdef USE_INSTANCING 883 mat3 im = mat3( instanceMatrix ); 884 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 885 transformedNormal = im * transformedNormal; 886 #ifdef USE_TANGENT 887 transformedTangent = im * transformedTangent; 888 #endif 889#endif 890transformedNormal = normalMatrix * transformedNormal; 891#ifdef FLIP_SIDED 892 transformedNormal = - transformedNormal; 893#endif 894#ifdef USE_TANGENT 895 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 896 #ifdef FLIP_SIDED 897 transformedTangent = - transformedTangent; 898 #endif 899#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP 900 uniform sampler2D displacementMap; 901 uniform float displacementScale; 902 uniform float displacementBias; 903#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP 904 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
vendor: 4,699 bytes, lines 904-1021
904placementBias ); 905#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP 906 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 907 #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE 908 emissiveColor = sRGBTransferEOTF( emissiveColor ); 909 #endif 910 totalEmissiveRadiance *= emissiveColor.rgb; 911#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP 912 uniform sampler2D emissiveMap; 913#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) { 914 return value; 915} 916vec4 sRGBTransferEOTF( in vec4 value ) { 917 return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); 918} 919vec4 sRGBTransferOETF( in vec4 value ) { 920 return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); 921}`,envmap_fragment:`#ifdef USE_ENVMAP 922 #ifdef ENV_WORLDPOS 923 vec3 cameraToFrag; 924 if ( isOrthographic ) { 925 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 926 } else { 927 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 928 } 929 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 930 #ifdef ENVMAP_MODE_REFLECTION 931 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 932 #else 933 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 934 #endif 935 #else 936 vec3 reflectVec = vReflect; 937 #endif 938 #ifdef ENVMAP_TYPE_CUBE 939 vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 940 #else 941 vec4 envColor = vec4( 0.0 ); 942 #endif 943 #ifdef ENVMAP_BLENDING_MULTIPLY 944 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 945 #elif defined( ENVMAP_BLENDING_MIX ) 946 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 947 #elif defined( ENVMAP_BLENDING_ADD ) 948 outgoingLight += envColor.xyz * specularStrength * reflectivity; 949 #endif 950#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP 951 uniform float envMapIntensity; 952 uniform float flipEnvMap; 953 uniform mat3 envMapRotation; 954 #ifdef ENVMAP_TYPE_CUBE 955 uniform samplerCube envMap; 956 #else 957 uniform sampler2D envMap; 958 #endif 959#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP 960 uniform float reflectivity; 961 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 962 #define ENV_WORLDPOS 963 #endif 964 #ifdef ENV_WORLDPOS 965 varying vec3 vWorldPosition; 966 uniform float refractionRatio; 967 #else 968 varying vec3 vReflect; 969 #endif 970#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP 971 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 972 #define ENV_WORLDPOS 973 #endif 974 #ifdef ENV_WORLDPOS 975 976 varying vec3 vWorldPosition; 977 #else 978 varying vec3 vReflect; 979 uniform float refractionRatio; 980 #endif 981#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP 982 vec3 getIBLIrradiance( const in vec3 normal ) { 983 #ifdef ENVMAP_TYPE_CUBE_UV 984 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 985 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 986 return PI * envMapColor.rgb * envMapIntensity; 987 #else 988 return vec3( 0.0 ); 989 #endif 990 } 991 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 992 #ifdef ENVMAP_TYPE_CUBE_UV 993 vec3 reflectVec = reflect( - viewDir, normal ); 994 reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); 995 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 996 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 997 return envMapColor.rgb * envMapIntensity; 998 #else 999 return vec3( 0.0 ); 1000 #endif 1001 } 1002 #ifdef USE_ANISOTROPY 1003 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 1004 #ifdef ENVMAP_TYPE_CUBE_UV 1005 vec3 bentNormal = cross( bitangent, viewDir ); 1006 bentNormal = normalize( cross( bentNormal, bitangent ) ); 1007 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 1008 return getIBLRadiance( viewDir, bentNormal, roughness ); 1009 #else 1010 return vec3( 0.0 ); 1011 #endif 1012 } 1013 #endif 1014#endif`,envmap_vertex:`#ifdef USE_ENVMAP 1015 #ifdef ENV_WORLDPOS 1016 vWorldPosition = worldPosition.xyz; 1017 #else 1018 vec3 cameraToVertex; 1019 if ( isOrthographic ) { 1020 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 1021 } else {
vendor: 5,417 bytes, lines 1022-1147
1022 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 1023 } 1024 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1025 #ifdef ENVMAP_MODE_REFLECTION 1026 vReflect = reflect( cameraToVertex, worldNormal ); 1027 #else 1028 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 1029 #endif 1030 #endif 1031#endif`,fog_vertex:`#ifdef USE_FOG 1032 vFogDepth = - mvPosition.z; 1033#endif`,fog_pars_vertex:`#ifdef USE_FOG 1034 varying float vFogDepth; 1035#endif`,fog_fragment:`#ifdef USE_FOG 1036 #ifdef FOG_EXP2 1037 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 1038 #else 1039 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 1040 #endif 1041 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 1042#endif`,fog_pars_fragment:`#ifdef USE_FOG 1043 uniform vec3 fogColor; 1044 varying float vFogDepth; 1045 #ifdef FOG_EXP2 1046 uniform float fogDensity; 1047 #else 1048 uniform float fogNear; 1049 uniform float fogFar; 1050 #endif 1051#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP 1052 uniform sampler2D gradientMap; 1053#endif 1054vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 1055 float dotNL = dot( normal, lightDirection ); 1056 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 1057 #ifdef USE_GRADIENTMAP 1058 return vec3( texture2D( gradientMap, coord ).r ); 1059 #else 1060 vec2 fw = fwidth( coord ) * 0.5; 1061 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 1062 #endif 1063}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP 1064 uniform sampler2D lightMap; 1065 uniform float lightMapIntensity; 1066#endif`,lights_lambert_fragment:`LambertMaterial material; 1067material.diffuseColor = diffuseColor.rgb; 1068material.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition; 1069struct LambertMaterial { 1070 vec3 diffuseColor; 1071 float specularStrength; 1072}; 1073void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 1074 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1075 vec3 irradiance = dotNL * directLight.color; 1076 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1077} 1078void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 1079 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1080} 1081#define RE_Direct RE_Direct_Lambert 1082#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow; 1083uniform vec3 ambientLightColor; 1084#if defined( USE_LIGHT_PROBES ) 1085 uniform vec3 lightProbe[ 9 ]; 1086#endif 1087vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 1088 float x = normal.x, y = normal.y, z = normal.z; 1089 vec3 result = shCoefficients[ 0 ] * 0.886227; 1090 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 1091 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 1092 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 1093 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 1094 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 1095 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 1096 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 1097 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 1098 return result; 1099} 1100vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 1101 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 1102 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 1103 return irradiance; 1104} 1105vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 1106 vec3 irradiance = ambientLightColor; 1107 return irradiance; 1108} 1109float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 1110 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 1111 if ( cutoffDistance > 0.0 ) { 1112 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 1113 } 1114 return distanceFalloff; 1115} 1116float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 1117 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 1118} 1119#if NUM_DIR_LIGHTS > 0 1120 struct DirectionalLight { 1121 vec3 direction; 1122 vec3 color; 1123 }; 1124 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 1125 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 1126 light.color = directionalLight.color; 1127 light.direction = directionalLight.direction; 1128 light.visible = true; 1129 } 1130#endif 1131#if NUM_POINT_LIGHTS > 0 1132 struct PointLight { 1133 vec3 position; 1134 vec3 color; 1135 float distance; 1136 float decay; 1137 }; 1138 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 1139 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 1140 vec3 lVector = pointLight.position - geometryPosition; 1141 light.direction = normalize( lVector ); 1142 float lightDistance = length( lVector ); 1143 light.color = pointLight.color; 1144 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 1145 light.visible = ( light.color != vec3( 0.0 ) ); 1146 } 1147#endif
vendor: 13,829 bytes, lines 1148-1469
1148#if NUM_SPOT_LIGHTS > 0 1149 struct SpotLight { 1150 vec3 position; 1151 vec3 direction; 1152 vec3 color; 1153 float distance; 1154 float decay; 1155 float coneCos; 1156 float penumbraCos; 1157 }; 1158 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 1159 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 1160 vec3 lVector = spotLight.position - geometryPosition; 1161 light.direction = normalize( lVector ); 1162 float angleCos = dot( light.direction, spotLight.direction ); 1163 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 1164 if ( spotAttenuation > 0.0 ) { 1165 float lightDistance = length( lVector ); 1166 light.color = spotLight.color * spotAttenuation; 1167 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 1168 light.visible = ( light.color != vec3( 0.0 ) ); 1169 } else { 1170 light.color = vec3( 0.0 ); 1171 light.visible = false; 1172 } 1173 } 1174#endif 1175#if NUM_RECT_AREA_LIGHTS > 0 1176 struct RectAreaLight { 1177 vec3 color; 1178 vec3 position; 1179 vec3 halfWidth; 1180 vec3 halfHeight; 1181 }; 1182 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 1183 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 1184#endif 1185#if NUM_HEMI_LIGHTS > 0 1186 struct HemisphereLight { 1187 vec3 direction; 1188 vec3 skyColor; 1189 vec3 groundColor; 1190 }; 1191 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 1192 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 1193 float dotNL = dot( normal, hemiLight.direction ); 1194 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 1195 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 1196 return irradiance; 1197 } 1198#endif`,lights_toon_fragment:`ToonMaterial material; 1199material.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition; 1200struct ToonMaterial { 1201 vec3 diffuseColor; 1202}; 1203void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 1204 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 1205 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1206} 1207void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 1208 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1209} 1210#define RE_Direct RE_Direct_Toon 1211#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material; 1212material.diffuseColor = diffuseColor.rgb; 1213material.specularColor = specular; 1214material.specularShininess = shininess; 1215material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition; 1216struct BlinnPhongMaterial { 1217 vec3 diffuseColor; 1218 vec3 specularColor; 1219 float specularShininess; 1220 float specularStrength; 1221}; 1222void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 1223 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1224 vec3 irradiance = dotNL * directLight.color; 1225 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1226 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 1227} 1228void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 1229 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1230} 1231#define RE_Direct RE_Direct_BlinnPhong 1232#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material; 1233material.diffuseColor = diffuseColor.rgb; 1234material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 1235material.metalness = metalnessFactor; 1236vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 1237float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 1238material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 1239material.roughness = min( material.roughness, 1.0 ); 1240#ifdef IOR 1241 material.ior = ior; 1242 #ifdef USE_SPECULAR 1243 float specularIntensityFactor = specularIntensity; 1244 vec3 specularColorFactor = specularColor; 1245 #ifdef USE_SPECULAR_COLORMAP 1246 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 1247 #endif 1248 #ifdef USE_SPECULAR_INTENSITYMAP 1249 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 1250 #endif 1251 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 1252 #else 1253 float specularIntensityFactor = 1.0; 1254 vec3 specularColorFactor = vec3( 1.0 ); 1255 material.specularF90 = 1.0; 1256 #endif 1257 material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; 1258 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 1259#else 1260 material.specularColor = vec3( 0.04 ); 1261 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 1262 material.specularF90 = 1.0; 1263#endif 1264#ifdef USE_CLEARCOAT 1265 material.clearcoat = clearcoat; 1266 material.clearcoatRoughness = clearcoatRoughness; 1267 material.clearcoatF0 = vec3( 0.04 ); 1268 material.clearcoatF90 = 1.0; 1269 #ifdef USE_CLEARCOATMAP 1270 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 1271 #endif 1272 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 1273 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 1274 #endif 1275 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 1276 material.clearcoatRoughness += geometryRoughness; 1277 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 1278#endif 1279#ifdef USE_DISPERSION 1280 material.dispersion = dispersion; 1281#endif 1282#ifdef USE_IRIDESCENCE 1283 material.iridescence = iridescence; 1284 material.iridescenceIOR = iridescenceIOR; 1285 #ifdef USE_IRIDESCENCEMAP 1286 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 1287 #endif 1288 #ifdef USE_IRIDESCENCE_THICKNESSMAP 1289 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 1290 #else 1291 material.iridescenceThickness = iridescenceThicknessMaximum; 1292 #endif 1293#endif 1294#ifdef USE_SHEEN 1295 material.sheenColor = sheenColor; 1296 #ifdef USE_SHEEN_COLORMAP 1297 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 1298 #endif 1299 material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); 1300 #ifdef USE_SHEEN_ROUGHNESSMAP 1301 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 1302 #endif 1303#endif 1304#ifdef USE_ANISOTROPY 1305 #ifdef USE_ANISOTROPYMAP 1306 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 1307 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 1308 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 1309 #else 1310 vec2 anisotropyV = anisotropyVector; 1311 #endif 1312 material.anisotropy = length( anisotropyV ); 1313 if( material.anisotropy == 0.0 ) { 1314 anisotropyV = vec2( 1.0, 0.0 ); 1315 } else { 1316 anisotropyV /= material.anisotropy; 1317 material.anisotropy = saturate( material.anisotropy ); 1318 } 1319 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); 1320 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 1321 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 1322#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT; 1323struct PhysicalMaterial { 1324 vec3 diffuseColor; 1325 vec3 diffuseContribution; 1326 vec3 specularColor; 1327 vec3 specularColorBlended; 1328 float roughness; 1329 float metalness; 1330 float specularF90; 1331 float dispersion; 1332 #ifdef USE_CLEARCOAT 1333 float clearcoat; 1334 float clearcoatRoughness; 1335 vec3 clearcoatF0; 1336 float clearcoatF90; 1337 #endif 1338 #ifdef USE_IRIDESCENCE 1339 float iridescence; 1340 float iridescenceIOR; 1341 float iridescenceThickness; 1342 vec3 iridescenceFresnel; 1343 vec3 iridescenceF0; 1344 vec3 iridescenceFresnelDielectric; 1345 vec3 iridescenceFresnelMetallic; 1346 #endif 1347 #ifdef USE_SHEEN 1348 vec3 sheenColor; 1349 float sheenRoughness; 1350 #endif 1351 #ifdef IOR 1352 float ior; 1353 #endif 1354 #ifdef USE_TRANSMISSION 1355 float transmission; 1356 float transmissionAlpha; 1357 float thickness; 1358 float attenuationDistance; 1359 vec3 attenuationColor; 1360 #endif 1361 #ifdef USE_ANISOTROPY 1362 float anisotropy; 1363 float alphaT; 1364 vec3 anisotropyT; 1365 vec3 anisotropyB; 1366 #endif 1367}; 1368vec3 clearcoatSpecularDirect = vec3( 0.0 ); 1369vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 1370vec3 sheenSpecularDirect = vec3( 0.0 ); 1371vec3 sheenSpecularIndirect = vec3(0.0 ); 1372vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 1373 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 1374 float x2 = x * x; 1375 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 1376 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 1377} 1378float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1379 float a2 = pow2( alpha ); 1380 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1381 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1382 return 0.5 / max( gv + gl, EPSILON ); 1383} 1384float D_GGX( const in float alpha, const in float dotNH ) { 1385 float a2 = pow2( alpha ); 1386 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1387 return RECIPROCAL_PI * a2 / pow2( denom ); 1388} 1389#ifdef USE_ANISOTROPY 1390 float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { 1391 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1392 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1393 float v = 0.5 / ( gv + gl ); 1394 return v; 1395 } 1396 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1397 float a2 = alphaT * alphaB; 1398 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1399 highp float v2 = dot( v, v ); 1400 float w2 = a2 / v2; 1401 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1402 } 1403#endif 1404#ifdef USE_CLEARCOAT 1405 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1406 vec3 f0 = material.clearcoatF0; 1407 float f90 = material.clearcoatF90; 1408 float roughness = material.clearcoatRoughness; 1409 float alpha = pow2( roughness ); 1410 vec3 halfDir = normalize( lightDir + viewDir ); 1411 float dotNL = saturate( dot( normal, lightDir ) ); 1412 float dotNV = saturate( dot( normal, viewDir ) ); 1413 float dotNH = saturate( dot( normal, halfDir ) ); 1414 float dotVH = saturate( dot( viewDir, halfDir ) ); 1415 vec3 F = F_Schlick( f0, f90, dotVH ); 1416 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1417 float D = D_GGX( alpha, dotNH ); 1418 return F * ( V * D ); 1419 } 1420#endif 1421vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1422 vec3 f0 = material.specularColorBlended; 1423 float f90 = material.specularF90; 1424 float roughness = material.roughness; 1425 float alpha = pow2( roughness ); 1426 vec3 halfDir = normalize( lightDir + viewDir ); 1427 float dotNL = saturate( dot( normal, lightDir ) ); 1428 float dotNV = saturate( dot( normal, viewDir ) ); 1429 float dotNH = saturate( dot( normal, halfDir ) ); 1430 float dotVH = saturate( dot( viewDir, halfDir ) ); 1431 vec3 F = F_Schlick( f0, f90, dotVH ); 1432 #ifdef USE_IRIDESCENCE 1433 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1434 #endif 1435 #ifdef USE_ANISOTROPY 1436 float dotTL = dot( material.anisotropyT, lightDir ); 1437 float dotTV = dot( material.anisotropyT, viewDir ); 1438 float dotTH = dot( material.anisotropyT, halfDir ); 1439 float dotBL = dot( material.anisotropyB, lightDir ); 1440 float dotBV = dot( material.anisotropyB, viewDir ); 1441 float dotBH = dot( material.anisotropyB, halfDir ); 1442 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1443 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1444 #else 1445 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1446 float D = D_GGX( alpha, dotNH ); 1447 #endif 1448 return F * ( V * D ); 1449} 1450vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1451 const float LUT_SIZE = 64.0; 1452 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1453 const float LUT_BIAS = 0.5 / LUT_SIZE; 1454 float dotNV = saturate( dot( N, V ) ); 1455 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1456 uv = uv * LUT_SCALE + LUT_BIAS; 1457 return uv; 1458} 1459float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1460 float l = length( f ); 1461 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1462} 1463vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1464 float x = dot( v1, v2 ); 1465 float y = abs( x ); 1466 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1467 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1468 float v = a / b; 1469 float theta_sintheta = ( x >
vendor: 9,516 bytes, lines 1469-1639
1469 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1470 return cross( v1, v2 ) * theta_sintheta; 1471} 1472vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1473 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1474 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1475 vec3 lightNormal = cross( v1, v2 ); 1476 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1477 vec3 T1, T2; 1478 T1 = normalize( V - N * dot( V, N ) ); 1479 T2 = - cross( N, T1 ); 1480 mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); 1481 vec3 coords[ 4 ]; 1482 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1483 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1484 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1485 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1486 coords[ 0 ] = normalize( coords[ 0 ] ); 1487 coords[ 1 ] = normalize( coords[ 1 ] ); 1488 coords[ 2 ] = normalize( coords[ 2 ] ); 1489 coords[ 3 ] = normalize( coords[ 3 ] ); 1490 vec3 vectorFormFactor = vec3( 0.0 ); 1491 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1492 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1493 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1494 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1495 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1496 return vec3( result ); 1497} 1498#if defined( USE_SHEEN ) 1499float D_Charlie( float roughness, float dotNH ) { 1500 float alpha = pow2( roughness ); 1501 float invAlpha = 1.0 / alpha; 1502 float cos2h = dotNH * dotNH; 1503 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1504 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1505} 1506float V_Neubelt( float dotNV, float dotNL ) { 1507 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1508} 1509vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1510 vec3 halfDir = normalize( lightDir + viewDir ); 1511 float dotNL = saturate( dot( normal, lightDir ) ); 1512 float dotNV = saturate( dot( normal, viewDir ) ); 1513 float dotNH = saturate( dot( normal, halfDir ) ); 1514 float D = D_Charlie( sheenRoughness, dotNH ); 1515 float V = V_Neubelt( dotNV, dotNL ); 1516 return sheenColor * ( D * V ); 1517} 1518#endif 1519float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1520 float dotNV = saturate( dot( normal, viewDir ) ); 1521 float r2 = roughness * roughness; 1522 float rInv = 1.0 / ( roughness + 0.1 ); 1523 float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; 1524 float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; 1525 float DG = exp( a * dotNV + b ); 1526 return saturate( DG ); 1527} 1528vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1529 float dotNV = saturate( dot( normal, viewDir ) ); 1530 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1531 return specularColor * fab.x + specularF90 * fab.y; 1532} 1533#ifdef USE_IRIDESCENCE 1534void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1535#else 1536void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1537#endif 1538 float dotNV = saturate( dot( normal, viewDir ) ); 1539 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1540 #ifdef USE_IRIDESCENCE 1541 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1542 #else 1543 vec3 Fr = specularColor; 1544 #endif 1545 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1546 float Ess = fab.x + fab.y; 1547 float Ems = 1.0 - Ess; 1548 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1549 singleScatter += FssEss; 1550 multiScatter += Fms * Ems; 1551} 1552vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1553 vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); 1554 float dotNL = saturate( dot( normal, lightDir ) ); 1555 float dotNV = saturate( dot( normal, viewDir ) ); 1556 vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; 1557 vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; 1558 vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; 1559 vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; 1560 float Ess_V = dfgV.x + dfgV.y; 1561 float Ess_L = dfgL.x + dfgL.y; 1562 float Ems_V = 1.0 - Ess_V; 1563 float Ems_L = 1.0 - Ess_L; 1564 vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; 1565 vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); 1566 float compensationFactor = Ems_V * Ems_L; 1567 vec3 multiScatter = Fms * compensationFactor; 1568 return singleScatter + multiScatter; 1569} 1570#if NUM_RECT_AREA_LIGHTS > 0 1571 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1572 vec3 normal = geometryNormal; 1573 vec3 viewDir = geometryViewDir; 1574 vec3 position = geometryPosition; 1575 vec3 lightPos = rectAreaLight.position; 1576 vec3 halfWidth = rectAreaLight.halfWidth; 1577 vec3 halfHeight = rectAreaLight.halfHeight; 1578 vec3 lightColor = rectAreaLight.color; 1579 float roughness = material.roughness; 1580 vec3 rectCoords[ 4 ]; 1581 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1582 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1583 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1584 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1585 vec4 t1 = texture2D( ltc_1, uv ); 1586 vec4 t2 = texture2D( ltc_2, uv ); 1587 mat3 mInv = mat3( 1588 vec3( t1.x, 0, t1.y ), 1589 vec3( 0, 1, 0 ), 1590 vec3( t1.z, 0, t1.w ) 1591 ); 1592 vec3 fresnel = ( material.specularColorBlended * t2.x + ( vec3( 1.0 ) - material.specularColorBlended ) * t2.y ); 1593 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1594 reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1595 } 1596#endif 1597void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1598 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1599 vec3 irradiance = dotNL * directLight.color; 1600 #ifdef USE_CLEARCOAT 1601 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1602 vec3 ccIrradiance = dotNLcc * directLight.color; 1603 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1604 #endif 1605 #ifdef USE_SHEEN 1606 1607 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1608 1609 float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1610 float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); 1611 1612 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); 1613 1614 irradiance *= sheenEnergyComp; 1615 1616 #endif 1617 reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); 1618 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); 1619} 1620void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1621 vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); 1622 #ifdef USE_SHEEN 1623 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1624 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1625 diffuse *= sheenEnergyComp; 1626 #endif 1627 reflectedLight.indirectDiffuse += diffuse; 1628} 1629void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { 1630 #ifdef USE_CLEARCOAT 1631 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1632 #endif 1633 #ifdef USE_SHEEN 1634 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; 1635 #endif 1636 vec3 singleScatteringDielectric = vec3( 0.0 ); 1637 vec3 multiScatteringDielectric = vec3( 0.0 ); 1638 vec3 singleScatteringMetallic = vec3( 0.0 ); 1639 vec3 multiScatteringMetallic = vec3( 0.0 );
vendor: 15,140 bytes, lines 1640-1954
1640 #ifdef USE_IRIDESCENCE 1641 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1642 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1643 #else 1644 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1645 computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1646 #endif 1647 vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); 1648 vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); 1649 vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; 1650 vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); 1651 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1652 vec3 indirectSpecular = radiance * singleScattering; 1653 indirectSpecular += multiScattering * cosineWeightedIrradiance; 1654 vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; 1655 #ifdef USE_SHEEN 1656 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1657 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1658 indirectSpecular *= sheenEnergyComp; 1659 indirectDiffuse *= sheenEnergyComp; 1660 #endif 1661 reflectedLight.indirectSpecular += indirectSpecular; 1662 reflectedLight.indirectDiffuse += indirectDiffuse; 1663} 1664#define RE_Direct RE_Direct_Physical 1665#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1666#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1667#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1668float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1669 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1670}`,lights_fragment_begin:` 1671vec3 geometryPosition = - vViewPosition; 1672vec3 geometryNormal = normal; 1673vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1674vec3 geometryClearcoatNormal = vec3( 0.0 ); 1675#ifdef USE_CLEARCOAT 1676 geometryClearcoatNormal = clearcoatNormal; 1677#endif 1678#ifdef USE_IRIDESCENCE 1679 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1680 if ( material.iridescenceThickness == 0.0 ) { 1681 material.iridescence = 0.0; 1682 } else { 1683 material.iridescence = saturate( material.iridescence ); 1684 } 1685 if ( material.iridescence > 0.0 ) { 1686 material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1687 material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); 1688 material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); 1689 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1690 } 1691#endif 1692IncidentLight directLight; 1693#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1694 PointLight pointLight; 1695 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1696 PointLightShadow pointLightShadow; 1697 #endif 1698 #pragma unroll_loop_start 1699 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1700 pointLight = pointLights[ i ]; 1701 getPointLightInfo( pointLight, geometryPosition, directLight ); 1702 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 1703 pointLightShadow = pointLightShadows[ i ]; 1704 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1705 #endif 1706 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1707 } 1708 #pragma unroll_loop_end 1709#endif 1710#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1711 SpotLight spotLight; 1712 vec4 spotColor; 1713 vec3 spotLightCoord; 1714 bool inSpotLightMap; 1715 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1716 SpotLightShadow spotLightShadow; 1717 #endif 1718 #pragma unroll_loop_start 1719 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1720 spotLight = spotLights[ i ]; 1721 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1722 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1723 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1724 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1725 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1726 #else 1727 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1728 #endif 1729 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1730 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1731 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1732 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1733 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1734 #endif 1735 #undef SPOT_LIGHT_MAP_INDEX 1736 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1737 spotLightShadow = spotLightShadows[ i ]; 1738 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1739 #endif 1740 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1741 } 1742 #pragma unroll_loop_end 1743#endif 1744#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1745 DirectionalLight directionalLight; 1746 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1747 DirectionalLightShadow directionalLightShadow; 1748 #endif 1749 #pragma unroll_loop_start 1750 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1751 directionalLight = directionalLights[ i ]; 1752 getDirectionalLightInfo( directionalLight, directLight ); 1753 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1754 directionalLightShadow = directionalLightShadows[ i ]; 1755 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1756 #endif 1757 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1758 } 1759 #pragma unroll_loop_end 1760#endif 1761#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1762 RectAreaLight rectAreaLight; 1763 #pragma unroll_loop_start 1764 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1765 rectAreaLight = rectAreaLights[ i ]; 1766 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1767 } 1768 #pragma unroll_loop_end 1769#endif 1770#if defined( RE_IndirectDiffuse ) 1771 vec3 iblIrradiance = vec3( 0.0 ); 1772 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1773 #if defined( USE_LIGHT_PROBES ) 1774 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1775 #endif 1776 #if ( NUM_HEMI_LIGHTS > 0 ) 1777 #pragma unroll_loop_start 1778 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1779 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1780 } 1781 #pragma unroll_loop_end 1782 #endif 1783#endif 1784#if defined( RE_IndirectSpecular ) 1785 vec3 radiance = vec3( 0.0 ); 1786 vec3 clearcoatRadiance = vec3( 0.0 ); 1787#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse ) 1788 #ifdef USE_LIGHTMAP 1789 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1790 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1791 irradiance += lightMapIrradiance; 1792 #endif 1793 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1794 iblIrradiance += getIBLIrradiance( geometryNormal ); 1795 #endif 1796#endif 1797#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1798 #ifdef USE_ANISOTROPY 1799 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1800 #else 1801 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1802 #endif 1803 #ifdef USE_CLEARCOAT 1804 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1805 #endif 1806#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse ) 1807 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1808#endif 1809#if defined( RE_IndirectSpecular ) 1810 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1811#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1812 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1813#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1814 uniform float logDepthBufFC; 1815 varying float vFragDepth; 1816 varying float vIsPerspective; 1817#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1818 varying float vFragDepth; 1819 varying float vIsPerspective; 1820#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1821 vFragDepth = 1.0 + gl_Position.w; 1822 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1823#endif`,map_fragment:`#ifdef USE_MAP 1824 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1825 #ifdef DECODE_VIDEO_TEXTURE 1826 sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); 1827 #endif 1828 diffuseColor *= sampledDiffuseColor; 1829#endif`,map_pars_fragment:`#ifdef USE_MAP 1830 uniform sampler2D map; 1831#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1832 #if defined( USE_POINTS_UV ) 1833 vec2 uv = vUv; 1834 #else 1835 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1836 #endif 1837#endif 1838#ifdef USE_MAP 1839 diffuseColor *= texture2D( map, uv ); 1840#endif 1841#ifdef USE_ALPHAMAP 1842 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1843#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV ) 1844 varying vec2 vUv; 1845#else 1846 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1847 uniform mat3 uvTransform; 1848 #endif 1849#endif 1850#ifdef USE_MAP 1851 uniform sampler2D map; 1852#endif 1853#ifdef USE_ALPHAMAP 1854 uniform sampler2D alphaMap; 1855#endif`,metalnessmap_fragment:`float metalnessFactor = metalness; 1856#ifdef USE_METALNESSMAP 1857 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1858 metalnessFactor *= texelMetalness.b; 1859#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP 1860 uniform sampler2D metalnessMap; 1861#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH 1862 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1863 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1864 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1865 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1866 } 1867#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS ) 1868 vColor *= morphTargetBaseInfluence; 1869 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1870 #if defined( USE_COLOR_ALPHA ) 1871 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1872 #elif defined( USE_COLOR ) 1873 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1874 #endif 1875 } 1876#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS 1877 objectNormal *= morphTargetBaseInfluence; 1878 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1879 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1880 } 1881#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS 1882 #ifndef USE_INSTANCING_MORPH 1883 uniform float morphTargetBaseInfluence; 1884 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1885 #endif 1886 uniform sampler2DArray morphTargetsTexture; 1887 uniform ivec2 morphTargetsTextureSize; 1888 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1889 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1890 int y = texelIndex / morphTargetsTextureSize.x; 1891 int x = texelIndex - y * morphTargetsTextureSize.x; 1892 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1893 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1894 } 1895#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS 1896 transformed *= morphTargetBaseInfluence; 1897 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1898 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1899 } 1900#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1901#ifdef FLAT_SHADED 1902 vec3 fdx = dFdx( vViewPosition ); 1903 vec3 fdy = dFdy( vViewPosition ); 1904 vec3 normal = normalize( cross( fdx, fdy ) ); 1905#else 1906 vec3 normal = normalize( vNormal ); 1907 #ifdef DOUBLE_SIDED 1908 normal *= faceDirection; 1909 #endif 1910#endif 1911#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1912 #ifdef USE_TANGENT 1913 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1914 #else 1915 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1916 #if defined( USE_NORMALMAP ) 1917 vNormalMapUv 1918 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1919 vClearcoatNormalMapUv 1920 #else 1921 vUv 1922 #endif 1923 ); 1924 #endif 1925 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1926 tbn[0] *= faceDirection; 1927 tbn[1] *= faceDirection; 1928 #endif 1929#endif 1930#ifdef USE_CLEARCOAT_NORMALMAP 1931 #ifdef USE_TANGENT 1932 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1933 #else 1934 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1935 #endif 1936 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1937 tbn2[0] *= faceDirection; 1938 tbn2[1] *= faceDirection; 1939 #endif 1940#endif 1941vec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE 1942 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1943 #ifdef FLIP_SIDED 1944 normal = - normal; 1945 #endif 1946 #ifdef DOUBLE_SIDED 1947 normal = normal * faceDirection; 1948 #endif 1949 normal = normalize( normalMatrix * normal ); 1950#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1951 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1952 mapN.xy *= normalScale; 1953 normal = normalize( tbn * mapN ); 1954#elif defined( USE_BUMPMAP )
vendor: 4,313 bytes, lines 1955-2073
1955 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1956#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED 1957 varying vec3 vNormal; 1958 #ifdef USE_TANGENT 1959 varying vec3 vTangent; 1960 varying vec3 vBitangent; 1961 #endif 1962#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED 1963 varying vec3 vNormal; 1964 #ifdef USE_TANGENT 1965 varying vec3 vTangent; 1966 varying vec3 vBitangent; 1967 #endif 1968#endif`,normal_vertex:`#ifndef FLAT_SHADED 1969 vNormal = normalize( transformedNormal ); 1970 #ifdef USE_TANGENT 1971 vTangent = normalize( transformedTangent ); 1972 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1973 #endif 1974#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP 1975 uniform sampler2D normalMap; 1976 uniform vec2 normalScale; 1977#endif 1978#ifdef USE_NORMALMAP_OBJECTSPACE 1979 uniform mat3 normalMatrix; 1980#endif 1981#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1982 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1983 vec3 q0 = dFdx( eye_pos.xyz ); 1984 vec3 q1 = dFdy( eye_pos.xyz ); 1985 vec2 st0 = dFdx( uv.st ); 1986 vec2 st1 = dFdy( uv.st ); 1987 vec3 N = surf_norm; 1988 vec3 q1perp = cross( q1, N ); 1989 vec3 q0perp = cross( N, q0 ); 1990 vec3 T = q1perp * st0.x + q0perp * st1.x; 1991 vec3 B = q1perp * st0.y + q0perp * st1.y; 1992 float det = max( dot( T, T ), dot( B, B ) ); 1993 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1994 return mat3( T * scale, B * scale, N ); 1995 } 1996#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT 1997 vec3 clearcoatNormal = nonPerturbedNormal; 1998#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP 1999 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 2000 clearcoatMapN.xy *= clearcoatNormalScale; 2001 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 2002#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP 2003 uniform sampler2D clearcoatMap; 2004#endif 2005#ifdef USE_CLEARCOAT_NORMALMAP 2006 uniform sampler2D clearcoatNormalMap; 2007 uniform vec2 clearcoatNormalScale; 2008#endif 2009#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2010 uniform sampler2D clearcoatRoughnessMap; 2011#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP 2012 uniform sampler2D iridescenceMap; 2013#endif 2014#ifdef USE_IRIDESCENCE_THICKNESSMAP 2015 uniform sampler2D iridescenceThicknessMap; 2016#endif`,opaque_fragment:`#ifdef OPAQUE 2017diffuseColor.a = 1.0; 2018#endif 2019#ifdef USE_TRANSMISSION 2020diffuseColor.a *= material.transmissionAlpha; 2021#endif 2022gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) { 2023 return normalize( normal ) * 0.5 + 0.5; 2024} 2025vec3 unpackRGBToNormal( const in vec3 rgb ) { 2026 return 2.0 * rgb.xyz - 1.0; 2027} 2028const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 2029const float Inv255 = 1. / 255.; 2030const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 2031const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 2032const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 2033const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 2034vec4 packDepthToRGBA( const in float v ) { 2035 if( v <= 0.0 ) 2036 return vec4( 0., 0., 0., 0. ); 2037 if( v >= 1.0 ) 2038 return vec4( 1., 1., 1., 1. ); 2039 float vuf; 2040 float af = modf( v * PackFactors.a, vuf ); 2041 float bf = modf( vuf * ShiftRight8, vuf ); 2042 float gf = modf( vuf * ShiftRight8, vuf ); 2043 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 2044} 2045vec3 packDepthToRGB( const in float v ) { 2046 if( v <= 0.0 ) 2047 return vec3( 0., 0., 0. ); 2048 if( v >= 1.0 ) 2049 return vec3( 1., 1., 1. ); 2050 float vuf; 2051 float bf = modf( v * PackFactors.b, vuf ); 2052 float gf = modf( vuf * ShiftRight8, vuf ); 2053 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 2054} 2055vec2 packDepthToRG( const in float v ) { 2056 if( v <= 0.0 ) 2057 return vec2( 0., 0. ); 2058 if( v >= 1.0 ) 2059 return vec2( 1., 1. ); 2060 float vuf; 2061 float gf = modf( v * 256., vuf ); 2062 return vec2( vuf * Inv255, gf ); 2063} 2064float unpackRGBAToDepth( const in vec4 v ) { 2065 return dot( v, UnpackFactors4 ); 2066} 2067float unpackRGBToDepth( const in vec3 v ) { 2068 return dot( v, UnpackFactors3 ); 2069} 2070float unpackRGToDepth( const in vec2 v ) { 2071 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 2072} 2073vec4 pack2HalfToRGBA( const in vec2 v ) {
vendor: 27,239 bytes, lines 2074-2702
2074 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 2075 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 2076} 2077vec2 unpackRGBATo2Half( const in vec4 v ) { 2078 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 2079} 2080float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 2081 return ( viewZ + near ) / ( near - far ); 2082} 2083float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 2084 return depth * ( near - far ) - near; 2085} 2086float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 2087 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 2088} 2089float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 2090 return ( near * far ) / ( ( far - near ) * depth - far ); 2091}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA 2092 gl_FragColor.rgb *= gl_FragColor.a; 2093#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 ); 2094#ifdef USE_BATCHING 2095 mvPosition = batchingMatrix * mvPosition; 2096#endif 2097#ifdef USE_INSTANCING 2098 mvPosition = instanceMatrix * mvPosition; 2099#endif 2100mvPosition = modelViewMatrix * mvPosition; 2101gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING 2102 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 2103#endif`,dithering_pars_fragment:`#ifdef DITHERING 2104 vec3 dithering( vec3 color ) { 2105 float grid_position = rand( gl_FragCoord.xy ); 2106 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 2107 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 2108 return color + dither_shift_RGB; 2109 } 2110#endif`,roughnessmap_fragment:`float roughnessFactor = roughness; 2111#ifdef USE_ROUGHNESSMAP 2112 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 2113 roughnessFactor *= texelRoughness.g; 2114#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP 2115 uniform sampler2D roughnessMap; 2116#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0 2117 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 2118#endif 2119#if NUM_SPOT_LIGHT_MAPS > 0 2120 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 2121#endif 2122#ifdef USE_SHADOWMAP 2123 #if NUM_DIR_LIGHT_SHADOWS > 0 2124 #if defined( SHADOWMAP_TYPE_PCF ) 2125 uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 2126 #else 2127 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 2128 #endif 2129 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 2130 struct DirectionalLightShadow { 2131 float shadowIntensity; 2132 float shadowBias; 2133 float shadowNormalBias; 2134 float shadowRadius; 2135 vec2 shadowMapSize; 2136 }; 2137 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 2138 #endif 2139 #if NUM_SPOT_LIGHT_SHADOWS > 0 2140 #if defined( SHADOWMAP_TYPE_PCF ) 2141 uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 2142 #else 2143 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 2144 #endif 2145 struct SpotLightShadow { 2146 float shadowIntensity; 2147 float shadowBias; 2148 float shadowNormalBias; 2149 float shadowRadius; 2150 vec2 shadowMapSize; 2151 }; 2152 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 2153 #endif 2154 #if NUM_POINT_LIGHT_SHADOWS > 0 2155 #if defined( SHADOWMAP_TYPE_PCF ) 2156 uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 2157 #elif defined( SHADOWMAP_TYPE_BASIC ) 2158 uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 2159 #endif 2160 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 2161 struct PointLightShadow { 2162 float shadowIntensity; 2163 float shadowBias; 2164 float shadowNormalBias; 2165 float shadowRadius; 2166 vec2 shadowMapSize; 2167 float shadowCameraNear; 2168 float shadowCameraFar; 2169 }; 2170 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2171 #endif 2172 #if defined( SHADOWMAP_TYPE_PCF ) 2173 float interleavedGradientNoise( vec2 position ) { 2174 return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); 2175 } 2176 vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { 2177 const float goldenAngle = 2.399963229728653; 2178 float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); 2179 float theta = float( sampleIndex ) * goldenAngle + phi; 2180 return vec2( cos( theta ), sin( theta ) ) * r; 2181 } 2182 #endif 2183 #if defined( SHADOWMAP_TYPE_PCF ) 2184 float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2185 float shadow = 1.0; 2186 shadowCoord.xyz /= shadowCoord.w; 2187 shadowCoord.z += shadowBias; 2188 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2189 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2190 if ( frustumTest ) { 2191 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 2192 float radius = shadowRadius * texelSize.x; 2193 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718; 2194 shadow = ( 2195 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + 2196 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + 2197 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + 2198 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + 2199 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) 2200 ) * 0.2; 2201 } 2202 return mix( 1.0, shadow, shadowIntensity ); 2203 } 2204 #elif defined( SHADOWMAP_TYPE_VSM ) 2205 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2206 float shadow = 1.0; 2207 shadowCoord.xyz /= shadowCoord.w; 2208 shadowCoord.z += shadowBias; 2209 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2210 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2211 if ( frustumTest ) { 2212 vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; 2213 float mean = distribution.x; 2214 float variance = distribution.y * distribution.y; 2215 #ifdef USE_REVERSED_DEPTH_BUFFER 2216 float hard_shadow = step( mean, shadowCoord.z ); 2217 #else 2218 float hard_shadow = step( shadowCoord.z, mean ); 2219 #endif 2220 if ( hard_shadow == 1.0 ) { 2221 shadow = 1.0; 2222 } else { 2223 variance = max( variance, 0.0000001 ); 2224 float d = shadowCoord.z - mean; 2225 float p_max = variance / ( variance + d * d ); 2226 p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); 2227 shadow = max( hard_shadow, p_max ); 2228 } 2229 } 2230 return mix( 1.0, shadow, shadowIntensity ); 2231 } 2232 #else 2233 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2234 float shadow = 1.0; 2235 shadowCoord.xyz /= shadowCoord.w; 2236 shadowCoord.z += shadowBias; 2237 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2238 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2239 if ( frustumTest ) { 2240 float depth = texture2D( shadowMap, shadowCoord.xy ).r; 2241 #ifdef USE_REVERSED_DEPTH_BUFFER 2242 shadow = step( depth, shadowCoord.z ); 2243 #else 2244 shadow = step( shadowCoord.z, depth ); 2245 #endif 2246 } 2247 return mix( 1.0, shadow, shadowIntensity ); 2248 } 2249 #endif 2250 #if NUM_POINT_LIGHT_SHADOWS > 0 2251 #if defined( SHADOWMAP_TYPE_PCF ) 2252 float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 2253 float shadow = 1.0; 2254 vec3 lightToPosition = shadowCoord.xyz; 2255 vec3 bd3D = normalize( lightToPosition ); 2256 vec3 absVec = abs( lightToPosition ); 2257 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 2258 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 2259 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 2260 dp += shadowBias; 2261 float texelSize = shadowRadius / shadowMapSize.x; 2262 vec3 absDir = abs( bd3D ); 2263 vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); 2264 tangent = normalize( cross( bd3D, tangent ) ); 2265 vec3 bitangent = cross( bd3D, tangent ); 2266 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718; 2267 shadow = ( 2268 texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) + 2269 texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) + 2270 texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) + 2271 texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) + 2272 texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).y ) * texelSize, dp ) ) 2273 ) * 0.2; 2274 } 2275 return mix( 1.0, shadow, shadowIntensity ); 2276 } 2277 #elif defined( SHADOWMAP_TYPE_BASIC ) 2278 float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 2279 float shadow = 1.0; 2280 vec3 lightToPosition = shadowCoord.xyz; 2281 vec3 bd3D = normalize( lightToPosition ); 2282 vec3 absVec = abs( lightToPosition ); 2283 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 2284 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 2285 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 2286 dp += shadowBias; 2287 float depth = textureCube( shadowMap, bd3D ).r; 2288 #ifdef USE_REVERSED_DEPTH_BUFFER 2289 shadow = step( depth, dp ); 2290 #else 2291 shadow = step( dp, depth ); 2292 #endif 2293 } 2294 return mix( 1.0, shadow, shadowIntensity ); 2295 } 2296 #endif 2297 #endif 2298#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0 2299 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 2300 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 2301#endif 2302#ifdef USE_SHADOWMAP 2303 #if NUM_DIR_LIGHT_SHADOWS > 0 2304 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 2305 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 2306 struct DirectionalLightShadow { 2307 float shadowIntensity; 2308 float shadowBias; 2309 float shadowNormalBias; 2310 float shadowRadius; 2311 vec2 shadowMapSize; 2312 }; 2313 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 2314 #endif 2315 #if NUM_SPOT_LIGHT_SHADOWS > 0 2316 struct SpotLightShadow { 2317 float shadowIntensity; 2318 float shadowBias; 2319 float shadowNormalBias; 2320 float shadowRadius; 2321 vec2 shadowMapSize; 2322 }; 2323 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 2324 #endif 2325 #if NUM_POINT_LIGHT_SHADOWS > 0 2326 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 2327 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 2328 struct PointLightShadow { 2329 float shadowIntensity; 2330 float shadowBias; 2331 float shadowNormalBias; 2332 float shadowRadius; 2333 vec2 shadowMapSize; 2334 float shadowCameraNear; 2335 float shadowCameraFar; 2336 }; 2337 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2338 #endif 2339#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 2340 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 2341 vec4 shadowWorldPosition; 2342#endif 2343#if defined( USE_SHADOWMAP ) 2344 #if NUM_DIR_LIGHT_SHADOWS > 0 2345 #pragma unroll_loop_start 2346 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2347 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 2348 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 2349 } 2350 #pragma unroll_loop_end 2351 #endif 2352 #if NUM_POINT_LIGHT_SHADOWS > 0 2353 #pragma unroll_loop_start 2354 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2355 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 2356 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 2357 } 2358 #pragma unroll_loop_end 2359 #endif 2360#endif 2361#if NUM_SPOT_LIGHT_COORDS > 0 2362 #pragma unroll_loop_start 2363 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 2364 shadowWorldPosition = worldPosition; 2365 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2366 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 2367 #endif 2368 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 2369 } 2370 #pragma unroll_loop_end 2371#endif`,shadowmask_pars_fragment:`float getShadowMask() { 2372 float shadow = 1.0; 2373 #ifdef USE_SHADOWMAP 2374 #if NUM_DIR_LIGHT_SHADOWS > 0 2375 DirectionalLightShadow directionalLight; 2376 #pragma unroll_loop_start 2377 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2378 directionalLight = directionalLightShadows[ i ]; 2379 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2380 } 2381 #pragma unroll_loop_end 2382 #endif 2383 #if NUM_SPOT_LIGHT_SHADOWS > 0 2384 SpotLightShadow spotLight; 2385 #pragma unroll_loop_start 2386 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2387 spotLight = spotLightShadows[ i ]; 2388 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2389 } 2390 #pragma unroll_loop_end 2391 #endif 2392 #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 2393 PointLightShadow pointLight; 2394 #pragma unroll_loop_start 2395 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2396 pointLight = pointLightShadows[ i ]; 2397 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2398 } 2399 #pragma unroll_loop_end 2400 #endif 2401 #endif 2402 return shadow; 2403}`,skinbase_vertex:`#ifdef USE_SKINNING 2404 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2405 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2406 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2407 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2408#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING 2409 uniform mat4 bindMatrix; 2410 uniform mat4 bindMatrixInverse; 2411 uniform highp sampler2D boneTexture; 2412 mat4 getBoneMatrix( const in float i ) { 2413 int size = textureSize( boneTexture, 0 ).x; 2414 int j = int( i ) * 4; 2415 int x = j % size; 2416 int y = j / size; 2417 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2418 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2419 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2420 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2421 return mat4( v1, v2, v3, v4 ); 2422 } 2423#endif`,skinning_vertex:`#ifdef USE_SKINNING 2424 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2425 vec4 skinned = vec4( 0.0 ); 2426 skinned += boneMatX * skinVertex * skinWeight.x; 2427 skinned += boneMatY * skinVertex * skinWeight.y; 2428 skinned += boneMatZ * skinVertex * skinWeight.z; 2429 skinned += boneMatW * skinVertex * skinWeight.w; 2430 transformed = ( bindMatrixInverse * skinned ).xyz; 2431#endif`,skinnormal_vertex:`#ifdef USE_SKINNING 2432 mat4 skinMatrix = mat4( 0.0 ); 2433 skinMatrix += skinWeight.x * boneMatX; 2434 skinMatrix += skinWeight.y * boneMatY; 2435 skinMatrix += skinWeight.z * boneMatZ; 2436 skinMatrix += skinWeight.w * boneMatW; 2437 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2438 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2439 #ifdef USE_TANGENT 2440 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2441 #endif 2442#endif`,specularmap_fragment:`float specularStrength; 2443#ifdef USE_SPECULARMAP 2444 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2445 specularStrength = texelSpecular.r; 2446#else 2447 specularStrength = 1.0; 2448#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP 2449 uniform sampler2D specularMap; 2450#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING ) 2451 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2452#endif`,tonemapping_pars_fragment:`#ifndef saturate 2453#define saturate( a ) clamp( a, 0.0, 1.0 ) 2454#endif 2455uniform float toneMappingExposure; 2456vec3 LinearToneMapping( vec3 color ) { 2457 return saturate( toneMappingExposure * color ); 2458} 2459vec3 ReinhardToneMapping( vec3 color ) { 2460 color *= toneMappingExposure; 2461 return saturate( color / ( vec3( 1.0 ) + color ) ); 2462} 2463vec3 CineonToneMapping( vec3 color ) { 2464 color *= toneMappingExposure; 2465 color = max( vec3( 0.0 ), color - 0.004 ); 2466 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2467} 2468vec3 RRTAndODTFit( vec3 v ) { 2469 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2470 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2471 return a / b; 2472} 2473vec3 ACESFilmicToneMapping( vec3 color ) { 2474 const mat3 ACESInputMat = mat3( 2475 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2476 vec3( 0.04823, 0.01566, 0.83777 ) 2477 ); 2478 const mat3 ACESOutputMat = mat3( 2479 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2480 vec3( -0.07367, -0.00605, 1.07602 ) 2481 ); 2482 color *= toneMappingExposure / 0.6; 2483 color = ACESInputMat * color; 2484 color = RRTAndODTFit( color ); 2485 color = ACESOutputMat * color; 2486 return saturate( color ); 2487} 2488const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2489 vec3( 1.6605, - 0.1246, - 0.0182 ), 2490 vec3( - 0.5876, 1.1329, - 0.1006 ), 2491 vec3( - 0.0728, - 0.0083, 1.1187 ) 2492); 2493const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2494 vec3( 0.6274, 0.0691, 0.0164 ), 2495 vec3( 0.3293, 0.9195, 0.0880 ), 2496 vec3( 0.0433, 0.0113, 0.8956 ) 2497); 2498vec3 agxDefaultContrastApprox( vec3 x ) { 2499 vec3 x2 = x * x; 2500 vec3 x4 = x2 * x2; 2501 return + 15.5 * x4 * x2 2502 - 40.14 * x4 * x 2503 + 31.96 * x4 2504 - 6.868 * x2 * x 2505 + 0.4298 * x2 2506 + 0.1191 * x 2507 - 0.00232; 2508} 2509vec3 AgXToneMapping( vec3 color ) { 2510 const mat3 AgXInsetMatrix = mat3( 2511 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2512 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2513 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2514 ); 2515 const mat3 AgXOutsetMatrix = mat3( 2516 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2517 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2518 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2519 ); 2520 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2521 color *= toneMappingExposure; 2522 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2523 color = AgXInsetMatrix * color; 2524 color = max( color, 1e-10 ); color = log2( color ); 2525 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2526 color = clamp( color, 0.0, 1.0 ); 2527 color = agxDefaultContrastApprox( color ); 2528 color = AgXOutsetMatrix * color; 2529 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2530 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2531 color = clamp( color, 0.0, 1.0 ); 2532 return color; 2533} 2534vec3 NeutralToneMapping( vec3 color ) { 2535 const float StartCompression = 0.8 - 0.04; 2536 const float Desaturation = 0.15; 2537 color *= toneMappingExposure; 2538 float x = min( color.r, min( color.g, color.b ) ); 2539 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2540 color -= offset; 2541 float peak = max( color.r, max( color.g, color.b ) ); 2542 if ( peak < StartCompression ) return color; 2543 float d = 1. - StartCompression; 2544 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2545 color *= newPeak / peak; 2546 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2547 return mix( color, vec3( newPeak ), g ); 2548} 2549vec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION 2550 material.transmission = transmission; 2551 material.transmissionAlpha = 1.0; 2552 material.thickness = thickness; 2553 material.attenuationDistance = attenuationDistance; 2554 material.attenuationColor = attenuationColor; 2555 #ifdef USE_TRANSMISSIONMAP 2556 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2557 #endif 2558 #ifdef USE_THICKNESSMAP 2559 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2560 #endif 2561 vec3 pos = vWorldPosition; 2562 vec3 v = normalize( cameraPosition - pos ); 2563 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2564 vec4 transmitted = getIBLVolumeRefraction( 2565 n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, 2566 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2567 material.attenuationColor, material.attenuationDistance ); 2568 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2569 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2570#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION 2571 uniform float transmission; 2572 uniform float thickness; 2573 uniform float attenuationDistance; 2574 uniform vec3 attenuationColor; 2575 #ifdef USE_TRANSMISSIONMAP 2576 uniform sampler2D transmissionMap; 2577 #endif 2578 #ifdef USE_THICKNESSMAP 2579 uniform sampler2D thicknessMap; 2580 #endif 2581 uniform vec2 transmissionSamplerSize; 2582 uniform sampler2D transmissionSamplerMap; 2583 uniform mat4 modelMatrix; 2584 uniform mat4 projectionMatrix; 2585 varying vec3 vWorldPosition; 2586 float w0( float a ) { 2587 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2588 } 2589 float w1( float a ) { 2590 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2591 } 2592 float w2( float a ){ 2593 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2594 } 2595 float w3( float a ) { 2596 return ( 1.0 / 6.0 ) * ( a * a * a ); 2597 } 2598 float g0( float a ) { 2599 return w0( a ) + w1( a ); 2600 } 2601 float g1( float a ) { 2602 return w2( a ) + w3( a ); 2603 } 2604 float h0( float a ) { 2605 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2606 } 2607 float h1( float a ) { 2608 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2609 } 2610 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2611 uv = uv * texelSize.zw + 0.5; 2612 vec2 iuv = floor( uv ); 2613 vec2 fuv = fract( uv ); 2614 float g0x = g0( fuv.x ); 2615 float g1x = g1( fuv.x ); 2616 float h0x = h0( fuv.x ); 2617 float h1x = h1( fuv.x ); 2618 float h0y = h0( fuv.y ); 2619 float h1y = h1( fuv.y ); 2620 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2621 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2622 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2623 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2624 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2625 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2626 } 2627 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2628 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2629 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2630 vec2 fLodSizeInv = 1.0 / fLodSize; 2631 vec2 cLodSizeInv = 1.0 / cLodSize; 2632 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2633 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2634 return mix( fSample, cSample, fract( lod ) ); 2635 } 2636 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2637 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2638 vec3 modelScale; 2639 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2640 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2641 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2642 return normalize( refractionVector ) * thickness * modelScale; 2643 } 2644 float applyIorToRoughness( const in float roughness, const in float ior ) { 2645 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2646 } 2647 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2648 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2649 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2650 } 2651 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2652 if ( isinf( attenuationDistance ) ) { 2653 return vec3( 1.0 ); 2654 } else { 2655 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2656 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2657 } 2658 } 2659 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2660 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2661 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2662 const in vec3 attenuationColor, const in float attenuationDistance ) { 2663 vec4 transmittedLight; 2664 vec3 transmittance; 2665 #ifdef USE_DISPERSION 2666 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2667 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2668 for ( int i = 0; i < 3; i ++ ) { 2669 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2670 vec3 refractedRayExit = position + transmissionRay; 2671 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2672 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2673 refractionCoords += 1.0; 2674 refractionCoords /= 2.0; 2675 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2676 transmittedLight[ i ] = transmissionSample[ i ]; 2677 transmittedLight.a += transmissionSample.a; 2678 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2679 } 2680 transmittedLight.a /= 3.0; 2681 #else 2682 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2683 vec3 refractedRayExit = position + transmissionRay; 2684 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2685 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2686 refractionCoords += 1.0; 2687 refractionCoords /= 2.0; 2688 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2689 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2690 #endif 2691 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2692 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2693 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2694 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2695 } 2696#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2697 varying vec2 vUv; 2698#endif 2699#ifdef USE_MAP 2700 varying vec2 vMapUv; 2701#endif 2702#ifdef USE_ALPHAMAP
vendor: 5,420 bytes, lines 2703-2904
2703 varying vec2 vAlphaMapUv; 2704#endif 2705#ifdef USE_LIGHTMAP 2706 varying vec2 vLightMapUv; 2707#endif 2708#ifdef USE_AOMAP 2709 varying vec2 vAoMapUv; 2710#endif 2711#ifdef USE_BUMPMAP 2712 varying vec2 vBumpMapUv; 2713#endif 2714#ifdef USE_NORMALMAP 2715 varying vec2 vNormalMapUv; 2716#endif 2717#ifdef USE_EMISSIVEMAP 2718 varying vec2 vEmissiveMapUv; 2719#endif 2720#ifdef USE_METALNESSMAP 2721 varying vec2 vMetalnessMapUv; 2722#endif 2723#ifdef USE_ROUGHNESSMAP 2724 varying vec2 vRoughnessMapUv; 2725#endif 2726#ifdef USE_ANISOTROPYMAP 2727 varying vec2 vAnisotropyMapUv; 2728#endif 2729#ifdef USE_CLEARCOATMAP 2730 varying vec2 vClearcoatMapUv; 2731#endif 2732#ifdef USE_CLEARCOAT_NORMALMAP 2733 varying vec2 vClearcoatNormalMapUv; 2734#endif 2735#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2736 varying vec2 vClearcoatRoughnessMapUv; 2737#endif 2738#ifdef USE_IRIDESCENCEMAP 2739 varying vec2 vIridescenceMapUv; 2740#endif 2741#ifdef USE_IRIDESCENCE_THICKNESSMAP 2742 varying vec2 vIridescenceThicknessMapUv; 2743#endif 2744#ifdef USE_SHEEN_COLORMAP 2745 varying vec2 vSheenColorMapUv; 2746#endif 2747#ifdef USE_SHEEN_ROUGHNESSMAP 2748 varying vec2 vSheenRoughnessMapUv; 2749#endif 2750#ifdef USE_SPECULARMAP 2751 varying vec2 vSpecularMapUv; 2752#endif 2753#ifdef USE_SPECULAR_COLORMAP 2754 varying vec2 vSpecularColorMapUv; 2755#endif 2756#ifdef USE_SPECULAR_INTENSITYMAP 2757 varying vec2 vSpecularIntensityMapUv; 2758#endif 2759#ifdef USE_TRANSMISSIONMAP 2760 uniform mat3 transmissionMapTransform; 2761 varying vec2 vTransmissionMapUv; 2762#endif 2763#ifdef USE_THICKNESSMAP 2764 uniform mat3 thicknessMapTransform; 2765 varying vec2 vThicknessMapUv; 2766#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2767 varying vec2 vUv; 2768#endif 2769#ifdef USE_MAP 2770 uniform mat3 mapTransform; 2771 varying vec2 vMapUv; 2772#endif 2773#ifdef USE_ALPHAMAP 2774 uniform mat3 alphaMapTransform; 2775 varying vec2 vAlphaMapUv; 2776#endif 2777#ifdef USE_LIGHTMAP 2778 uniform mat3 lightMapTransform; 2779 varying vec2 vLightMapUv; 2780#endif 2781#ifdef USE_AOMAP 2782 uniform mat3 aoMapTransform; 2783 varying vec2 vAoMapUv; 2784#endif 2785#ifdef USE_BUMPMAP 2786 uniform mat3 bumpMapTransform; 2787 varying vec2 vBumpMapUv; 2788#endif 2789#ifdef USE_NORMALMAP 2790 uniform mat3 normalMapTransform; 2791 varying vec2 vNormalMapUv; 2792#endif 2793#ifdef USE_DISPLACEMENTMAP 2794 uniform mat3 displacementMapTransform; 2795 varying vec2 vDisplacementMapUv; 2796#endif 2797#ifdef USE_EMISSIVEMAP 2798 uniform mat3 emissiveMapTransform; 2799 varying vec2 vEmissiveMapUv; 2800#endif 2801#ifdef USE_METALNESSMAP 2802 uniform mat3 metalnessMapTransform; 2803 varying vec2 vMetalnessMapUv; 2804#endif 2805#ifdef USE_ROUGHNESSMAP 2806 uniform mat3 roughnessMapTransform; 2807 varying vec2 vRoughnessMapUv; 2808#endif 2809#ifdef USE_ANISOTROPYMAP 2810 uniform mat3 anisotropyMapTransform; 2811 varying vec2 vAnisotropyMapUv; 2812#endif 2813#ifdef USE_CLEARCOATMAP 2814 uniform mat3 clearcoatMapTransform; 2815 varying vec2 vClearcoatMapUv; 2816#endif 2817#ifdef USE_CLEARCOAT_NORMALMAP 2818 uniform mat3 clearcoatNormalMapTransform; 2819 varying vec2 vClearcoatNormalMapUv; 2820#endif 2821#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2822 uniform mat3 clearcoatRoughnessMapTransform; 2823 varying vec2 vClearcoatRoughnessMapUv; 2824#endif 2825#ifdef USE_SHEEN_COLORMAP 2826 uniform mat3 sheenColorMapTransform; 2827 varying vec2 vSheenColorMapUv; 2828#endif 2829#ifdef USE_SHEEN_ROUGHNESSMAP 2830 uniform mat3 sheenRoughnessMapTransform; 2831 varying vec2 vSheenRoughnessMapUv; 2832#endif 2833#ifdef USE_IRIDESCENCEMAP 2834 uniform mat3 iridescenceMapTransform; 2835 varying vec2 vIridescenceMapUv; 2836#endif 2837#ifdef USE_IRIDESCENCE_THICKNESSMAP 2838 uniform mat3 iridescenceThicknessMapTransform; 2839 varying vec2 vIridescenceThicknessMapUv; 2840#endif 2841#ifdef USE_SPECULARMAP 2842 uniform mat3 specularMapTransform; 2843 varying vec2 vSpecularMapUv; 2844#endif 2845#ifdef USE_SPECULAR_COLORMAP 2846 uniform mat3 specularColorMapTransform; 2847 varying vec2 vSpecularColorMapUv; 2848#endif 2849#ifdef USE_SPECULAR_INTENSITYMAP 2850 uniform mat3 specularIntensityMapTransform; 2851 varying vec2 vSpecularIntensityMapUv; 2852#endif 2853#ifdef USE_TRANSMISSIONMAP 2854 uniform mat3 transmissionMapTransform; 2855 varying vec2 vTransmissionMapUv; 2856#endif 2857#ifdef USE_THICKNESSMAP 2858 uniform mat3 thicknessMapTransform; 2859 varying vec2 vThicknessMapUv; 2860#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2861 vUv = vec3( uv, 1 ).xy; 2862#endif 2863#ifdef USE_MAP 2864 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2865#endif 2866#ifdef USE_ALPHAMAP 2867 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2868#endif 2869#ifdef USE_LIGHTMAP 2870 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2871#endif 2872#ifdef USE_AOMAP 2873 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2874#endif 2875#ifdef USE_BUMPMAP 2876 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2877#endif 2878#ifdef USE_NORMALMAP 2879 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2880#endif 2881#ifdef USE_DISPLACEMENTMAP 2882 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2883#endif 2884#ifdef USE_EMISSIVEMAP 2885 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2886#endif 2887#ifdef USE_METALNESSMAP 2888 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2889#endif 2890#ifdef USE_ROUGHNESSMAP 2891 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2892#endif 2893#ifdef USE_ANISOTROPYMAP 2894 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2895#endif 2896#ifdef USE_CLEARCOATMAP 2897 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2898#endif 2899#ifdef USE_CLEARCOAT_NORMALMAP 2900 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2901#endif 2902#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2903 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2904#endif
vendor: 35,280 bytes, lines 2905-3990
2905#ifdef USE_IRIDESCENCEMAP 2906 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2907#endif 2908#ifdef USE_IRIDESCENCE_THICKNESSMAP 2909 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2910#endif 2911#ifdef USE_SHEEN_COLORMAP 2912 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2913#endif 2914#ifdef USE_SHEEN_ROUGHNESSMAP 2915 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2916#endif 2917#ifdef USE_SPECULARMAP 2918 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2919#endif 2920#ifdef USE_SPECULAR_COLORMAP 2921 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2922#endif 2923#ifdef USE_SPECULAR_INTENSITYMAP 2924 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2925#endif 2926#ifdef USE_TRANSMISSIONMAP 2927 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2928#endif 2929#ifdef USE_THICKNESSMAP 2930 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2931#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2932 vec4 worldPosition = vec4( transformed, 1.0 ); 2933 #ifdef USE_BATCHING 2934 worldPosition = batchingMatrix * worldPosition; 2935 #endif 2936 #ifdef USE_INSTANCING 2937 worldPosition = instanceMatrix * worldPosition; 2938 #endif 2939 worldPosition = modelMatrix * worldPosition; 2940#endif`,background_vert:`varying vec2 vUv; 2941uniform mat3 uvTransform; 2942void main() { 2943 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2944 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2945}`,background_frag:`uniform sampler2D t2D; 2946uniform float backgroundIntensity; 2947varying vec2 vUv; 2948void main() { 2949 vec4 texColor = texture2D( t2D, vUv ); 2950 #ifdef DECODE_VIDEO_TEXTURE 2951 texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); 2952 #endif 2953 texColor.rgb *= backgroundIntensity; 2954 gl_FragColor = texColor; 2955 #include <tonemapping_fragment> 2956 #include <colorspace_fragment> 2957}`,backgroundCube_vert:`varying vec3 vWorldDirection; 2958#include <common> 2959void main() { 2960 vWorldDirection = transformDirection( position, modelMatrix ); 2961 #include <begin_vertex> 2962 #include <project_vertex> 2963 gl_Position.z = gl_Position.w; 2964}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE 2965 uniform samplerCube envMap; 2966#elif defined( ENVMAP_TYPE_CUBE_UV ) 2967 uniform sampler2D envMap; 2968#endif 2969uniform float flipEnvMap; 2970uniform float backgroundBlurriness; 2971uniform float backgroundIntensity; 2972uniform mat3 backgroundRotation; 2973varying vec3 vWorldDirection; 2974#include <cube_uv_reflection_fragment> 2975void main() { 2976 #ifdef ENVMAP_TYPE_CUBE 2977 vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 2978 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2979 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2980 #else 2981 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2982 #endif 2983 texColor.rgb *= backgroundIntensity; 2984 gl_FragColor = texColor; 2985 #include <tonemapping_fragment> 2986 #include <colorspace_fragment> 2987}`,cube_vert:`varying vec3 vWorldDirection; 2988#include <common> 2989void main() { 2990 vWorldDirection = transformDirection( position, modelMatrix ); 2991 #include <begin_vertex> 2992 #include <project_vertex> 2993 gl_Position.z = gl_Position.w; 2994}`,cube_frag:`uniform samplerCube tCube; 2995uniform float tFlip; 2996uniform float opacity; 2997varying vec3 vWorldDirection; 2998void main() { 2999 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 3000 gl_FragColor = texColor; 3001 gl_FragColor.a *= opacity; 3002 #include <tonemapping_fragment> 3003 #include <colorspace_fragment> 3004}`,depth_vert:`#include <common> 3005#include <batching_pars_vertex> 3006#include <uv_pars_vertex> 3007#include <displacementmap_pars_vertex> 3008#include <morphtarget_pars_vertex> 3009#include <skinning_pars_vertex> 3010#include <logdepthbuf_pars_vertex> 3011#include <clipping_planes_pars_vertex> 3012varying vec2 vHighPrecisionZW; 3013void main() { 3014 #include <uv_vertex> 3015 #include <batching_vertex> 3016 #include <skinbase_vertex> 3017 #include <morphinstance_vertex> 3018 #ifdef USE_DISPLACEMENTMAP 3019 #include <beginnormal_vertex> 3020 #include <morphnormal_vertex> 3021 #include <skinnormal_vertex> 3022 #endif 3023 #include <begin_vertex> 3024 #include <morphtarget_vertex> 3025 #include <skinning_vertex> 3026 #include <displacementmap_vertex> 3027 #include <project_vertex> 3028 #include <logdepthbuf_vertex> 3029 #include <clipping_planes_vertex> 3030 vHighPrecisionZW = gl_Position.zw; 3031}`,depth_frag:`#if DEPTH_PACKING == 3200 3032 uniform float opacity; 3033#endif 3034#include <common> 3035#include <packing> 3036#include <uv_pars_fragment> 3037#include <map_pars_fragment> 3038#include <alphamap_pars_fragment> 3039#include <alphatest_pars_fragment> 3040#include <alphahash_pars_fragment> 3041#include <logdepthbuf_pars_fragment> 3042#include <clipping_planes_pars_fragment> 3043varying vec2 vHighPrecisionZW; 3044void main() { 3045 vec4 diffuseColor = vec4( 1.0 ); 3046 #include <clipping_planes_fragment> 3047 #if DEPTH_PACKING == 3200 3048 diffuseColor.a = opacity; 3049 #endif 3050 #include <map_fragment> 3051 #include <alphamap_fragment> 3052 #include <alphatest_fragment> 3053 #include <alphahash_fragment> 3054 #include <logdepthbuf_fragment> 3055 #ifdef USE_REVERSED_DEPTH_BUFFER 3056 float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; 3057 #else 3058 float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; 3059 #endif 3060 #if DEPTH_PACKING == 3200 3061 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 3062 #elif DEPTH_PACKING == 3201 3063 gl_FragColor = packDepthToRGBA( fragCoordZ ); 3064 #elif DEPTH_PACKING == 3202 3065 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 3066 #elif DEPTH_PACKING == 3203 3067 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 3068 #endif 3069}`,distance_vert:`#define DISTANCE 3070varying vec3 vWorldPosition; 3071#include <common> 3072#include <batching_pars_vertex> 3073#include <uv_pars_vertex> 3074#include <displacementmap_pars_vertex> 3075#include <morphtarget_pars_vertex> 3076#include <skinning_pars_vertex> 3077#include <clipping_planes_pars_vertex> 3078void main() { 3079 #include <uv_vertex> 3080 #include <batching_vertex> 3081 #include <skinbase_vertex> 3082 #include <morphinstance_vertex> 3083 #ifdef USE_DISPLACEMENTMAP 3084 #include <beginnormal_vertex> 3085 #include <morphnormal_vertex> 3086 #include <skinnormal_vertex> 3087 #endif 3088 #include <begin_vertex> 3089 #include <morphtarget_vertex> 3090 #include <skinning_vertex> 3091 #include <displacementmap_vertex> 3092 #include <project_vertex> 3093 #include <worldpos_vertex> 3094 #include <clipping_planes_vertex> 3095 vWorldPosition = worldPosition.xyz; 3096}`,distance_frag:`#define DISTANCE 3097uniform vec3 referencePosition; 3098uniform float nearDistance; 3099uniform float farDistance; 3100varying vec3 vWorldPosition; 3101#include <common> 3102#include <uv_pars_fragment> 3103#include <map_pars_fragment> 3104#include <alphamap_pars_fragment> 3105#include <alphatest_pars_fragment> 3106#include <alphahash_pars_fragment> 3107#include <clipping_planes_pars_fragment> 3108void main () { 3109 vec4 diffuseColor = vec4( 1.0 ); 3110 #include <clipping_planes_fragment> 3111 #include <map_fragment> 3112 #include <alphamap_fragment> 3113 #include <alphatest_fragment> 3114 #include <alphahash_fragment> 3115 float dist = length( vWorldPosition - referencePosition ); 3116 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 3117 dist = saturate( dist ); 3118 gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); 3119}`,equirect_vert:`varying vec3 vWorldDirection; 3120#include <common> 3121void main() { 3122 vWorldDirection = transformDirection( position, modelMatrix ); 3123 #include <begin_vertex> 3124 #include <project_vertex> 3125}`,equirect_frag:`uniform sampler2D tEquirect; 3126varying vec3 vWorldDirection; 3127#include <common> 3128void main() { 3129 vec3 direction = normalize( vWorldDirection ); 3130 vec2 sampleUV = equirectUv( direction ); 3131 gl_FragColor = texture2D( tEquirect, sampleUV ); 3132 #include <tonemapping_fragment> 3133 #include <colorspace_fragment> 3134}`,linedashed_vert:`uniform float scale; 3135attribute float lineDistance; 3136varying float vLineDistance; 3137#include <common> 3138#include <uv_pars_vertex> 3139#include <color_pars_vertex> 3140#include <fog_pars_vertex> 3141#include <morphtarget_pars_vertex> 3142#include <logdepthbuf_pars_vertex> 3143#include <clipping_planes_pars_vertex> 3144void main() { 3145 vLineDistance = scale * lineDistance; 3146 #include <uv_vertex> 3147 #include <color_vertex> 3148 #include <morphinstance_vertex> 3149 #include <morphcolor_vertex> 3150 #include <begin_vertex> 3151 #include <morphtarget_vertex> 3152 #include <project_vertex> 3153 #include <logdepthbuf_vertex> 3154 #include <clipping_planes_vertex> 3155 #include <fog_vertex> 3156}`,linedashed_frag:`uniform vec3 diffuse; 3157uniform float opacity; 3158uniform float dashSize; 3159uniform float totalSize; 3160varying float vLineDistance; 3161#include <common> 3162#include <color_pars_fragment> 3163#include <uv_pars_fragment> 3164#include <map_pars_fragment> 3165#include <fog_pars_fragment> 3166#include <logdepthbuf_pars_fragment> 3167#include <clipping_planes_pars_fragment> 3168void main() { 3169 vec4 diffuseColor = vec4( diffuse, opacity ); 3170 #include <clipping_planes_fragment> 3171 if ( mod( vLineDistance, totalSize ) > dashSize ) { 3172 discard; 3173 } 3174 vec3 outgoingLight = vec3( 0.0 ); 3175 #include <logdepthbuf_fragment> 3176 #include <map_fragment> 3177 #include <color_fragment> 3178 outgoingLight = diffuseColor.rgb; 3179 #include <opaque_fragment> 3180 #include <tonemapping_fragment> 3181 #include <colorspace_fragment> 3182 #include <fog_fragment> 3183 #include <premultiplied_alpha_fragment> 3184}`,meshbasic_vert:`#include <common> 3185#include <batching_pars_vertex> 3186#include <uv_pars_vertex> 3187#include <envmap_pars_vertex> 3188#include <color_pars_vertex> 3189#include <fog_pars_vertex> 3190#include <morphtarget_pars_vertex> 3191#include <skinning_pars_vertex> 3192#include <logdepthbuf_pars_vertex> 3193#include <clipping_planes_pars_vertex> 3194void main() { 3195 #include <uv_vertex> 3196 #include <color_vertex> 3197 #include <morphinstance_vertex> 3198 #include <morphcolor_vertex> 3199 #include <batching_vertex> 3200 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 3201 #include <beginnormal_vertex> 3202 #include <morphnormal_vertex> 3203 #include <skinbase_vertex> 3204 #include <skinnormal_vertex> 3205 #include <defaultnormal_vertex> 3206 #endif 3207 #include <begin_vertex> 3208 #include <morphtarget_vertex> 3209 #include <skinning_vertex> 3210 #include <project_vertex> 3211 #include <logdepthbuf_vertex> 3212 #include <clipping_planes_vertex> 3213 #include <worldpos_vertex> 3214 #include <envmap_vertex> 3215 #include <fog_vertex> 3216}`,meshbasic_frag:`uniform vec3 diffuse; 3217uniform float opacity; 3218#ifndef FLAT_SHADED 3219 varying vec3 vNormal; 3220#endif 3221#include <common> 3222#include <dithering_pars_fragment> 3223#include <color_pars_fragment> 3224#include <uv_pars_fragment> 3225#include <map_pars_fragment> 3226#include <alphamap_pars_fragment> 3227#include <alphatest_pars_fragment> 3228#include <alphahash_pars_fragment> 3229#include <aomap_pars_fragment> 3230#include <lightmap_pars_fragment> 3231#include <envmap_common_pars_fragment> 3232#include <envmap_pars_fragment> 3233#include <fog_pars_fragment> 3234#include <specularmap_pars_fragment> 3235#include <logdepthbuf_pars_fragment> 3236#include <clipping_planes_pars_fragment> 3237void main() { 3238 vec4 diffuseColor = vec4( diffuse, opacity ); 3239 #include <clipping_planes_fragment> 3240 #include <logdepthbuf_fragment> 3241 #include <map_fragment> 3242 #include <color_fragment> 3243 #include <alphamap_fragment> 3244 #include <alphatest_fragment> 3245 #include <alphahash_fragment> 3246 #include <specularmap_fragment> 3247 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3248 #ifdef USE_LIGHTMAP 3249 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 3250 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 3251 #else 3252 reflectedLight.indirectDiffuse += vec3( 1.0 ); 3253 #endif 3254 #include <aomap_fragment> 3255 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 3256 vec3 outgoingLight = reflectedLight.indirectDiffuse; 3257 #include <envmap_fragment> 3258 #include <opaque_fragment> 3259 #include <tonemapping_fragment> 3260 #include <colorspace_fragment> 3261 #include <fog_fragment> 3262 #include <premultiplied_alpha_fragment> 3263 #include <dithering_fragment> 3264}`,meshlambert_vert:`#define LAMBERT 3265varying vec3 vViewPosition; 3266#include <common> 3267#include <batching_pars_vertex> 3268#include <uv_pars_vertex> 3269#include <displacementmap_pars_vertex> 3270#include <envmap_pars_vertex> 3271#include <color_pars_vertex> 3272#include <fog_pars_vertex> 3273#include <normal_pars_vertex> 3274#include <morphtarget_pars_vertex> 3275#include <skinning_pars_vertex> 3276#include <shadowmap_pars_vertex> 3277#include <logdepthbuf_pars_vertex> 3278#include <clipping_planes_pars_vertex> 3279void main() { 3280 #include <uv_vertex> 3281 #include <color_vertex> 3282 #include <morphinstance_vertex> 3283 #include <morphcolor_vertex> 3284 #include <batching_vertex> 3285 #include <beginnormal_vertex> 3286 #include <morphnormal_vertex> 3287 #include <skinbase_vertex> 3288 #include <skinnormal_vertex> 3289 #include <defaultnormal_vertex> 3290 #include <normal_vertex> 3291 #include <begin_vertex> 3292 #include <morphtarget_vertex> 3293 #include <skinning_vertex> 3294 #include <displacementmap_vertex> 3295 #include <project_vertex> 3296 #include <logdepthbuf_vertex> 3297 #include <clipping_planes_vertex> 3298 vViewPosition = - mvPosition.xyz; 3299 #include <worldpos_vertex> 3300 #include <envmap_vertex> 3301 #include <shadowmap_vertex> 3302 #include <fog_vertex> 3303}`,meshlambert_frag:`#define LAMBERT 3304uniform vec3 diffuse; 3305uniform vec3 emissive; 3306uniform float opacity; 3307#include <common> 3308#include <dithering_pars_fragment> 3309#include <color_pars_fragment> 3310#include <uv_pars_fragment> 3311#include <map_pars_fragment> 3312#include <alphamap_pars_fragment> 3313#include <alphatest_pars_fragment> 3314#include <alphahash_pars_fragment> 3315#include <aomap_pars_fragment> 3316#include <lightmap_pars_fragment> 3317#include <emissivemap_pars_fragment> 3318#include <envmap_common_pars_fragment> 3319#include <envmap_pars_fragment> 3320#include <fog_pars_fragment> 3321#include <bsdfs> 3322#include <lights_pars_begin> 3323#include <normal_pars_fragment> 3324#include <lights_lambert_pars_fragment> 3325#include <shadowmap_pars_fragment> 3326#include <bumpmap_pars_fragment> 3327#include <normalmap_pars_fragment> 3328#include <specularmap_pars_fragment> 3329#include <logdepthbuf_pars_fragment> 3330#include <clipping_planes_pars_fragment> 3331void main() { 3332 vec4 diffuseColor = vec4( diffuse, opacity ); 3333 #include <clipping_planes_fragment> 3334 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3335 vec3 totalEmissiveRadiance = emissive; 3336 #include <logdepthbuf_fragment> 3337 #include <map_fragment> 3338 #include <color_fragment> 3339 #include <alphamap_fragment> 3340 #include <alphatest_fragment> 3341 #include <alphahash_fragment> 3342 #include <specularmap_fragment> 3343 #include <normal_fragment_begin> 3344 #include <normal_fragment_maps> 3345 #include <emissivemap_fragment> 3346 #include <lights_lambert_fragment> 3347 #include <lights_fragment_begin> 3348 #include <lights_fragment_maps> 3349 #include <lights_fragment_end> 3350 #include <aomap_fragment> 3351 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3352 #include <envmap_fragment> 3353 #include <opaque_fragment> 3354 #include <tonemapping_fragment> 3355 #include <colorspace_fragment> 3356 #include <fog_fragment> 3357 #include <premultiplied_alpha_fragment> 3358 #include <dithering_fragment> 3359}`,meshmatcap_vert:`#define MATCAP 3360varying vec3 vViewPosition; 3361#include <common> 3362#include <batching_pars_vertex> 3363#include <uv_pars_vertex> 3364#include <color_pars_vertex> 3365#include <displacementmap_pars_vertex> 3366#include <fog_pars_vertex> 3367#include <normal_pars_vertex> 3368#include <morphtarget_pars_vertex> 3369#include <skinning_pars_vertex> 3370#include <logdepthbuf_pars_vertex> 3371#include <clipping_planes_pars_vertex> 3372void main() { 3373 #include <uv_vertex> 3374 #include <color_vertex> 3375 #include <morphinstance_vertex> 3376 #include <morphcolor_vertex> 3377 #include <batching_vertex> 3378 #include <beginnormal_vertex> 3379 #include <morphnormal_vertex> 3380 #include <skinbase_vertex> 3381 #include <skinnormal_vertex> 3382 #include <defaultnormal_vertex> 3383 #include <normal_vertex> 3384 #include <begin_vertex> 3385 #include <morphtarget_vertex> 3386 #include <skinning_vertex> 3387 #include <displacementmap_vertex> 3388 #include <project_vertex> 3389 #include <logdepthbuf_vertex> 3390 #include <clipping_planes_vertex> 3391 #include <fog_vertex> 3392 vViewPosition = - mvPosition.xyz; 3393}`,meshmatcap_frag:`#define MATCAP 3394uniform vec3 diffuse; 3395uniform float opacity; 3396uniform sampler2D matcap; 3397varying vec3 vViewPosition; 3398#include <common> 3399#include <dithering_pars_fragment> 3400#include <color_pars_fragment> 3401#include <uv_pars_fragment> 3402#include <map_pars_fragment> 3403#include <alphamap_pars_fragment> 3404#include <alphatest_pars_fragment> 3405#include <alphahash_pars_fragment> 3406#include <fog_pars_fragment> 3407#include <normal_pars_fragment> 3408#include <bumpmap_pars_fragment> 3409#include <normalmap_pars_fragment> 3410#include <logdepthbuf_pars_fragment> 3411#include <clipping_planes_pars_fragment> 3412void main() { 3413 vec4 diffuseColor = vec4( diffuse, opacity ); 3414 #include <clipping_planes_fragment> 3415 #include <logdepthbuf_fragment> 3416 #include <map_fragment> 3417 #include <color_fragment> 3418 #include <alphamap_fragment> 3419 #include <alphatest_fragment> 3420 #include <alphahash_fragment> 3421 #include <normal_fragment_begin> 3422 #include <normal_fragment_maps> 3423 vec3 viewDir = normalize( vViewPosition ); 3424 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3425 vec3 y = cross( viewDir, x ); 3426 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3427 #ifdef USE_MATCAP 3428 vec4 matcapColor = texture2D( matcap, uv ); 3429 #else 3430 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3431 #endif 3432 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3433 #include <opaque_fragment> 3434 #include <tonemapping_fragment> 3435 #include <colorspace_fragment> 3436 #include <fog_fragment> 3437 #include <premultiplied_alpha_fragment> 3438 #include <dithering_fragment> 3439}`,meshnormal_vert:`#define NORMAL 3440#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3441 varying vec3 vViewPosition; 3442#endif 3443#include <common> 3444#include <batching_pars_vertex> 3445#include <uv_pars_vertex> 3446#include <displacementmap_pars_vertex> 3447#include <normal_pars_vertex> 3448#include <morphtarget_pars_vertex> 3449#include <skinning_pars_vertex> 3450#include <logdepthbuf_pars_vertex> 3451#include <clipping_planes_pars_vertex> 3452void main() { 3453 #include <uv_vertex> 3454 #include <batching_vertex> 3455 #include <beginnormal_vertex> 3456 #include <morphinstance_vertex> 3457 #include <morphnormal_vertex> 3458 #include <skinbase_vertex> 3459 #include <skinnormal_vertex> 3460 #include <defaultnormal_vertex> 3461 #include <normal_vertex> 3462 #include <begin_vertex> 3463 #include <morphtarget_vertex> 3464 #include <skinning_vertex> 3465 #include <displacementmap_vertex> 3466 #include <project_vertex> 3467 #include <logdepthbuf_vertex> 3468 #include <clipping_planes_vertex> 3469#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3470 vViewPosition = - mvPosition.xyz; 3471#endif 3472}`,meshnormal_frag:`#define NORMAL 3473uniform float opacity; 3474#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3475 varying vec3 vViewPosition; 3476#endif 3477#include <uv_pars_fragment> 3478#include <normal_pars_fragment> 3479#include <bumpmap_pars_fragment> 3480#include <normalmap_pars_fragment> 3481#include <logdepthbuf_pars_fragment> 3482#include <clipping_planes_pars_fragment> 3483void main() { 3484 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3485 #include <clipping_planes_fragment> 3486 #include <logdepthbuf_fragment> 3487 #include <normal_fragment_begin> 3488 #include <normal_fragment_maps> 3489 gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); 3490 #ifdef OPAQUE 3491 gl_FragColor.a = 1.0; 3492 #endif 3493}`,meshphong_vert:`#define PHONG 3494varying vec3 vViewPosition; 3495#include <common> 3496#include <batching_pars_vertex> 3497#include <uv_pars_vertex> 3498#include <displacementmap_pars_vertex> 3499#include <envmap_pars_vertex> 3500#include <color_pars_vertex> 3501#include <fog_pars_vertex> 3502#include <normal_pars_vertex> 3503#include <morphtarget_pars_vertex> 3504#include <skinning_pars_vertex> 3505#include <shadowmap_pars_vertex> 3506#include <logdepthbuf_pars_vertex> 3507#include <clipping_planes_pars_vertex> 3508void main() { 3509 #include <uv_vertex> 3510 #include <color_vertex> 3511 #include <morphcolor_vertex> 3512 #include <batching_vertex> 3513 #include <beginnormal_vertex> 3514 #include <morphinstance_vertex> 3515 #include <morphnormal_vertex> 3516 #include <skinbase_vertex> 3517 #include <skinnormal_vertex> 3518 #include <defaultnormal_vertex> 3519 #include <normal_vertex> 3520 #include <begin_vertex> 3521 #include <morphtarget_vertex> 3522 #include <skinning_vertex> 3523 #include <displacementmap_vertex> 3524 #include <project_vertex> 3525 #include <logdepthbuf_vertex> 3526 #include <clipping_planes_vertex> 3527 vViewPosition = - mvPosition.xyz; 3528 #include <worldpos_vertex> 3529 #include <envmap_vertex> 3530 #include <shadowmap_vertex> 3531 #include <fog_vertex> 3532}`,meshphong_frag:`#define PHONG 3533uniform vec3 diffuse; 3534uniform vec3 emissive; 3535uniform vec3 specular; 3536uniform float shininess; 3537uniform float opacity; 3538#include <common> 3539#include <dithering_pars_fragment> 3540#include <color_pars_fragment> 3541#include <uv_pars_fragment> 3542#include <map_pars_fragment> 3543#include <alphamap_pars_fragment> 3544#include <alphatest_pars_fragment> 3545#include <alphahash_pars_fragment> 3546#include <aomap_pars_fragment> 3547#include <lightmap_pars_fragment> 3548#include <emissivemap_pars_fragment> 3549#include <envmap_common_pars_fragment> 3550#include <envmap_pars_fragment> 3551#include <fog_pars_fragment> 3552#include <bsdfs> 3553#include <lights_pars_begin> 3554#include <normal_pars_fragment> 3555#include <lights_phong_pars_fragment> 3556#include <shadowmap_pars_fragment> 3557#include <bumpmap_pars_fragment> 3558#include <normalmap_pars_fragment> 3559#include <specularmap_pars_fragment> 3560#include <logdepthbuf_pars_fragment> 3561#include <clipping_planes_pars_fragment> 3562void main() { 3563 vec4 diffuseColor = vec4( diffuse, opacity ); 3564 #include <clipping_planes_fragment> 3565 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3566 vec3 totalEmissiveRadiance = emissive; 3567 #include <logdepthbuf_fragment> 3568 #include <map_fragment> 3569 #include <color_fragment> 3570 #include <alphamap_fragment> 3571 #include <alphatest_fragment> 3572 #include <alphahash_fragment> 3573 #include <specularmap_fragment> 3574 #include <normal_fragment_begin> 3575 #include <normal_fragment_maps> 3576 #include <emissivemap_fragment> 3577 #include <lights_phong_fragment> 3578 #include <lights_fragment_begin> 3579 #include <lights_fragment_maps> 3580 #include <lights_fragment_end> 3581 #include <aomap_fragment> 3582 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3583 #include <envmap_fragment> 3584 #include <opaque_fragment> 3585 #include <tonemapping_fragment> 3586 #include <colorspace_fragment> 3587 #include <fog_fragment> 3588 #include <premultiplied_alpha_fragment> 3589 #include <dithering_fragment> 3590}`,meshphysical_vert:`#define STANDARD 3591varying vec3 vViewPosition; 3592#ifdef USE_TRANSMISSION 3593 varying vec3 vWorldPosition; 3594#endif 3595#include <common> 3596#include <batching_pars_vertex> 3597#include <uv_pars_vertex> 3598#include <displacementmap_pars_vertex> 3599#include <color_pars_vertex> 3600#include <fog_pars_vertex> 3601#include <normal_pars_vertex> 3602#include <morphtarget_pars_vertex> 3603#include <skinning_pars_vertex> 3604#include <shadowmap_pars_vertex> 3605#include <logdepthbuf_pars_vertex> 3606#include <clipping_planes_pars_vertex> 3607void main() { 3608 #include <uv_vertex> 3609 #include <color_vertex> 3610 #include <morphinstance_vertex> 3611 #include <morphcolor_vertex> 3612 #include <batching_vertex> 3613 #include <beginnormal_vertex> 3614 #include <morphnormal_vertex> 3615 #include <skinbase_vertex> 3616 #include <skinnormal_vertex> 3617 #include <defaultnormal_vertex> 3618 #include <normal_vertex> 3619 #include <begin_vertex> 3620 #include <morphtarget_vertex> 3621 #include <skinning_vertex> 3622 #include <displacementmap_vertex> 3623 #include <project_vertex> 3624 #include <logdepthbuf_vertex> 3625 #include <clipping_planes_vertex> 3626 vViewPosition = - mvPosition.xyz; 3627 #include <worldpos_vertex> 3628 #include <shadowmap_vertex> 3629 #include <fog_vertex> 3630#ifdef USE_TRANSMISSION 3631 vWorldPosition = worldPosition.xyz; 3632#endif 3633}`,meshphysical_frag:`#define STANDARD 3634#ifdef PHYSICAL 3635 #define IOR 3636 #define USE_SPECULAR 3637#endif 3638uniform vec3 diffuse; 3639uniform vec3 emissive; 3640uniform float roughness; 3641uniform float metalness; 3642uniform float opacity; 3643#ifdef IOR 3644 uniform float ior; 3645#endif 3646#ifdef USE_SPECULAR 3647 uniform float specularIntensity; 3648 uniform vec3 specularColor; 3649 #ifdef USE_SPECULAR_COLORMAP 3650 uniform sampler2D specularColorMap; 3651 #endif 3652 #ifdef USE_SPECULAR_INTENSITYMAP 3653 uniform sampler2D specularIntensityMap; 3654 #endif 3655#endif 3656#ifdef USE_CLEARCOAT 3657 uniform float clearcoat; 3658 uniform float clearcoatRoughness; 3659#endif 3660#ifdef USE_DISPERSION 3661 uniform float dispersion; 3662#endif 3663#ifdef USE_IRIDESCENCE 3664 uniform float iridescence; 3665 uniform float iridescenceIOR; 3666 uniform float iridescenceThicknessMinimum; 3667 uniform float iridescenceThicknessMaximum; 3668#endif 3669#ifdef USE_SHEEN 3670 uniform vec3 sheenColor; 3671 uniform float sheenRoughness; 3672 #ifdef USE_SHEEN_COLORMAP 3673 uniform sampler2D sheenColorMap; 3674 #endif 3675 #ifdef USE_SHEEN_ROUGHNESSMAP 3676 uniform sampler2D sheenRoughnessMap; 3677 #endif 3678#endif 3679#ifdef USE_ANISOTROPY 3680 uniform vec2 anisotropyVector; 3681 #ifdef USE_ANISOTROPYMAP 3682 uniform sampler2D anisotropyMap; 3683 #endif 3684#endif 3685varying vec3 vViewPosition; 3686#include <common> 3687#include <dithering_pars_fragment> 3688#include <color_pars_fragment> 3689#include <uv_pars_fragment> 3690#include <map_pars_fragment> 3691#include <alphamap_pars_fragment> 3692#include <alphatest_pars_fragment> 3693#include <alphahash_pars_fragment> 3694#include <aomap_pars_fragment> 3695#include <lightmap_pars_fragment> 3696#include <emissivemap_pars_fragment> 3697#include <iridescence_fragment> 3698#include <cube_uv_reflection_fragment> 3699#include <envmap_common_pars_fragment> 3700#include <envmap_physical_pars_fragment> 3701#include <fog_pars_fragment> 3702#include <lights_pars_begin> 3703#include <normal_pars_fragment> 3704#include <lights_physical_pars_fragment> 3705#include <transmission_pars_fragment> 3706#include <shadowmap_pars_fragment> 3707#include <bumpmap_pars_fragment> 3708#include <normalmap_pars_fragment> 3709#include <clearcoat_pars_fragment> 3710#include <iridescence_pars_fragment> 3711#include <roughnessmap_pars_fragment> 3712#include <metalnessmap_pars_fragment> 3713#include <logdepthbuf_pars_fragment> 3714#include <clipping_planes_pars_fragment> 3715void main() { 3716 vec4 diffuseColor = vec4( diffuse, opacity ); 3717 #include <clipping_planes_fragment> 3718 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3719 vec3 totalEmissiveRadiance = emissive; 3720 #include <logdepthbuf_fragment> 3721 #include <map_fragment> 3722 #include <color_fragment> 3723 #include <alphamap_fragment> 3724 #include <alphatest_fragment> 3725 #include <alphahash_fragment> 3726 #include <roughnessmap_fragment> 3727 #include <metalnessmap_fragment> 3728 #include <normal_fragment_begin> 3729 #include <normal_fragment_maps> 3730 #include <clearcoat_normal_fragment_begin> 3731 #include <clearcoat_normal_fragment_maps> 3732 #include <emissivemap_fragment> 3733 #include <lights_physical_fragment> 3734 #include <lights_fragment_begin> 3735 #include <lights_fragment_maps> 3736 #include <lights_fragment_end> 3737 #include <aomap_fragment> 3738 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3739 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3740 #include <transmission_fragment> 3741 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3742 #ifdef USE_SHEEN 3743 3744 outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; 3745 3746 #endif 3747 #ifdef USE_CLEARCOAT 3748 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3749 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3750 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3751 #endif 3752 #include <opaque_fragment> 3753 #include <tonemapping_fragment> 3754 #include <colorspace_fragment> 3755 #include <fog_fragment> 3756 #include <premultiplied_alpha_fragment> 3757 #include <dithering_fragment> 3758}`,meshtoon_vert:`#define TOON 3759varying vec3 vViewPosition; 3760#include <common> 3761#include <batching_pars_vertex> 3762#include <uv_pars_vertex> 3763#include <displacementmap_pars_vertex> 3764#include <color_pars_vertex> 3765#include <fog_pars_vertex> 3766#include <normal_pars_vertex> 3767#include <morphtarget_pars_vertex> 3768#include <skinning_pars_vertex> 3769#include <shadowmap_pars_vertex> 3770#include <logdepthbuf_pars_vertex> 3771#include <clipping_planes_pars_vertex> 3772void main() { 3773 #include <uv_vertex> 3774 #include <color_vertex> 3775 #include <morphinstance_vertex> 3776 #include <morphcolor_vertex> 3777 #include <batching_vertex> 3778 #include <beginnormal_vertex> 3779 #include <morphnormal_vertex> 3780 #include <skinbase_vertex> 3781 #include <skinnormal_vertex> 3782 #include <defaultnormal_vertex> 3783 #include <normal_vertex> 3784 #include <begin_vertex> 3785 #include <morphtarget_vertex> 3786 #include <skinning_vertex> 3787 #include <displacementmap_vertex> 3788 #include <project_vertex> 3789 #include <logdepthbuf_vertex> 3790 #include <clipping_planes_vertex> 3791 vViewPosition = - mvPosition.xyz; 3792 #include <worldpos_vertex> 3793 #include <shadowmap_vertex> 3794 #include <fog_vertex> 3795}`,meshtoon_frag:`#define TOON 3796uniform vec3 diffuse; 3797uniform vec3 emissive; 3798uniform float opacity; 3799#include <common> 3800#include <dithering_pars_fragment> 3801#include <color_pars_fragment> 3802#include <uv_pars_fragment> 3803#include <map_pars_fragment> 3804#include <alphamap_pars_fragment> 3805#include <alphatest_pars_fragment> 3806#include <alphahash_pars_fragment> 3807#include <aomap_pars_fragment> 3808#include <lightmap_pars_fragment> 3809#include <emissivemap_pars_fragment> 3810#include <gradientmap_pars_fragment> 3811#include <fog_pars_fragment> 3812#include <bsdfs> 3813#include <lights_pars_begin> 3814#include <normal_pars_fragment> 3815#include <lights_toon_pars_fragment> 3816#include <shadowmap_pars_fragment> 3817#include <bumpmap_pars_fragment> 3818#include <normalmap_pars_fragment> 3819#include <logdepthbuf_pars_fragment> 3820#include <clipping_planes_pars_fragment> 3821void main() { 3822 vec4 diffuseColor = vec4( diffuse, opacity ); 3823 #include <clipping_planes_fragment> 3824 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3825 vec3 totalEmissiveRadiance = emissive; 3826 #include <logdepthbuf_fragment> 3827 #include <map_fragment> 3828 #include <color_fragment> 3829 #include <alphamap_fragment> 3830 #include <alphatest_fragment> 3831 #include <alphahash_fragment> 3832 #include <normal_fragment_begin> 3833 #include <normal_fragment_maps> 3834 #include <emissivemap_fragment> 3835 #include <lights_toon_fragment> 3836 #include <lights_fragment_begin> 3837 #include <lights_fragment_maps> 3838 #include <lights_fragment_end> 3839 #include <aomap_fragment> 3840 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3841 #include <opaque_fragment> 3842 #include <tonemapping_fragment> 3843 #include <colorspace_fragment> 3844 #include <fog_fragment> 3845 #include <premultiplied_alpha_fragment> 3846 #include <dithering_fragment> 3847}`,points_vert:`uniform float size; 3848uniform float scale; 3849#include <common> 3850#include <color_pars_vertex> 3851#include <fog_pars_vertex> 3852#include <morphtarget_pars_vertex> 3853#include <logdepthbuf_pars_vertex> 3854#include <clipping_planes_pars_vertex> 3855#ifdef USE_POINTS_UV 3856 varying vec2 vUv; 3857 uniform mat3 uvTransform; 3858#endif 3859void main() { 3860 #ifdef USE_POINTS_UV 3861 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3862 #endif 3863 #include <color_vertex> 3864 #include <morphinstance_vertex> 3865 #include <morphcolor_vertex> 3866 #include <begin_vertex> 3867 #include <morphtarget_vertex> 3868 #include <project_vertex> 3869 gl_PointSize = size; 3870 #ifdef USE_SIZEATTENUATION 3871 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3872 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3873 #endif 3874 #include <logdepthbuf_vertex> 3875 #include <clipping_planes_vertex> 3876 #include <worldpos_vertex> 3877 #include <fog_vertex> 3878}`,points_frag:`uniform vec3 diffuse; 3879uniform float opacity; 3880#include <common> 3881#include <color_pars_fragment> 3882#include <map_particle_pars_fragment> 3883#include <alphatest_pars_fragment> 3884#include <alphahash_pars_fragment> 3885#include <fog_pars_fragment> 3886#include <logdepthbuf_pars_fragment> 3887#include <clipping_planes_pars_fragment> 3888void main() { 3889 vec4 diffuseColor = vec4( diffuse, opacity ); 3890 #include <clipping_planes_fragment> 3891 vec3 outgoingLight = vec3( 0.0 ); 3892 #include <logdepthbuf_fragment> 3893 #include <map_particle_fragment> 3894 #include <color_fragment> 3895 #include <alphatest_fragment> 3896 #include <alphahash_fragment> 3897 outgoingLight = diffuseColor.rgb; 3898 #include <opaque_fragment> 3899 #include <tonemapping_fragment> 3900 #include <colorspace_fragment> 3901 #include <fog_fragment> 3902 #include <premultiplied_alpha_fragment> 3903}`,shadow_vert:`#include <common> 3904#include <batching_pars_vertex> 3905#include <fog_pars_vertex> 3906#include <morphtarget_pars_vertex> 3907#include <skinning_pars_vertex> 3908#include <logdepthbuf_pars_vertex> 3909#include <shadowmap_pars_vertex> 3910void main() { 3911 #include <batching_vertex> 3912 #include <beginnormal_vertex> 3913 #include <morphinstance_vertex> 3914 #include <morphnormal_vertex> 3915 #include <skinbase_vertex> 3916 #include <skinnormal_vertex> 3917 #include <defaultnormal_vertex> 3918 #include <begin_vertex> 3919 #include <morphtarget_vertex> 3920 #include <skinning_vertex> 3921 #include <project_vertex> 3922 #include <logdepthbuf_vertex> 3923 #include <worldpos_vertex> 3924 #include <shadowmap_vertex> 3925 #include <fog_vertex> 3926}`,shadow_frag:`uniform vec3 color; 3927uniform float opacity; 3928#include <common> 3929#include <fog_pars_fragment> 3930#include <bsdfs> 3931#include <lights_pars_begin> 3932#include <logdepthbuf_pars_fragment> 3933#include <shadowmap_pars_fragment> 3934#include <shadowmask_pars_fragment> 3935void main() { 3936 #include <logdepthbuf_fragment> 3937 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3938 #include <tonemapping_fragment> 3939 #include <colorspace_fragment> 3940 #include <fog_fragment> 3941}`,sprite_vert:`uniform float rotation; 3942uniform vec2 center; 3943#include <common> 3944#include <uv_pars_vertex> 3945#include <fog_pars_vertex> 3946#include <logdepthbuf_pars_vertex> 3947#include <clipping_planes_pars_vertex> 3948void main() { 3949 #include <uv_vertex> 3950 vec4 mvPosition = modelViewMatrix[ 3 ]; 3951 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3952 #ifndef USE_SIZEATTENUATION 3953 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3954 if ( isPerspective ) scale *= - mvPosition.z; 3955 #endif 3956 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3957 vec2 rotatedPosition; 3958 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3959 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3960 mvPosition.xy += rotatedPosition; 3961 gl_Position = projectionMatrix * mvPosition; 3962 #include <logdepthbuf_vertex> 3963 #include <clipping_planes_vertex> 3964 #include <fog_vertex> 3965}`,sprite_frag:`uniform vec3 diffuse; 3966uniform float opacity; 3967#include <common> 3968#include <uv_pars_fragment> 3969#include <map_pars_fragment> 3970#include <alphamap_pars_fragment> 3971#include <alphatest_pars_fragment> 3972#include <alphahash_pars_fragment> 3973#include <fog_pars_fragment> 3974#include <logdepthbuf_pars_fragment> 3975#include <clipping_planes_pars_fragment> 3976void main() { 3977 vec4 diffuseColor = vec4( diffuse, opacity ); 3978 #include <clipping_planes_fragment> 3979 vec3 outgoingLight = vec3( 0.0 ); 3980 #include <logdepthbuf_fragment> 3981 #include <map_fragment> 3982 #include <alphamap_fragment> 3983 #include <alphatest_fragment> 3984 #include <alphahash_fragment> 3985 outgoingLight = diffuseColor.rgb; 3986 #include <opaque_fragment> 3987 #include <tonemapping_fragment> 3988 #include <colorspace_fragment> 3989 #include <fog_fragment> 3990}`},
vendor: 783 bytes, line 3990
3990$={common:{diffuse:{value:new Z(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Zm},alphaMap:{value:null},alphaMapTransform:{value:new Zm},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Zm}},envmap:{envMap:{value:null},envMapRotation:{value:new Zm},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Zm}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Zm}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Zm},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Zm},normalScale:{value:new Y(1,1)}}
vendor: 7,383 bytes, line 3990
3990,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Zm},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Zm}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Zm}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Zm}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Z(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Z(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Zm},alphaTest:{value:0},uvTransform:{value:new Zm}},sprite:{diffuse:{value:new Z(16777215)},opacity:{value:1},center:{value:new Y(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Zm},alphaMap:{value:null},alphaMapTransform:{value:new Zm},alphaTest:{value:0}}},oT={basic:{uniforms:A_([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.fog]),vertexShader:aT.meshbasic_vert,fragmentShader:aT.meshbasic_frag},lambert:{uniforms:A_([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new Z(0)}}]),vertexShader:aT.meshlambert_vert,fragmentShader:aT.meshlambert_frag},phong:{uniforms:A_([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new Z(0)},specular:{value:new Z(1118481)},shininess:{value:30}}]),vertexShader:aT.meshphong_vert,fragmentShader:aT.meshphong_frag},standard:{uniforms:A_([$.common,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.roughnessmap,$.metalnessmap,$.fog,$.lights,{emissive:{value:new Z(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:aT.meshphysical_vert,fragmentShader:aT.meshphysical_frag},toon:{uniforms:A_([$.common,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.gradientmap,$.fog,$.lights,{emissive:{value:new Z(0)}}]),vertexShader:aT.meshtoon_vert,fragmentShader:aT.meshtoon_frag},matcap:{uniforms:A_([$.common,$.bumpmap,$.normalmap,$.displacementmap,$.fog,{matcap:{value:null}}]),vertexShader:aT.meshmatcap_vert,fragmentShader:aT.meshmatcap_frag},points:{uniforms:A_([$.points,$.fog]),vertexShader:aT.points_vert,fragmentShader:aT.points_frag},dashed:{uniforms:A_([$.common,$.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:aT.linedashed_vert,fragmentShader:aT.linedashed_frag},depth:{uniforms:A_([$.common,$.displacementmap]),vertexShader:aT.depth_vert,fragmentShader:aT.depth_frag},normal:{uniforms:A_([$.common,$.bumpmap,$.normalmap,$.displacementmap,{opacity:{value:1}}]),vertexShader:aT.meshnormal_vert,fragmentShader:aT.meshnormal_frag},sprite:{uniforms:A_([$.sprite,$.fog]),vertexShader:aT.sprite_vert,fragmentShader:aT.sprite_frag},background:{uniforms:{uvTransform:{value:new Zm},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:aT.background_vert,fragmentShader:aT.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Zm}},vertexShader:aT.backgroundCube_vert,fragmentShader:aT.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:aT.cube_vert,fragmentShader:aT.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:aT.equirect_vert,fragmentShader:aT.equirect_frag},distance:{uniforms:A_([$.common,$.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:aT.distance_vert,fragmentShader:aT.distance_frag},shadow:{uniforms:A_([$.lights,$.fog,{color:{value:new Z(0)},opacity:{value:1}}]),vertexShader:aT.shadow_vert,fragmentShader:aT.shadow_frag}};oT.physical={uniforms:A_([oT.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Zm},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Zm},clearcoatNormalScale:{value:new Y(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Zm},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Zm},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Zm},sheen:{value:0},sheenColor:{value:new Z(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Zm},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Zm},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Zm},transmissionSamplerSize:{value:new Y},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Zm},attenuationDistance:{value:0},attenuationColor:{value:new Z(0)},specularColor:{value:new Z(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Zm},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Zm},anisotropyVector:{value:new Y},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Zm}}]),vertexShader:aT.meshphysical_vert,fragmentShader:aT.meshphysical_frag};var sT={r:0,b:0,g:0},cT=new rg,lT=new qh;function uT(e,t,n,r,i,a,o){let s=new Z(0),c=a===!0?0:1,l,u,d=null,f=0,p=null;function m(e){let r=e.isScene===!0?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function h(t){let n=!1,i=m(t);i===null?_(s,c):i&&i.isColor&&(_(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();a===`additive`?r.buffers.color.setClear(0,0,0,1,o):a===`alpha-blend`&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function g(t,n){let r=m(n);r&&(r.isCubeTexture||r.mapping===306)?(u===void 0&&(u=new T_(new O_(1,1,1),new I_({name:`Backgroun
3990dCubeMaterial`,uniforms:k_(oT.backgroundCube.uniforms),vertexShader:oT.backgroundCube.vertexShader,fragmentShader:oT.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute(`normal`),u.geometry.deleteAttribute(`uv`),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,`envMap`,{get:function(){return this.uniforms.envMap.value}}),i.update(u)),cT.copy(n.backgroundRotation),cT.x*=-1,cT.y*=-1,cT.z*=-1,r.isCubeTexture&&r.isRenderTargetTexture===!1&&(cT.y*=-1,cT.z*=-1),u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture&&r.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(lT.makeRotationFromEuler(cT)),u.material.toneMapped=nh.getTransfer(r.colorSpace)!==Lp,(d!==r||f!==r.version||p!==e.toneMapping)&&(u.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),u.layers.enableAll(),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(l===void 0&&(l=new T_(new Ox(2,2),new I_({name:`BackgroundMaterial`,uniforms:k_(oT.background.uniforms),vertexShader:oT.background.vertexShader,fragmentShader:oT.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),Object.defineProperty(l.material,`map`,{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=nh.getTransfer(r.colorSpace)!==Lp,r.matrixAutoUpdate===!0&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),(d!==r||f!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}function _(t,n){t.getRGB(sT,M_(e)),r.buffers.color.setClear(sT.r,sT.g,sT.b,n,o)}function v(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),c=t,_(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,_(s,c)},render:h,addToRenderList:g,dispose:v}}function dT(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n){let i=n.wireframe===!0,a=r[e.id];a===void 0&&(a={},r[e.id]=a);let o=a[t.id];o===void 0&&(o={},a[t.id]=o);let s=o[i];return s===void 0&&(s=f(c()),o[i]=s),s}function f(e){let t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function p(e,t,n,r){let i=a.attributes,o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function g(e){_(e,0)}function _(t,n){let r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,i[t]===0&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function v(){let t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,r,i,a,o,s){s===!0?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function b(n,r,i,a){h();let o=a.attributes,s=i.getAttributes(),c=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)_(i.location+e,t.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,c*d,(p+o/i.locationSize*e)*d,f)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)_(i.location+e,s.meshPerAttribute);n.isInstancedMesh!==!0&&a._maxInstanceCount===void 0&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<i.locationSize;e++)g(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,l);for(let e=0;e<i.locationSize;e++)y(i.location+e,o/i.locationSize,u,r,o*d,o/i.locationSize*e*d,f)}}else if(c!==void 0){let t=c[r];if(t!==void 0)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}v()}function x(){for(let e in w(),r){let t=r[e];for(let e in t){let n=t[e];for(let e in n)u(n[e].object),delete n[e];delete t[e]}delete r[e]}}function S(e){if(r[e.id]===void 0)return;let t=r[e.id];for(let e in t){let n=t[e];for(let e in n)u(n[e].object),delete n[e];delete t[e]}delete r[e.id]}function C(e){for(let t in r){let n=r[t];if(n[e.id]===void 0)continue;let i=n[e.id];for(let e in i)u(i[e].object),delete i[e];delete n[e.id]}}function w(){T(),o=!0,a!==i&&(a=i,l(a.object))}function T(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:s,reset:w,resetDefaultState:T,dispose:x,releaseStatesOfGeometry:S,releaseStatesOfProgram:C,initAttributes:h,enableAttribute:g,disableUnusedAttributes:v}}function fT(e,t,n){let r;function i(e){r=e}function a(t,i){e.drawArrays(r,t,i),n.update(i,r,1)}function o(t,i,a){a!==0&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}function s(e,i,a){if(a===0)return;t.get(`WEBGL_multi_draw`).multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let e=0;e<a;e++)o+=i[e];n.update(o,r,1)}
vendor: 7,298 bytes, line 3990
3990function c(e,i,a,s){if(a===0)return;let c=t.get(`WEBGL_multi_draw`);if(c===null)for(let t=0;t<e.length;t++)o(e[t],i[t],s[t]);else{c.multiDrawArraysInstancedWEBGL(r,e,0,i,0,s,0,a);let t=0;for(let e=0;e<a;e++)t+=i[e]*s[e];n.update(t,r,1)}}this.setMode=i,this.render=a,this.renderInstances=o,this.renderMultiDraw=s,this.renderMultiDrawInstances=c}function pT(e,t,n,r){let i;function a(){if(i!==void 0)return i;if(t.has(`EXT_texture_filter_anisotropic`)===!0){let n=t.get(`EXT_texture_filter_anisotropic`);i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(t){return!(t!==1023&&r.convert(t)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT))}function s(n){let i=n===1016&&(t.has(`EXT_color_buffer_half_float`)||t.has(`EXT_color_buffer_float`));return!(n!==1009&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==1015&&!i)}function c(t){if(t===`highp`){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(J(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`),p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function mT(e){let t=this,n=null,r=0,i=!1,a=!1,o=new Jv,s=new Zm,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length<t)&&(l=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}c.value=l,c.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,l}}function hT(e){let t=new WeakMap;function n(e,t){return t===303?e.mapping=301:t===304&&(e.mapping=302),e}function r(r){if(r&&r.isTexture){let a=r.mapping;if(a===303||a===304)if(t.has(r)){let e=t.get(r).texture;return n(e,r.mapping)}else{let a=r.image;if(a&&a.height>0){let o=new K_(a.height);return o.fromEquirectangularTexture(e,r),t.set(r,o),r.addEventListener(`dispose`,i),n(o.texture,r.mapping)}else return null}}return r}function i(e){let n=e.target;n.removeEventListener(`dispose`,i);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function a(){t=new WeakMap}return{get:r,dispose:a}}var gT=4,_T=[.125,.215,.35,.446,.526,.582],vT=20,yT=256,bT=new WS,xT=new Z,ST=null,CT=0,wT=0,TT=!1,ET=new X,DT=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=ET}=i;ST=this._renderer.getRenderTarget(),CT=this._renderer.getActiveCubeFace(),wT=this._renderer.getActiveMipmapLevel(),TT=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=PT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=NT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(ST,CT,wT),this._renderer.xr.enabled=TT,e.scissorTest=!1,AT(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===301||e.mapping===302?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ST=this._renderer.getRenderTarget(),CT=this._renderer.getActiveCubeFace(),wT=this._renderer.getActiveMipmapLevel(),TT=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:cf,minFilter:cf,generateMipmaps:!1,type:bf,format:Of,colorSpace:Fp,depthBuffer:!1},r=kT(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=kT(e,t,n);let{_lodMax:r}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=OT(r)),this._blurMaterial=MT(r,e,t),this._ggxMaterial=jT(r,e,t)}return r}_compileMaterial(e){let t=new T_(new p_,e);this._renderer.compile(t,bT)}_sceneToCubeUV(e,t,n,r,i){let a=new V_(90,1,t,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],c=this._renderer,l=c.autoClear,u=c.toneMapping;c.getClearColor(xT),c.toneMapping=0,c.autoClear=!1,c.state.buffers.depth.getReversed()&&(c.setRenderTarget(r),c.clearDepth(),c.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new T_(new O_,new Hg({name:`PMREM.Backgroun
3990d`,side:1,depthWrite:!1,depthTest:!1})));let d=this._backgroundBox,f=d.material,p=!1,m=e.background;m?m.isColor&&(f.color.copy(m),e.background=null,p=!0):(f.color.copy(xT),p=!0);for(let t=0;t<6;t++){let n=t%3;n===0?(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x+s[t],i.y,i.z)):n===1?(a.up.set(0,0,o[t]),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y+s[t],i.z)):(a.up.set(0,o[t],0),a.position.set(i.x,i.y,i.z),a.lookAt(i.x,i.y,i.z+s[t]));let l=this._cubeSize;AT(r,n*l,t>2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=PT()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=NT());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;AT(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,bT)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;t<r;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let r=this._renderer,i=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;let s=a.uniforms,c=n/(this._lodMeshes.length-1),l=t/(this._lodMeshes.length-1),u=Math.sqrt(c*c-l*l)*(0+c*1.25),{_lodMax:d}=this,f=this._sizeLods[n],p=3*f*(n>d-gT?n-d+gT:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,AT(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,bT),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,AT(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,bT)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&_m(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/(2*vT-1),p=i/f,m=isFinite(i)?1+Math.floor(3*p):vT;m>vT&&J(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${vT}`);let h=[],g=0;for(let e=0;e<vT;++e){let t=e/p,n=Math.exp(-t*t/2);h.push(n),e===0?g+=n:e<m&&(g+=2*n)}for(let e=0;e<h.length;e++)h[e]=h[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=h,u.latitudinal.value=a===`latitudinal`,o&&(u.poleAxis.value=o);let{_lodMax:_}=this;u.dTheta.value=f,u.mipInt.value=_-n;let v=this._sizeLods[r];AT(t,3*v*(r>_-gT?r-_+gT:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,bT)}};function OT(e){let t=[],n=[],r=[],i=e,a=e-gT+1+_T.length;for(let o=0;o<a;o++){let a=2**i;t.push(a);let s=1/a;o>e-gT?s=_T[o-e+gT-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new p_;h.setAttribute(`position`,new Zg(f,3)),h.setAttribute(`uv`,new Zg(p,2)),h.setAttribute(`faceIndex`,new Zg(m,1)),r.push(new T_(h,null)),i>gT&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function kT(e,t,n){let r=new hh(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function AT(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function jT(e,t,n){return new I_({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:yT,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:FT(),fragmentShader:` 3991 3992 precision highp float; 3993 precision highp int; 3994 3995 varying vec3 vOutputDirection; 3996 3997 uniform sampler2D envMap; 3998 uniform float roughness; 3999 uniform float mipInt; 4000 4001 #define ENVMAP_TYPE_CUBE_UV 4002 #include <cube_uv_reflection_fragment> 4003 4004 #define PI 3.14159265359 4005 4006 // Van der Corput radical inverse 4007 float radicalInverse_VdC(uint bits) { 4008 bits = (bits << 16u) | (bits >> 16u); 4009 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); 4010 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); 4011 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); 4012 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); 4013 return float(bits) * 2.3283064365386963e-10; // / 0x100000000 4014 } 4015 4016 // Hammersley sequence 4017 vec2 hammersley(uint i, uint N) { 4018 return vec2(float(i) / float(N), radicalInverse_VdC(i)); 4019 } 4020 4021 // GGX VNDF importance sampling (Eric Heitz 2018) 4022 // "Sampling the GGX Distribution of Visible Normals" 4023 // https://jcgt.org/published/0007/04/01/ 4024 vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { 4025 float alpha = roughness * roughness; 4026 4027 // Section 3.2: Transform view direction to hemisphere configuration 4028 vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); 4029 4030 // Section 4.1: Orthonormal basis 4031 float lensq = Vh.x * Vh.x + Vh.y * Vh.y; 4032 vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); 4033 vec3 T2 = cross(Vh, T1); 4034 4035 // Section 4.2: Parameterization of projected area 4036 float r = sqrt(Xi.x); 4037 float phi = 2.0 * PI * Xi.y; 4038 float t1 = r * cos(phi); 4039 float t2 = r * sin(phi); 4040 float s = 0.5 * (1.0 + Vh.z); 4041 t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; 4042 4043 // Section 4.3: Reprojection onto hemisphere 4044 vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; 4045 4046 // Section 3.4: Transform back to ellipsoid configuration 4047 return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); 4048 } 4049 4050 void main() { 4051 vec3 N = normalize(vOutputDirection); 4052 vec3 V = N; // Assume view direction equals normal for pre-filtering 4053 4054 vec3 prefilteredColor = vec3(0.0); 4055 float totalWeight = 0.0; 4056 4057 // For very low roughness, just sample the environment directly 4058 if (roughness < 0.001) { 4059 gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); 4060 return; 4061 } 4062 4063 // Tangent space basis for VNDF sampling 4064 vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); 4065 vec3 tangent = normalize(cross(up, N)); 4066 vec3 bitangent = cross(N, tangent); 4067
4068 for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { 4069 vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); 4070 4071 // For PMREM, V = N, so in tangent space V is always (0, 0, 1) 4072 vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); 4073 4074 // Transform H back to world space 4075 vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); 4076 vec3 L = normalize(2.0 * dot(V, H) * H - V); 4077 4078 float NdotL = max(dot(N, L), 0.0); 4079 4080 if(NdotL > 0.0) { 4081 // Sample environment at fixed mip level 4082 // VNDF importance sampling handles the distribution filtering 4083 vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); 4084 4085 // Weight by NdotL for the split-sum approximation 4086 // VNDF PDF naturally accounts for the visible microfacet distribution 4087 prefilteredColor += sampleColor * NdotL; 4088 totalWeight += NdotL; 4089 } 4090 } 4091 4092 if (totalWeight > 0.0) { 4093 prefilteredColor = prefilteredColor / totalWeight; 4094 } 4095 4096 gl_FragColor = vec4(prefilteredColor, 1.0); 4097 } 4098 `,blending:0,depthTest:!1,depthWrite:!1})}function MT(e,t,n){let r=new Float32Array(vT),i=new X(0,1,0);return new I_({name:`SphericalGaussianBlur`,defines:{n:vT,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:FT(),fragmentShader:` 4099 4100 precision mediump float; 4101 precision mediump int; 4102 4103 varying vec3 vOutputDirection; 4104 4105 uniform sampler2D envMap; 4106 uniform int samples; 4107 uniform float weights[ n ]; 4108 uniform bool latitudinal; 4109 uniform float dTheta; 4110 uniform float mipInt; 4111 uniform vec3 poleAxis; 4112 4113 #define ENVMAP_TYPE_CUBE_UV 4114 #include <cube_uv_reflection_fragment> 4115 4116 vec3 getSample( float theta, vec3 axis ) { 4117 4118 float cosTheta = cos( theta ); 4119 // Rodrigues' axis-angle rotation 4120 vec3 sampleDirection = vOutputDirection * cosTheta 4121 + cross( axis, vOutputDirection ) * sin( theta ) 4122 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 4123 4124 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 4125 4126 } 4127 4128 void main() { 4129 4130 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 4131 4132 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 4133 4134 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 4135 4136 } 4137 4138 axis = normalize( axis ); 4139 4140 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 4141 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 4142 4143 for ( int i = 1; i < n; i++ ) { 4144 4145 if ( i >= samples ) { 4146 4147 break; 4148 4149 } 4150 4151 float theta = dTheta * float( i ); 4152 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 4153 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 4154 4155 } 4156 4157 } 4158 `,blending:0,depthTest:!1,depthWrite:!1})}function NT(){return new I_({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:FT(),fragmentShader:` 4159 4160 precision mediump float; 4161 precision mediump int; 4162 4163 varying vec3 vOutputDirection; 4164 4165 uniform sampler2D envMap; 4166 4167 #include <common> 4168 4169 void main() { 4170 4171 vec3 outputDirection = normalize( vOutputDirection ); 4172 vec2 uv = equirectUv( outputDirection ); 4173 4174 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 4175 4176 } 4177 `,blending:0,depthTest:!1,depthWrite:!1})}function PT(){return new I_({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:FT(),fragmentShader:` 4178 4179 precision mediump float; 4180 precision mediump int; 4181 4182 uniform float flipEnvMap; 4183 4184 varying vec3 vOutputDirection; 4185 4186 uniform samplerCube envMap; 4187 4188 void main() { 4189 4190 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 4191 4192 } 4193 `,blending:0,depthTest:!1,depthWrite:!1})}function FT(){return` 4194 4195 precision mediump float; 4196 precision mediump int; 4197 4198 attribute float faceIndex; 4199 4200 varying vec3 vOutputDirection; 4201 4202 // RH coordinate system; PMREM face-indexing convention 4203 vec3 getDirection( vec2 uv, float face ) { 4204 4205 uv = 2.0 * uv - 1.0; 4206 4207 vec3 direction = vec3( uv, 1.0 ); 4208 4209 if ( face == 0.0 ) { 4210 4211 direction = direction.zyx; // ( 1, v, u ) pos x 4212 4213 } else if ( face == 1.0 ) { 4214 4215 direction = direction.xzy; 4216 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 4217 4218 } else if ( face == 2.0 ) { 4219 4220 direction.x *= -1.0; // ( -u, v, 1 ) pos z 4221 4222 } else if ( face == 3.0 ) { 4223 4224 direction = direction.zyx; 4225 direction.xz *= -1.0; // ( -1, v, -u ) neg x 4226 4227 } else if ( face == 4.0 ) { 4228 4229 direction = direction.xzy; 4230 direction.xy *= -1.0; // ( -u, -1, v ) neg y 4231 4232 } else if ( face == 5.0 ) { 4233 4234 direction.z *= -1.0; // ( u, v, -1 ) neg z 4235 4236 } 4237 4238 return direction; 4239 4240 } 4241 4242 void main() { 4243 4244 vOutputDirection = getDirection( uv, faceIndex ); 4245 gl_Position = vec4( position, 1.0 ); 4246 4247 } 4248 `}function IT(e){let t=new WeakMap,n=null;function r(r){if(r&&r.isTexture){let o=r.mapping,s=o===303||o===304,c=o===301||o===302;if(s||c){let o=t.get(r),l=o===void 0?0:o.texture.pmremVersion;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return n===null&&(n=new DT(e)),o=s?n.fromEquirectangular(r,o):n.fromCubemap(r,o),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),o.texture;if(o!==void 0)return o.texture;
vendor: 22,952 bytes, lines 4248-4329
4248{let l=r.image;return s&&l&&l.height>0||c&&l&&i(l)?(n===null&&(n=new DT(e)),o=s?n.fromEquirectangular(r):n.fromCubemap(r),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),r.addEventListener(`dispose`,a),o.texture):null}}}return r}function i(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function a(e){let n=e.target;n.removeEventListener(`dispose`,a);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function o(){t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:o}}function LT(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&vm(`WebGLRenderer: `+e+` extension not supported.`),t}}}function RT(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;for(let e in s.index!==null&&t.remove(s.index),s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){let r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else if(i!==void 0){let e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){let e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}else return;let s=new(om(n)?i_:n_)(n,1);s.version=o;let c=a.get(e);c&&t.remove(c),a.set(e,s)}function u(e){let t=a.get(e);if(t){let n=e.index;n!==null&&t.version<n.version&&l(e)}else l(e);return a.get(e)}return{get:s,update:c,getWireframeAttribute:u}}function zT(e,t,n){let r;function i(e){r=e}let a,o;function s(e){a=e.type,o=e.bytesPerElement}function c(t,i){e.drawElements(r,i,a,t*o),n.update(i,r,1)}function l(t,i,s){s!==0&&(e.drawElementsInstanced(r,i,a,t*o,s),n.update(i,r,s))}function u(e,i,o){if(o===0)return;t.get(`WEBGL_multi_draw`).multiDrawElementsWEBGL(r,i,0,a,e,0,o);let s=0;for(let e=0;e<o;e++)s+=i[e];n.update(s,r,1)}function d(e,i,s,c){if(s===0)return;let u=t.get(`WEBGL_multi_draw`);if(u===null)for(let t=0;t<e.length;t++)l(e[t]/o,i[t],c[t]);else{u.multiDrawElementsInstancedWEBGL(r,i,0,a,e,0,c,0,s);let t=0;for(let e=0;e<s;e++)t+=i[e]*c[e];n.update(t,r,1)}}this.setMode=i,this.setIndex=s,this.render=c,this.renderInstances=l,this.renderMultiDraw=u,this.renderMultiDrawInstances=d}function BT(e){let t={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(t,r,i){switch(n.calls++,r){case e.TRIANGLES:n.triangles+=i*(t/3);break;case e.LINES:n.lines+=i*(t/2);break;case e.LINE_STRIP:n.lines+=i*(t-1);break;case e.LINE_LOOP:n.lines+=i*t;break;case e.POINTS:n.points+=i*t;break;default:_m(`WebGLInfo: Unknown draw mode:`,r);break}}function i(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:t,render:n,programs:null,autoReset:!0,reset:i,update:r}}function VT(e,t,n){let r=new WeakMap,i=new ph;function a(a,o,s){let c=a.morphTargetInfluences,l=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=l===void 0?0:l.length,d=r.get(o);if(d===void 0||d.count!==u){d!==void 0&&d.texture.dispose();let e=o.morphAttributes.position!==void 0,n=o.morphAttributes.normal!==void 0,a=o.morphAttributes.color!==void 0,s=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],l=o.morphAttributes.color||[],f=0;e===!0&&(f=1),n===!0&&(f=2),a===!0&&(f=3);let p=o.attributes.position.count*f,m=1;p>t.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new gh(h,p,m,u);g.type=yf,g.needsUpdate=!0;let _=f*4;for(let t=0;t<u;t++){let r=s[t],o=c[t],u=l[t],d=p*m*4*t;for(let t=0;t<r.count;t++){let s=t*_;e===!0&&(i.fromBufferAttribute(r,t),h[d+s+0]=i.x,h[d+s+1]=i.y,h[d+s+2]=i.z,h[d+s+3]=0),n===!0&&(i.fromBufferAttribute(o,t),h[d+s+4]=i.x,h[d+s+5]=i.y,h[d+s+6]=i.z,h[d+s+7]=0),a===!0&&(i.fromBufferAttribute(u,t),h[d+s+8]=i.x,h[d+s+9]=i.y,h[d+s+10]=i.z,h[d+s+11]=u.itemSize===4?i.w:1)}}d={count:u,texture:g,size:new Y(p,m)},r.set(o,d);function v(){g.dispose(),r.delete(o),o.removeEventListener(`dispose`,v)}o.addEventListener(`dispose`,v)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)s.getUniforms().setValue(e,`morphTexture`,a.morphTexture,n);else{let t=0;for(let e=0;e<c.length;e++)t+=c[e];let n=o.morphTargetsRelative?1:1-t;s.getUniforms().setValue(e,`morphTargetBaseInfluence`,n),s.getUniforms().setValue(e,`morphTargetInfluences`,c)}s.getUniforms().setValue(e,`morphTargetsTexture`,d.texture,n),s.getUniforms().setValue(e,`morphTargetsTextureSize`,d.size)}return{update:a}}function HT(e,t,n,r){let i=new WeakMap;function a(a){let o=r.render.frame,c=a.geometry,l=t.get(a,c);if(i.get(l)!==o&&(t.update(l),i.set(l,o)),a.isInstancedMesh&&(a.hasEventListener(`dispose`,s)===!1&&a.addEventListener(`dispose`,s),i.get(a)!==o&&(n.update(a.instanceMatrix,e.ARRAY_BUFFER),a.instanceColor!==null&&n.update(a.instanceColor,e.ARRAY_BUFFER),i.set(a,o))),a.isSkinnedMesh){let e=a.skeleton;i.get(e)!==o&&(e.update(),i.set(e,o))}return l}function o(){i=new WeakMap}function s(e){let t=e.target;t.removeEventListener(`dispose`,s),n.remove(t.instanceMatrix),t.instanceColor!==null&&n.remove(t.instanceColor)}return{update:a,dispose:o}}var UT={1:`LINEAR_TONE_MAPPING`,2:`REINHARD_TONE_MAPPING`,3:`CINEON_TONE_MAPPING`,4:`ACES_FILMIC_TONE_MAPPING`,6:`AGX_TONE_MAPPING`,7:`NEUTRAL_TONE_MAPPING`,5:`CUSTOM_TONE_MAPPING`};function WT(e,t,n,r,i){let a=new hh(t,n,{type:e,depthBuffer:r,stencilBuffer:i}),o=new hh(t,n,{type:bf,depthBuffer:!1,stencilBuffer:!1}),s=new p_;s.setAttribute(`position`,new Q([-1,3,0,-1,-1,0,3,-1,0],3)),s.setAttribute(`uv`,new Q([0,2,0,0,2,0],2));let c=new Vx({uniforms:{tDiffuse:{value:null}},vertexShader:` 4249 precision highp float; 4250 4251 uniform mat4 modelViewMatrix; 4252 uniform mat4 projectionMatrix; 4253 4254 attribute vec3 position; 4255 attribute vec2 uv; 4256 4257 varying vec2 vUv; 4258 4259 void main() { 4260 vUv = uv; 4261 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4262 }`,fragmentShader:` 4263 precision highp float; 4264 4265 uniform sampler2D tDiffuse; 4266 4267 varying vec2 vUv; 4268 4269 #include <tonemapping_pars_fragment> 4270 #include <colorspace_pars_fragment> 4271 4272 void main() { 4273 gl_FragColor = texture2D( tDiffuse, vUv ); 4274 4275 #ifdef LINEAR_TONE_MAPPING 4276 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 4277 #elif defined( REINHARD_TONE_MAPPING ) 4278 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 4279 #elif defined( CINEON_TONE_MAPPING ) 4280 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 4281 #elif defined( ACES_FILMIC_TONE_MAPPING ) 4282 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 4283 #elif defined( AGX_TONE_MAPPING ) 4284 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 4285 #elif defined( NEUTRAL_TONE_MAPPING ) 4286 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 4287 #elif defined( CUSTOM_TONE_MAPPING ) 4288 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 4289 #endif 4290 4291 #ifdef SRGB_TRANSFER 4292 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 4293 #endif 4294 }`,depthTest:!1,depthWrite:!1}),l=new T_(s,c),u=new WS(-1,1,1,-1,0,1),d=null,f=null,p=!1,m,h=null,g=[],_=!1;this.setSize=function(e,t){a.setSize(e,t),o.setSize(e,t);for(let n=0;n<g.length;n++){let r=g[n];r.setSize&&r.setSize(e,t)}},this.setEffects=function(e){g=e,_=g.length>0&&g[0].isRenderPass===!0;let t=a.width,n=a.height;for(let e=0;e<g.length;e++){let r=g[e];r.setSize&&r.setSize(t,n)}},this.begin=function(e,t){if(p||e.toneMapping===0&&g.length===0)return!1;if(h=t,t!==null){let e=t.width,n=t.height;(a.width!==e||a.height!==n)&&this.setSize(e,n)}return _===!1&&e.setRenderTarget(a),m=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return _},this.end=function(e,t){e.toneMapping=m,p=!0;let n=a,r=o;for(let i=0;i<g.length;i++){let a=g[i];if(a.enabled!==!1&&(a.render(e,r,n,t),a.needsSwap!==!1)){let e=n;n=r,r=e}}if(d!==e.outputColorSpace||f!==e.toneMapping){d=e.outputColorSpace,f=e.toneMapping,c.defines={},nh.getTransfer(d)===`srgb`&&(c.defines.SRGB_TRANSFER=``);let t=UT[f];t&&(c.defines[t]=``),c.needsUpdate=!0}c.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(h),e.render(l,u),h=null,p=!1},this.isCompositing=function(){return p},this.dispose=function(){a.dispose(),o.dispose(),s.dispose(),c.dispose()}}var GT=new fh,KT=new Yy(1,1),qT=new gh,JT=new vh,YT=new G_,XT=[],ZT=[],QT=new Float32Array(16),$T=new Float32Array(9),eE=new Float32Array(4);function tE(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=XT[i];if(a===void 0&&(a=new Float32Array(i),XT[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function nE(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function rE(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function iE(e,t){let n=ZT[t];n===void 0&&(n=new Int32Array(t),ZT[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function aE(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function oE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(nE(n,t))return;e.uniform2fv(this.addr,t),rE(n,t)}}function sE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(t.r!==void 0)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(nE(n,t))return;e.uniform3fv(this.addr,t),rE(n,t)}}function cE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(nE(n,t))return;e.uniform4fv(this.addr,t),rE(n,t)}}function lE(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(nE(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),rE(n,t)}else{if(nE(n,r))return;eE.set(r),e.uniformMatrix2fv(this.addr,!1,eE),rE(n,r)}}function uE(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(nE(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),rE(n,t)}else{if(nE(n,r))return;$T.set(r),e.uniformMatrix3fv(this.addr,!1,$T),rE(n,r)}}function dE(e,t){let n=this.cache,r=t.elements;if(r===void 0){if(nE(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),rE(n,t)}else{if(nE(n,r))return;QT.set(r),e.uniformMatrix4fv(this.addr,!1,QT),rE(n,r)}}function fE(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function pE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(nE(n,t))return;e.uniform2iv(this.addr,t),rE(n,t)}}function mE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(nE(n,t))return;e.uniform3iv(this.addr,t),rE(n,t)}}function hE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(nE(n,t))return;e.uniform4iv(this.addr,t),rE(n,t)}}function gE(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function _E(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(nE(n,t))return;e.uniform2uiv(this.addr,t),rE(n,t)}}function vE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(nE(n,t))return;e.uniform3uiv(this.addr,t),rE(n,t)}}function yE(e,t){let n=this.cache;if(t.x!==void 0)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(nE(n,t))return;e.uniform4uiv(this.addr,t),rE(n,t)}}function bE(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);let a;this.type===e.SAMPLER_2D_SHADOW?(KT.compareFunction=n.isReversedDepthBuffer()?518:515,a=KT):a=GT,n.setTexture2D(t||a,i)}function xE(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||JT,i)}function SE(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||YT,i)}function CE(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||qT,i)}function wE(e){switch(e){case 5126:return aE;case 35664:return oE;case 35665:return sE;case 35666:return cE;case 35674:return lE;case 35675:return uE;case 35676:return dE;case 5124:case 35670:return fE;case 35667:case 35671:return pE;case 35668:case 35672:return mE;case 35669:case 35673:return hE;case 5125:return gE;case 36294:return _E;case 36295:return vE;case 36296:return yE;case 35678:case 36198:case 36298:case 36306:case 35682:return bE;case 35679:case 36299:case 36307:return xE;case 35680:case 36300:case 36308:case 36293:return SE;case 36289:case 36303:case 36311:case 36292:return CE}}function TE(e,t){e.uniform1fv(this.addr,t)}function EE(e,t){let n=tE(t,this.size,2);e.uniform2fv(this.addr,n)}function DE(e,t){let n=tE(t,this.size,3);e.uniform3fv(this.addr,n)}function OE(e,t){let n=tE(t,this.size,4);e.uniform4fv(this.addr,n)}function kE(e,t){let n=tE(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function AE(e,t){let n=tE(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function jE(e,t){let n=tE(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function ME(e,t){e.uniform1iv(this.addr,t)}function NE(e,t){e.uniform2iv(this.addr,t)}function PE(e,t){e.uniform3iv(this.addr,t)}function FE(e,t){e.uniform4iv(this.addr,t)}function IE(e,t){e.uniform1uiv(this.addr,t)}function LE(e,t){e.uniform2uiv(this.addr,t)}function RE(e,t){e.uniform3uiv(this.addr,t)}function zE(e,t){e.uniform4uiv(this.addr,t)}function BE(e,t,n){let r=this.cache,i=t.length,a=iE(n,i);nE(r,a)||(e.uniform1iv(this.addr,a),rE(r,a));let o;o=this.type===e.SAMPLER_2D_SHADOW?KT:GT;for(let e=0;e!==i;++e)n.setTexture2D(t[e]||o,a[e])}function VE(e,t,n){let r=this.cache,i=t.length,a=iE(n,i);nE(r,a)||(e.uniform1iv(this.addr,a),rE(r,a));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||JT,a[e])}function HE(e,t,n){let r=this.cache,i=t.length,a=iE(n,i);nE(r,a)||(e.uniform1iv(this.addr,a),rE(r,a));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||YT,a[e])}function UE(e,t,n){let r=this.cache,i=t.length,a=iE(n,i);nE(r,a)||(e.uniform1iv(this.addr,a),rE(r,a));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||qT,a[e])}function WE(e){switch(e){case 5126:return TE;case 35664:return EE;case 35665:return DE;case 35666:return OE;case 35674:return kE;case 35675:return AE;case 35676:return jE;case 5124:case 35670:return ME;case 35667:case 35671:return NE;case 35668:case 35672:return PE;case 35669:case 35673:return FE;case 5125:return IE;case 36294:return LE;case 36295:return RE;case 36296:return zE;case 35678:case 36198:case 36298:case 36306:case 35682:return BE;case 35679:case 36299:case 36307:return VE;case 35680:case 36300:case 36308:case 36293:return HE;case 36289:case 36303:case 36311:case 36292:return UE}}var GE=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=wE(t.type)}},KE=class{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=WE(t.type)}},qE=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let r=this.seq;for(let i=0,a=r.length;i!==a;++i){let a=r[i];a.setValue(e,t[a.id],n)}}},JE=/(\w+)(\])?(\[|\.)?/g;function YE(e,t){e.seq.push(t),e.map[t.id]=t}function XE(e,t,n){let r=e.name,i=r.length;for(JE.lastIndex=0;;){let a=JE.exec(r),o=JE.lastIndex,s=a[1],c=a[2]===`]`,l=a[3];if(c&&(s|=0),l===void 0||l===`[`&&o+2===i){YE(n,l===void 0?new GE(s,e,t):new KE(s,e,t));break}else{let e=n.map[s];e===void 0&&(e=new qE(s),YE(n,e)),n=e}}}var ZE=class{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){let n=e.getActiveUniform(t,r);XE(n,e.getUniformLocation(t,n.name),this)}let r=[],i=[];for(let t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(t):i.push(t);r.length>0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function QE(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var $E=37297,eD=0;function tD(e,t){let n=e.split(` 4295`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e<a;e++){let i=e+1;r.push(`${i===t?`>`:` `} ${i}: ${n[e]}`)}return r.join(` 4296`)}var nD=new Zm;function rD(e){nh._getMatrix(nD,nh.workingColorSpace,e);let t=`mat3( ${nD.elements.map(e=>e.toFixed(4))} )`;switch(nh.getTransfer(e)){case Ip:return[t,`LinearTransferOETF`];case Lp:return[t,`sRGBTransferOETF`];default:return J(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function iD(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+` 4297 4298`+i+` 4299 4300`+tD(e.getShaderSource(t),r)}else return i}function aD(e,t){let n=rD(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(` 4301`)}var oD={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`};function sD(e,t){let n=oD[t];return n===void 0?(J(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}var cD=new X;function lD(){return nh.getLuminanceCoefficients(cD),[`float luminance( const in vec3 rgb ) {`,` const vec3 weights = vec3( ${cD.x.toFixed(4)}, ${cD.y.toFixed(4)}, ${cD.z.toFixed(4)} );`,` return dot( weights, rgb );`,`}`].join(` 4302`)}function uD(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(pD).join(` 4303`)}function dD(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(` 4304`)}function fD(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=e.getActiveAttrib(t,i),a=r.name,o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}function pD(e){return e!==``}function mD(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function hD(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var gD=/^[ \t]*#include +<([\w\d./]+)>/gm;function _D(e){return e.replace(gD,yD)}var vD=new Map;function yD(e,t){let n=aT[t];if(n===void 0){let e=vD.get(t);if(e!==void 0)n=aT[e],J(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`Can not resolve #include <`+t+`>`)}return _D(n)}var bD=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function xD(e){return e.replace(bD,SD)}function SD(e,t,n,r){let i=``;for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,`[ `+e+` ]`).replace(/UNROLLED_LOOP_INDEX/g,e);return i}function CD(e){let t=`precision ${e.precision} float; 4305 precision ${e.precision} int; 4306 precision ${e.precision} sampler2D; 4307 precision ${e.precision} samplerCube; 4308 precision ${e.precision} sampler3D; 4309 precision ${e.precision} sampler2DArray; 4310 precision ${e.precision} sampler2DShadow; 4311 precision ${e.precision} samplerCubeShadow; 4312 precision ${e.precision} sampler2DArrayShadow; 4313 precision ${e.precision} isampler2D; 4314 precision ${e.precision} isampler3D; 4315 precision ${e.precision} isamplerCube; 4316 precision ${e.precision} isampler2DArray; 4317 precision ${e.precision} usampler2D; 4318 precision ${e.precision} usampler3D; 4319 precision ${e.precision} usamplerCube; 4320 precision ${e.precision} usampler2DArray; 4321 `;return e.precision===`highp`?t+=` 4322#define HIGH_PRECISION`:e.precision===`mediump`?t+=` 4323#define MEDIUM_PRECISION`:e.precision===`lowp`&&(t+=` 4324#define LOW_PRECISION`),t}var wD={1:`SHADOWMAP_TYPE_PCF`,3:`SHADOWMAP_TYPE_VSM`};function TD(e){return wD[e.shadowMapType]||`SHADOWMAP_TYPE_BASIC`}var ED={301:`ENVMAP_TYPE_CUBE`,302:`ENVMAP_TYPE_CUBE`,306:`ENVMAP_TYPE_CUBE_UV`};function DD(e){return e.envMap===!1?`ENVMAP_TYPE_CUBE`:ED[e.envMapMode]||`ENVMAP_TYPE_CUBE`}var OD={302:`ENVMAP_MODE_REFRACTION`};function kD(e){return e.envMap===!1?`ENVMAP_MODE_REFLECTION`:OD[e.envMapMode]||`ENVMAP_MODE_REFLECTION`}var AD={0:`ENVMAP_BLENDING_MULTIPLY`,1:`ENVMAP_BLENDING_MIX`,2:`ENVMAP_BLENDING_ADD`};function jD(e){return e.envMap===!1?`ENVMAP_BLENDING_NONE`:AD[e.combine]||`ENVMAP_BLENDING_NONE`}function MD(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(2**n,112)),texelHeight:r,maxMip:n}}function ND(e,t,n,r){let i=e.getContext(),a=n.defines,o=n.vertexShader,s=n.fragmentShader,c=TD(n),l=DD(n),u=kD(n),d=jD(n),f=MD(n),p=uD(n),m=dD(a),h=i.createProgram(),g,_,v=n.glslVersion?`#version `+n.glslVersion+` 4325`:``;n.isRawShaderMaterial?(g=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(pD).join(` 4326`),g.length>0&&(g+=` 4327`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(pD).join(` 4328`),_.length>0&&(_+=` 4329`)):(g=[CD(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionCl
vendor: 5,521 bytes, lines 4329-4331
4329ipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` 4330`].filter(pD).join(` 4331`),_=[CD(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matc
vendor: 20,674 bytes, lines 4331-4345
4331ap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor||n.batchingColor?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:aT.tonemapping_pars_fragment,n.toneMapping===0?``:sD(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,aT.colorspace_pars_fragment,aD(`linearToOutputTexel`,n.outputColorSpace),lD(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` 4332`].filter(pD).join(` 4333`)),o=_D(o),o=mD(o,n),o=hD(o,n),s=_D(s),s=mD(s,n),s=hD(s,n),o=xD(o),s=xD(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es 4334`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(` 4335`)+` 4336`+g,_=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(` 4337`)+` 4338`+_);let y=v+g+o,b=v+_+s,x=QE(i,i.VERTEX_SHADER,y),S=QE(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.morphTargets===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1)if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=iD(i,x,`vertex`),n=iD(i,S,`fragment`);_m(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` 4339 4340Material Name: `+t.name+` 4341Material Type: `+t.type+` 4342 4343Program Info Log: `+o+` 4344`+e+` 4345`+n)}else o===``?(s===``||c===``)&&(u=!1):J(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new ZE(i,h),T=fD(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,$E)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=eD++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}var PD=0,FD=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new ID(e),t.set(e,n)),n}},ID=class{constructor(e){this.id=PD++,this.code=e,this.usedTimes=0}};function LD(e,t,n,r,i,a,o){let s=new ig,c=new FD,l=new Set,u=[],d=new Map,f=i.logarithmicDepthBuffer,p=i.precision,m={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function h(e){return l.add(e),e===0?`uv`:`uv${e}`}function g(a,s,u,d,g){let _=d.fog,v=g.geometry,y=a.isMeshStandardMaterial?d.environment:null,b=(a.isMeshStandardMaterial?n:t).get(a.envMap||y),x=b&&b.mapping===306?b.image.height:null,S=m[a.type];a.precision!==null&&(p=i.getMaxPrecision(a.precision),p!==a.precision&&J(`WebGLProgram.getParameters:`,a.precision,`not supported, using`,p,`instead.`));let C=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,w=C===void 0?0:C.length,T=0;v.morphAttributes.position!==void 0&&(T=1),v.morphAttributes.normal!==void 0&&(T=2),v.morphAttributes.color!==void 0&&(T=3);let E,D,O,k;if(S){let e=oT[S];E=e.vertexShader,D=e.fragmentShader}else E=a.vertexShader,D=a.fragmentShader,c.update(a),O=c.getVertexShaderID(a),k=c.getFragmentShaderID(a);let A=e.getRenderTarget(),j=e.state.buffers.depth.getReversed(),ee=g.isInstancedMesh===!0,M=g.isBatchedMesh===!0,te=!!a.map,N=!!a.matcap,P=!!b,F=!!a.aoMap,I=!!a.lightMap,ne=!!a.bumpMap,re=!!a.normalMap,L=!!a.displacementMap,ie=!!a.emissiveMap,R=!!a.metalnessMap,ae=!!a.roughnessMap,oe=a.anisotropy>0,se=a.clearcoat>0,ce=a.dispersion>0,z=a.iridescence>0,le=a.sheen>0,ue=a.transmission>0,de=oe&&!!a.anisotropyMap,fe=se&&!!a.clearcoatMap,B=se&&!!a.clearcoatNormalMap,pe=se&&!!a.clearcoatRoughnessMap,me=z&&!!a.iridescenceMap,he=z&&!!a.iridescenceThicknessMap,V=le&&!!a.sheenColorMap,H=le&&!!a.sheenRoughnessMap,U=!!a.specularMap,ge=!!a.specularColorMap,_e=!!a.specularIntensityMap,ve=ue&&!!a.transmissionMap,ye=ue&&!!a.thicknessMap,be=!!a.gradientMap,xe=!!a.alphaMap,Se=a.alphaTest>0,Ce=!!a.alphaHash,we=!!a.extensions,Te=0;a.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(Te=e.toneMapping);let Ee={shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:E,fragmentShader:D,defines:a.defines,customVertexShaderID:O,customFragmentShaderID:k,isRawShaderMaterial:a.isRawShaderMaterial===!0,glslVersion:a.glslVersion,precision:p,batching:M,batchingColor:M&&g._colorsTexture!==null,instancing:ee,instancingColor:ee&&g.instanceColor!==null,instancingMorph:ee&&g.morphTexture!==null,outputColorSpace:A===null?e.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:Fp,alphaToCoverage:!!a.alphaToCoverage,map:te,matcap:N,envMap:P,envMapMode:P&&b.mapping,envMapCubeUVHeight:x,aoMap:F,lightMap:I,bumpMap:ne,normalMap:re,displacementMap:L,emissiveMap:ie,normalMapObjectSpace:re&&a.normalMapType===1,normalMapTangentSpace:re&&a.normalMapType===0,metalnessMap:R,roughnessMap:ae,anisotropy:oe,anisotropyMap:de,clearcoat:se,clearcoatMap:fe,clearcoatNormalMap:B,clearcoatRoughnessMap:pe,dispersion:ce,iridescence:z,iridescenceMap:me,iridescenceThicknessMap:he,sheen:le,sheenColorMap:V,sheenRoughnessMap:H,specularMap:U,specularColorMap:ge,specularIntensityMap:_e,transmission:ue,transmissionMap:ve,thicknessMap:ye,gradientMap:be,opaque:a.transparent===!1&&a.blending===1&&a.alphaToCoverage===!1,alphaMap:xe,alphaTest:Se,alphaHash:Ce,combine:a.combine,mapUv:te&&h(a.map.channel),aoMapUv:F&&h(a.aoMap.channel),lightMapUv:I&&h(a.lightMap.channel),bumpMapUv:ne&&h(a.bumpMap.channel),normalMapUv:re&&h(a.normalMap.channel),displacementMapUv:L&&h(a.displacementMap.channel),emissiveMapUv:ie&&h(a.emissiveMap.channel),metalnessMapUv:R&&h(a.metalnessMap.channel),roughnessMapUv:ae&&h(a.roughnessMap.channel),anisotropyMapUv:de&&h(a.anisotropyMap.channel),clearcoatMapUv:fe&&h(a.clearcoatMap.channel),clearcoatNormalMapUv:B&&h(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pe&&h(a.clearcoatRoughnessMap.channel),iridescenceMapUv:me&&h(a.iridescenceMap.channel),iridescenceThicknessMapUv:he&&h(a.iridescenceThicknessMap.channel),sheenColorMapUv:V&&h(a.sheenColorMap.channel),sheenRoughnessMapUv:H&&h(a.sheenRoughnessMap.channel),specularMapUv:U&&h(a.specularMap.channel),specularColorMapUv:ge&&h(a.specularColorMap.channel),specularIntensityMapUv:_e&&h(a.specularIntensityMap.channel),transmissionMapUv:ve&&h(a.transmissionMap.channel),thicknessMapUv:ye&&h(a.thicknessMap.channel),alphaMapUv:xe&&h(a.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(re||oe),vertexColors:a.vertexColors,vertexAlphas:a.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:g.isPoints===!0&&!!v.attributes.uv&&(te||xe),fog:!!_,useFog:a.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:a.flatShading===!0&&a.wireframe===!1,sizeAttenuation:a.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:j,skinning:g.isSkinnedMesh===!0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:w,morphTextureStride:T,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:Te,decodeVideoTexture:te&&a.map.isVideoTexture===!0&&nh.getTransfer(a.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:ie&&a.emissiveMap.isVideoTexture===!0&&nh.getTransfer(a.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===2,flipSided:a.side===1,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:we&&a.extensions.clipCullDistance===!0&&r.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(we&&a.extensions.multiDraw===!0||M)&&r.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:r.has(`KHR_parallel_shader_compile`),customProgramCacheKey:a.customProgramCacheKey()};return Ee.vertexUv1s=l.has(1),Ee.vertexUv2s=l.has(2),Ee.vertexUv3s=l.has(3),l.clear(),Ee}function _(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(v(n,t),y(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function v(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function y(e,t){s.disableAll(),t.instancing&&s.enable(0),t.instancingColor&&s.enable(1),t.instancingMorph&&s.enable(2),t.matcap&&s.enable(3),t.envMap&&s.enable(4),t.normalMapObjectSpace&&s.enable(5),t.normalMapTangentSpace&&s.enable(6),t.clearcoat&&s.enable(7),t.iridescence&&s.enable(8),t.alphaTest&&s.enable(9),t.vertexColors&&s.enable(10),t.vertexAlphas&&s.enable(11),t.vertexUv1s&&s.enable(12),t.vertexUv2s&&s.enable(13),t.vertexUv3s&&s.enable(14),t.vertexTangents&&s.enable(15),t.anisotropy&&s.enable(16),t.alphaHash&&s.enable(17),t.batching&&s.enable(18),t.dispersion&&s.enable(19),t.batchingColor&&s.enable(20),t.gradientMap&&s.enable(21),e.push(s.mask),s.disableAll(),t.fog&&s.enable(0),t.useFog&&s.enable(1),t.flatShading&&s.enable(2),t.logarithmicDepthBuffer&&s.enable(3),t.reversedDepthBuffer&&s.enable(4),t.skinning&&s.enable(5),t.morphTargets&&s.enable(6),t.morphNormals&&s.enable(7),t.morphColors&&s.enable(8),t.premultipliedAlpha&&s.enable(9),t.shadowMapEnabled&&s.enable(10),t.doubleSided&&s.enable(11),t.flipSided&&s.enable(12),t.useDepthPacking&&s.enable(13),t.dithering&&s.enable(14),t.transmission&&s.enable(15),t.sheen&&s.enable(16),t.opaque&&s.enable(17),t.pointsUvs&&s.enable(18),t.decodeVideoTexture&&s.enable(19),t.decodeVideoTextureEmissive&&s.enable(20),t.alphaToCoverage&&s.enable(21),e.push(s.mask)}function b(e){let t=m[e.type],n;if(t){let e=oT[t];n=N_.clone(e.uniforms)}else n=e.uniforms;return n}function x(t,n){let r=d.get(n);return r===void 0?(r=new ND(e,n,t,a),u.push(r),d.set(n,r)):++r.usedTimes,r}function S(e){if(--e.usedTimes===0){let t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),d.delete(e.cacheKey),e.destroy()}}function C(e){c.remove(e)}function w(){c.dispose()}return{getParameters:g,getProgramCacheKey:_,getUniforms:b,acquireProgram:x,releaseProgram:S,releaseShaderCache:C,programs:u,dispose:w}}function RD(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function zD(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.z===t.z?e.id-t.id:e.z-t.z:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function BD(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function VD(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(n,r,i,a,o,s){let c=e[t];return c===void 0?(c={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=i,c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=o,c.group=s),t++,c}function s(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function c(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function l(e,t){n.length>1&&n.sort(e||zD),r.length>1&&r.sort(t||BD),i.length>1&&i.sort(t||BD)}function u(){for(let n=t,r=e.length;n<r;n++){let t=e[n];if(t.id===null)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}}return{opaque:n,transmissive:r,transparent:i,init:a,push:s,unshift:c,finish:u,sort:l}}function HD(){let e=new WeakMap;function t(t,n){let r=e.get(t),i;return r===void 0?(i=new VD,e.set(t,[i])):n>=r.length?(i=new VD,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function UD(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new X,color:new Z};break;case`SpotLight`:n={position:new X,direction:new X,color:new Z,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new X,color:new Z,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new X,skyColor:new Z,groundColor:new Z};break;case`RectAreaLight`:n={color:new Z,position:new X,halfWidth:new X,halfHeight:new X};break}return e[t.id]=n,n}}}function WD(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Y};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Y};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Y,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}var GD=0;function KD(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function qD(e){let t=new UD,n=WD(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new X);let i=new X,a=new qh,o=new qh;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(KD);for(let e=0,y=i.length;e<y;e++){let y=i[e],b=y.color,x=y.intensity,S=y.distance,C=null;if(y.shadow&&y.shadow.map&&(C=y.shadow.map.texture.format===1030?y.shadow.map.texture:y.shadow.map.depthTexture||y.shadow.map.texture),y.isAmbientLight)a+=b.r*x,o+=b.g*x,s+=b.b*x;else if(y.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(y.sh.coefficients[e],x);v++}else if(y.isDirectionalLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.n
vendor: 4,510 bytes, lines 4345-4350
4345ormalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[c]=t,r.directionalShadowMap[c]=C,r.directionalShadowMatrix[c]=y.shadow.matrix,p++}r.directional[c]=e,c++}else if(y.isSpotLight){let e=t.get(y);e.position.setFromMatrixPosition(y.matrixWorld),e.color.copy(b).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(y.angle),e.penumbraCos=Math.cos(y.angle*(1-y.penumbra)),e.decay=y.decay,r.spot[u]=e;let i=y.shadow;if(y.map&&(r.spotLightMap[g]=y.map,g++,i.updateMatrices(y),y.castShadow&&_++),r.spotLightMatrix[u]=i.matrix,y.castShadow){let e=n.get(y);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=C,h++}u++}else if(y.isRectAreaLight){let e=t.get(y);e.color.copy(b).multiplyScalar(x),e.halfWidth.set(y.width*.5,0,0),e.halfHeight.set(0,y.height*.5,0),r.rectArea[d]=e,d++}else if(y.isPointLight){let e=t.get(y);if(e.color.copy(y.color).multiplyScalar(y.intensity),e.distance=y.distance,e.decay=y.decay,y.castShadow){let e=y.shadow,t=n.get(y);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[l]=t,r.pointShadowMap[l]=C,r.pointShadowMatrix[l]=y.shadow.matrix,m++}r.point[l]=e,l++}else if(y.isHemisphereLight){let e=t.get(y);e.skyColor.copy(y.color).multiplyScalar(x),e.groundColor.copy(y.groundColor).multiplyScalar(x),r.hemi[f]=e,f++}}d>0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=$.LTC_FLOAT_1,r.rectAreaLTC2=$.LTC_FLOAT_2):(r.rectAreaLTC1=$.LTC_HALF_1,r.rectAreaLTC2=$.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=GD++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t<f;t++){let f=e[t];if(f.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),n++}else if(f.isSpotLight){let e=r.spot[c];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(f.matrixWorld),i.setFromMatrixPosition(f.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(d),c++}else if(f.isRectAreaLight){let e=r.rectArea[l];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(f.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(f.width*.5,0,0),e.halfHeight.set(0,f.height*.5,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),l++}else if(f.isPointLight){let e=r.point[s];e.position.setFromMatrixPosition(f.matrixWorld),e.position.applyMatrix4(d),s++}else if(f.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(f.matrixWorld),e.direction.transformDirection(d),u++}}}return{setup:s,setupView:c,state:r}}function JD(e){let t=new qD(e),n=[],r=[];function i(e){l.camera=e,n.length=0,r.length=0}function a(e){n.push(e)}function o(e){r.push(e)}function s(){t.setup(n)}function c(e){t.setupView(n,e)}let l={lightsArray:n,shadowsArray:r,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:l,setupLights:s,setupLightsView:c,pushLight:a,pushShadow:o}}function YD(e){let t=new WeakMap;function n(n,r=0){let i=t.get(n),a;return i===void 0?(a=new JD(e),t.set(n,[a])):r>=i.length?(a=new JD(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}var XD=`void main() { 4346 gl_Position = vec4( position, 1.0 ); 4347}`,ZD=`uniform sampler2D shadow_pass; 4348uniform vec2 resolution; 4349uniform float radius; 4350void main() {
4351 const float samples = float( VSM_SAMPLES ); 4352 float mean = 0.0; 4353 float squared_mean = 0.0; 4354 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 4355 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 4356 for ( float i = 0.0; i < samples; i ++ ) { 4357 float uvOffset = uvStart + i * uvStride; 4358 #ifdef HORIZONTAL_PASS 4359 vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; 4360 mean += distribution.x; 4361 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 4362 #else 4363 float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; 4364 mean += depth; 4365 squared_mean += depth * depth; 4366 #endif 4367 } 4368 mean = mean / samples; 4369 squared_mean = squared_mean / samples; 4370 float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); 4371 gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); 4372}`,QD=[new X(1,0,0),new X(-1,0,0),new X(0,1,0),new X(0,-1,0),new X(0,0,1),new X(0,0,-1)],$D=[new X(0,-1,0),new X(0,-1,0),new X(0,0,1),new X(0,0,-1),new X(0,-1,0),new X(0,-1,0)],eO=new qh,tO=new X,nO=new X;function rO(e,t,n){let r=new Qv,i=new Y,a=new Y,o=new ph,s=new Jx,c=new Yx,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new I_({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Y},radius:{value:4}},vertexShader:XD,fragmentShader:ZD}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new p_;m.setAttribute(`position`,new Zg(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new T_(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;t.type===2&&(J(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),t.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;c<l;c++){let l=t[c],d=l.shadow;if(d===void 0){J(`WebGLShadowMap:`,l,`has no shadow.`);continue}if(d.autoUpdate===!1&&d.needsUpdate===!1)continue;i.copy(d.mapSize);let m=d.getFrameExtents();if(i.multiply(m),a.copy(d.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y)),d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){J(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new hh(i.x,i.y,{format:Nf,type:bf,minFilter:cf,magFilter:cf,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new Yy(i.x,i.y,yf),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=kf,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=nf,d.map.depthTexture.magFilter=nf}else{l.isPointLight?(d.map=new K_(i.x),d.map.depthTexture=new Xy(i.x,vf)):(d.map=new hh(i.x,i.y),d.map.depthTexture=new Yy(i.x,i.y,vf)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=kf;let t=e.state.buffers.depth.getReversed();this.type===1?(d.map.depthTexture.compareFunction=t?518:515,d.map.depthTexture.minFilter=cf,d.map.depthTexture.magFilter=cf):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=nf,d.map.depthTexture.magFilter=nf)}d.camera.updateProjectionMatrix()}let h=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t<h;t++){if(d.map.isWebGLCubeRenderTarget)e.setRenderTarget(d.map,t),e.clear();else{t===0&&(e.setRenderTarget(d.map),e.clear());let n=d.getViewport(t);o.set(a.x*n.x,a.y*n.y,a.x*n.z,a.y*n.w),f.viewport(o)}if(l.isPointLight){let e=d.camera,n=d.matrix,r=l.distance||e.far;r!==e.far&&(e.far=r,e.updateProjectionMatrix()),tO.setFromMatrixPosition(l.matrixWorld),e.position.copy(tO),nO.copy(e.position),nO.add(QD[t]),e.up.copy($D[t]),e.lookAt(nO),e.updateMatrixWorld(),n.makeTranslation(-tO.x,-tO.y,-tO.z),eO.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),d._frustum.setFromProjectionMatrix(eO,e.coordinateSystem,e.reversedDepth)}else d.updateMatrices(l);r=d.getFrustum(),b(n,s,d.camera,l,this.type)}d.isPointLightShadow!==!0&&this.type===3&&v(d,s),d.needsUpdate=!1}
vendor: 32,639 bytes, line 4372
4372_=this.type,g.needsUpdate=!1,e.setRenderTarget(c,l,d)};function v(n,r){let a=t.update(h);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),n.mapPass===null&&(n.mapPass=new hh(i.x,i.y,{format:Nf,type:bf})),f.uniforms.shadow_pass.value=n.map.depthTexture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,f,h,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,h,null)}function y(t,n,r,i){let a=null,o=r.isPointLight===!0?t.customDistanceMaterial:t.customDepthMaterial;if(o!==void 0)a=o;else if(a=r.isPointLight===!0?c:s,e.localClippingEnabled&&n.clipShadows===!0&&Array.isArray(n.clippingPlanes)&&n.clippingPlanes.length!==0||n.displacementMap&&n.displacementScale!==0||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l<u;l++){let u=t[l],d=c[u.materialIndex];if(d&&d.visible){let t=y(n,d,o,s);n.onBeforeShadow(e,n,i,a,r,t,u),e.renderBufferDirect(a,null,r,t,n,u),n.onAfterShadow(e,n,i,a,r,t,u)}}}else if(c.visible){let t=y(n,c,o,s);n.onBeforeShadow(e,n,i,a,r,t,null),e.renderBufferDirect(a,null,r,t,n,null),n.onAfterShadow(e,n,i,a,r,t,null)}}let c=n.children;for(let e=0,t=c.length;e<t;e++)b(c[e],i,a,o,s)}function x(e){for(let t in e.target.removeEventListener(`dispose`,x),l){let n=l[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}}var iO={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};function aO(e,t){function n(){let t=!1,n=new ph,r=null,i=new ph(0,0,0,0);return{setMask:function(n){r!==n&&!t&&(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){s===!0&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),i.equals(n)===!1&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}}function r(){let n=!1,r=!1,i=null,a=null,o=null;return{setReversed:function(e){if(r!==e){let n=t.get(`EXT_clip_control`);e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;let i=o;o=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?R(e.DEPTH_TEST):ae(e.DEPTH_TEST)},setMask:function(t){i!==t&&!n&&(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=iO[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){o!==t&&(r&&(t=1-t),e.clearDepth(t),o=t)},reset:function(){n=!1,i=null,a=null,o=null,r=!1}}}function i(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(n){t||(n?R(e.STENCIL_TEST):ae(e.STENCIL_TEST))},setMask:function(r){n!==r&&!t&&(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||c!==r)&&(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}}let a=new n,o=new r,s=new i,c=new WeakMap,l=new WeakMap,u={},d={},f=new WeakMap,p=[],m=null,h=!1,g=null,_=null,v=null,y=null,b=null,x=null,S=null,C=new Z(0,0,0),w=0,T=!1,E=null,D=null,O=null,k=null,A=null,j=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ee=!1,M=0,te=e.getParameter(e.VERSION);te.indexOf(`WebGL`)===-1?te.indexOf(`OpenGL ES`)!==-1&&(M=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),ee=M>=2):(M=parseFloat(/^WebGL (\d)/.exec(te)[1]),ee=M>=1);let N=null,P={},F=e.getParameter(e.SCISSOR_BOX),I=e.getParameter(e.VIEWPORT),ne=new ph().fromArray(F),re=new ph().fromArray(I);function L(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<r;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}let ie={};ie[e.TEXTURE_2D]=L(e.TEXTURE_2D,e.TEXTURE_2D,1),ie[e.TEXTURE_CUBE_MAP]=L(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),ie[e.TEXTURE_2D_ARRAY]=L(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),ie[e.TEXTURE_3D]=L(e.TEXTURE_3D,e.TEXTURE_3D,1,1),a.setClear(0,0,0,1),o.setClear(1),s.setClear(0),R(e.DEPTH_TEST),o.setFunc(3),fe(!1),B(1),R(e.CULL_FACE),ue(0);function R(t){u[t]!==!0&&(e.enable(t),u[t]=!0)}function ae(t){u[t]!==!1&&(e.disable(t),u[t]=!1)}function oe(t,n){return d[t]===n?!1:(e.bindFramebuffer(t,n),d[t]=n,t===e.DRAW_FRAMEBUFFER&&(d[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(d[e.DRAW_FRAMEBUFFER]=n),!0)}function se(t,n){let r=p,i=!1;if(t){r=f.get(n),r===void 0&&(r=[],f.set(n,r));let a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)}function ce(t){return m===t?!1:(e.useProgram(t),m=t,!0)}let z={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};z[103]=e.MIN,z[104]=e.MAX;let le={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function ue(t,n,r,i,a,o,s,c,l,u){if(t===0){h===!0&&(ae(e.BLEND),h=!1);return}if(h===!1&&(R(e.BLEND),h=!0),t!==5){if(t!==g||u!==T){if((_!==100||b!==100)&&(e.blendEquation(e.FUNC_ADD),_=100,b=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:_m(`WebGLState: Invalid blending: `,t);break}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:_m(`WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true`);break;case 4:_m(`WebGLState: MultiplyBlending requires material.premultipliedAlpha = true`);break;default:_m(`WebGLState: Invalid blending: `,t);break}v=null,y=null,x=null,S=null,C.set(0,0,0),w=0,g=t,T=u}return}a||=n,o||=r,s||=i,(n!==_||a!==b)&&(e.blendEquationSeparate(z[n],z[a]),_=n,b=a),(r!==v||i!==y||o!==x||s!==S)&&(e.blendFuncSeparate(le[r],le[i],le[o],le[s]),v=r,y=i,x=o,S=s),(c.equals(C)===!1||l!==w)&&(e.blendColor(c.r,c.g,c.b,l),C.copy(c),w=l),g=t,T=!1}function de(t,n){t.side===2?ae(e.CULL_FACE):R(e.CULL_FACE);let r=t.side===1;n&&(r=!r),fe(r),t.blending===1&&t.transparent===!1?ue(0):ue(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),a.setMask(t.colorWrite);let i=t.stencilWrite;s.setTest(i),i&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),me(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),t.alphaToCoverage===!0?R(e.SAMPLE_ALPHA_TO_COVERAGE):ae(e.SAMPLE_ALPHA_TO_COVERAGE)}function fe(t){E!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),E=t)}function B(t){t===0?ae(e.CULL_FACE):(R(e.CULL_FACE),t!==D&&(t===1?e.cullFace(e.BACK):t===2?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))),D=t}function pe(t){t!==O&&(ee&&e.lineWidth(t),O=t)}function me(t,n,r){t?(R(e.POLYGON_OFFSET_FILL),(k!==n||A!==r)&&(e.polygonOffset(n,r),k=n,A=r)):ae(e.POLYGON_OFFSET_FILL)}function he(t){t?R(e.SCISSOR_TEST):ae(e.SCISSOR_TEST)}function V(t){t===void 0&&(t=e.TEXTURE0+j-1),N!==t&&(e.activeTexture(t),N=t)}function H(t,n,r){r===void 0&&(r=N===null?e.TEXTURE0+j-1:N);let i=P[r];i===void 0&&(i={type:void 0,texture:void 0},P[r]=i),(i.type!==t||i.texture!==n)&&(N!==r&&(e.activeTexture(r),N=r),e.bindTexture(t,n||ie[t]),i.type=t,i.texture=n)}function U(){let t=P[N];t!==void 0&&t.type!==void 0&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)}function ge(){try{e.compressedTexImage2D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function _e(){try{e.compressedTexImage3D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function ve(){try{e.texSubImage2D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function ye(){try{e.texSubImage3D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function be(){try{e.compressedTexSubImage2D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function xe(){try{e.compressedTexSubImage3D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function Se(){try{e.texStorage2D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function Ce(){try{e.texStorage3D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function we(){try{e.texImage2D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function Te(){try{e.texImage3D(...arguments)}catch(e){_m(`WebGLState:`,e)}}function Ee(t){ne.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),ne.copy(t))}function De(t){re.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),re.copy(t))}function Oe(t,n){let r=l.get(n);r===void 0&&(r=new WeakMap,l.set(n,r));let i=r.get(t);i===void 0&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))}function ke(t,n){let r=l.get(n).get(t);c.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),c.set(n,r))}function Ae(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),o.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),u={},N=null,P={},d={},f=new WeakMap,p=[],m=null,h=!1,g=null,_=null,v=null,y=null,b=null,x=null,S=null,C=new Z(0,0,0),w=0,T=!1,E=null,D=null,O=null,k=null,A=null,ne.set(0,0,e.canvas.width,e.canvas.height),re.set(0,0,e.canvas.width,e.canvas.height),a.reset(),o.reset(),s.reset()}return{buffers:{color:a,depth:o,stencil:s},enable:R,disable:ae,bindFramebuffer:oe,drawBuffers:se,useProgram:ce,setBlending:ue,setMaterial:de,setFlipSided:fe,setCullFace:B,setLineWidth:pe,setPolygonOffset:me,setScissorTest:he,activeTexture:V,bindTexture:H,unbindTexture:U,compressedTexImage2D:ge,compressedTexImage3D:_e,texImage2D:we,texImage3D:Te,updateUBOMapping:Oe,uniformBlockBinding:ke,texStorage2D:Se,texStorage3D:Ce,texSubImage2D:ve,texSubImage3D:ye,compressedTexSubImage2D:be,compressedTexSubImage3D:xe,scissor:Ee,viewport:De,reset:Ae}}function oO(e,t,n,r,i,a,o){let s=t.has(`WEBGL_multisampled_render_to_texture`)?t.get(`WEBGL_multisampled_render_to_texture`):null,c=typeof navigator>`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new Y,u=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function m(e,t){return p?new OffscreenCanvas(e,t):um(`canvas`)}function h(e,t,n){let r=1,i=H(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);d===void 0&&(d=m(n,a));let o=t?m(n,a):d;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),J(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}else return`data`in e&&J(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e;return e}function g(e){return e.generateMipmaps}function _(t){e.generateMipmap(t)}function v(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function y(n,r,i,a,o=!1){if(n!==null){if(e[n]!==void 0)return e[n];J(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGB8UI),i===e.UNSIGNED_SHORT&&(s=e.RGB16UI),i===e.UNSIGNED_INT&&(s=e.RGB32UI),i===e.BYTE&&(s=e.RGB8I),i===e.SHORT&&(s=e.RGB16I),i===e.INT&&(s=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(s=e.RGBA16UI),i===e.UNSIGNED_INT&&(s=e.RGBA32UI),i===e.BYTE&&(s=e.RGBA8I),i===e.SHORT&&(s=e.RGBA16I),i===e.INT&&(s=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(s=e.R11F_G11F_B10F)),r===e.RGBA){let t=o?Ip:nh.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return(s===e.R16F||s===e.R32F||s===e.RG16F||s===e.RG32F||s===e.RGBA16F||s===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),s}function b(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,J(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return g(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener(`dispose`,S),w(t),t.isVideoTexture&&u.delete(t)}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),E(t)}function w(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=f.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&T(e),Object.keys(i).length===0&&f.delete(n)}r.remove(e)}function T(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=f.get(i);delete a[n.__cacheKey],o.memory.textures--}function E(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let i=t.textures;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}let D=0;function O(){D=0}function k(){let e=D;return e>=i.maxTextures&&J(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),D+=1,e}function A(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function j(t,i){let a=r.get(t);if(t.isVideoTexture&&he(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)J(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)J(`WebGLRenderer: Texture marked for update but image is incomplete`);else{ie(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function ee(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ie(a,t,i);return}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function M(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ie(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function te(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){R(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let N={[$d]:e.REPEAT,[ef]:e.CLAMP_TO_EDGE,[tf]:e.MIRRORED_REPEAT},P={[nf]:e.NEAREST,[rf]:e.NEAREST_MIPMAP_NEAREST,[of]:e.NEAREST_MIPMAP_LINEAR,[cf]:e.LINEAR,[lf]:e.LINEAR_MIPMAP_NEAREST,[df]:e.LINEAR_MIPMAP_LINEAR},F={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function I(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&J(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,N[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,N[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,N[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,P[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,P[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,F[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ne(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,S));let i=n.source,a=f.get(i);a===void 0&&(a={},f.set(i,a));let s=A(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&T(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function re(e,t,n){return Math.floor(Math.floor(e/n)/t)}function L(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e<o.length;e++){let t=o[s],n=o[e],i=t.start+t.count,a=re(n.start,r.width,4),c=re(t.start,r.width,4);n.start<=i+1&&a===c&&re(n.start+n.count-1,r.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):(++s,o[s]=n)}o.length=s+1;let c=e.getParameter(e.UNPACK_ROW_LENGTH),l=e.getParameter(e.UNPACK_SKIP_PIXELS),u=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(let t=0,s=o.length;t<s;t++){let s=o[t],c=Math.floor(s.start/4),l=Math.ceil(s.count/4),u=c%r.width,d=Math.floor(c/r.width),f=l;e.pixelStorei(e.UNPACK_SKIP_PIXELS,u),e.pixelStorei(e.UNPACK_SKIP_ROWS,d),n.texSubImage2D(e.TEXTURE_2D,0,u,d,f,1,i,a,r.data)}t.clearUpdateRanges(),e.pixelStorei(e.UNPACK_ROW_LENGTH,c),e.pixelStorei(e.UNPACK_SKIP_PIXELS,l),e.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}function ie(t,o,s){let c=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(c=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(c=e.TEXTURE_3D);let l=ne(t,o),u=o.source;n.bindTexture(c,t.__webglTexture,e.TEXTURE0+s);let d=r.get(u);if(u.version!==d.__version||l===!0){n.activeTexture(e.TEXTURE0+s);let t=nh.getPrimaries(nh.workingColorSpace),r=o.colorSpace===``?null:nh.getPrimaries(o.colorSpace),f=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let p=h(o.image,!1,i.maxTextureSize);p=V(o,p);let m=a.convert(o.format,o.colorSpace),v=a.convert(o.type),S=y(o.internalFormat,m,v,o.colorSpace,o.isVideoTexture);I(c,o);let C,w=o.mipmaps,T=o.isVideoTexture!==!0,E=d.__version===void 0||l===!0,D=u.dataReady,O=x(o,p);if(o.isDepthTexture)S=b(o.format===Af,o.type),E&&(T?n.texStorage2D(e.TEXTURE_2D,1,S,p.width,p.height):n.texImage2D(e.TEXTURE_2D,0,S,p.width,p.height,0,m,v,null));else if(o.isDataTexture)if(w.length>0){T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t<r;t++)C=w[t],T?D&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,C.width,C.height,m,v,C.data):n.texImage2D(e.TEXTURE_2D,t,S,C.width,C.height,0,m,v,C.data);o.generateMipmaps=!1}else T?(E&&n.texStorage2D(e.TEXTURE_2D,O,S,p.width,p.height),D&&L(o,p,m,v)):n.texImage2D(e.TEXTURE_2D,0,S,p.width,p.height,0,m,v,p.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){T&&E&&n.texStorage3D(e.TEXTURE_2D_ARRAY,O,S,w[0].width,w[0].height,p.depth);for(let t=0,r=w.length;t<r;t++)if(C=w[t],o.format!==1023)if(m!==null)if(T){if(D)if(o.layerUpdates.size>0){let r=$w(C.width,C.height,o.format,o.type);for(let i of o.layerUpdates){let a=C.data.subarray(i*r/C.data.BYTES_PER_ELEMENT,(i+1)*r/C.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,C.width,C.height,1,m,a)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,C.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,C.data,0,0);else J(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`);else T?D&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,v,C.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,m,v,C.data)}else{T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t<r;t++)C=w[t],o.format===1023?T?D&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,C.width,C.height,m,v,C.data):n.texImage2D(e.TEXTURE_2D,t,S,C.width,C.height,0,m,v,C.data):m===null?J(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`):T?D&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,C.width,C.height,m,C.data):n.compressedTexImage2D(e.TEXTURE_2D,t,S,C.width,C.height,0,C.data)}else if(o.isDataArrayTexture)if(T){if(E&&n.texStorage3D(e.TEXTURE_2D_ARRAY,O,S,p.width,p.height,p.depth),D)if(o.layerUpdates.size>0){let t=$w(p.width,p.height,o.format,o.type);for(let r of o.layerUpdates){let i=p.data.subarray(r*t/p.data.BYTES_PER_ELEMENT,(r+1)*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,p.width,p.height,1,m,v,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isData3DTexture)T?(E&&n.texStorage3D(e.TEXTURE_3D,O,S,p.width,p.height,p.depth),D&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)):n.texImage3D(e.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isFramebufferTexture){if(E)if(T)n.texStorage2D(e.TEXTURE_2D,O,S,p.width,p.height);else{let t=p.width,r=p.height;for(let i=0;i<O;i++)n.texImage2D(e.TEXTURE_2D,i,S,t,r,0,m,v,null),t>>=1,r>>=1}}else if(w.length>0){if(T&&E){let t=H(w[0]);n.texStorage2D(e.TEXTURE_2D,O,S,t.width,t.height)}for(let t=0,r=w.length;t<r;t++)C=w[t],T?D&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,m,v,C):n.texImage2D(e.TEXTURE_2D,t,S,m,v,C);o.generateMipmaps=!1}else if(T){if(E){let t=H(p);n.texStorage2D(e.TEXTURE_2D,O,S,t.width,t.height)}D&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,m,v,p)}else n.texImage2D(e.TEXTURE_2D,0,S,m,v,p);g(o)&&_(c),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function R(t,o,s){if(o.image.length!==6)return;let c=ne(t,o),l=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let u=r.get(l);if(l.version!==u.__version||c===!0){n.activeTexture(e.TEXTURE0+s);let t=nh.getPrimaries(nh.workingColorSpace),r=o.colorSpace===``?null:nh.getPrimaries(o.colorSpace),d=o.colorSpace===``||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,p=o.image[0]&&o.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)!f&&!p?m[e]=h(o.image[e],!0,i.maxCubemapSize):m[e]=p?o.image[e].image:o.image[e],m[e]=V(o,m[e]);let v=m[0],b=a.convert(o.format,o.colorSpace),S=a.convert(o.type),C=y(o.internalFormat,b,S,o.colorSpace),w=o.isVideoTexture!==!0,T=u.__version===void 0||c===!0,E=l.dataReady,D=x(o,v);I(e.TEXTURE_CUBE_MAP,o);let O;if(f){w&&T&&n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,v.width,v.height);for(let t=0;t<6;t++){O=m[t].mipmaps;for(let r=0;r<O.length;r++){let i=O[r];o.format===1023?w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,b,S,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,C,i.width,i.height,0,b,S,i.data):b===null?J(`WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()`):w?E&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,b,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,C,i.width,i.height,0,i.data)}}}else{if(O=o.mipmaps,w&&T){O.length>0&&D++;let t=H(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,b,S,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,b,S,m[t].data);for(let r=0;r<O.length;r++){let i=O[r].image[t].image;w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,b,S,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,C,i.width,i.height,0,b,S,i.data)}}else{w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,b,S,m[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,b,S,m[t]);for(let r=0;r<O.length;r++){let i=O[r];w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,b,S,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,C,b,S,i.image[t])}}}g(o)&&_(e.TEXTURE_CUBE_MAP),u.__version=l.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function ae(t,i,o,c,l,u){let d=a.convert(o.format,o.colorSpace),f=a.convert(o.type),p=y(o.internalFormat,d,f,o.colorSpace),m=r.get(i),h=r.get(o);if(h.__renderTarget=i,!m.__hasExternalTextures){let t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),me(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,pe(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function oe(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;me(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,pe(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,pe(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i<t.length;i++){let o=t[i],c=a.convert(o.format,o.colorSpace),l=a.convert(o.type),u=y(o.internalFormat,c,l,o.colorSpace);me(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,pe(n),u,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,pe(n),u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function se(t,i,o){let c=i.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(i.depthTexture&&i.depthTexture.isDepthTexture))throw Error(`renderTarget.depthTexture must be an instance of THREE.DepthTexture`);let l=r.get(i.depthTexture);if(l.__renderTarget=i,(!l.__webglTexture||i.depthTexture.image.width!==i.width||i.depthTexture.image.height!==i.height)&&(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),c){if(l.__webglInit===void 0&&(l.__webglInit=!0,i.depthTexture.addEventListener(`dispose`,S)),l.__webglTexture===void 0){l.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),I(e.TEXTURE_CUBE_MAP,i.depthTexture);let t=a.convert(i.depthTexture.format),r=a.convert(i.depthTexture.type),o;i.depthTexture.format===1026?o=e.DEPTH_COMPONENT24:i.depthTexture.format===1027&&(o=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o,i.width,i.height,0,t,r,null)}}else j(i.depthTexture,0);let u=l.__webglTexture,d=pe(i),f=c?e.TEXTURE_CUBE_MAP_POSITIVE_X+o:e.TEXTURE_2D,p=i.depthTexture.format===1027?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(i.depthTexture.format===1026)me(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else if(i.depthTexture.format===1027)me(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,p,f,u,0,d):e.framebufferTexture2D(e.FRAMEBUFFER,p,f,u,0);else throw Error(`Unknown depthTexture format`)}
vendor: 5,612 bytes, line 4372
4372function ce(t){let i=r.get(t),a=t.isWebGLCubeRenderTarget===!0;if(i.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){let t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)se(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?se(i.__webglFramebuffer[0],t,0):se(i.__webglFramebuffer,t,0)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),oe(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),oe(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function z(t,n,i){let a=r.get(t);n!==void 0&&ae(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&ce(t)}function le(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,C);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(d)for(let t=0,n=l.length;t<n;t++){let n=r.get(l[t]);n.__webglTexture===void 0&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&me(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<l.length;n++){let r=l[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);let i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),c=y(r.internalFormat,i,o,r.colorSpace,t.isXRRenderTarget===!0),u=pe(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),oe(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),I(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)ae(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else ae(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(i)&&_(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(d){for(let i=0,a=l.length;i<a;i++){let a=l[i],o=r.get(a),c=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(c=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(c,o.__webglTexture),I(c,a),ae(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,c,0),g(a)&&_(c)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,c.__webglTexture),I(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)ae(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else ae(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);g(i)&&_(r),n.unbindTexture()}t.depthBuffer&&ce(t)}function ue(e){let t=e.textures;for(let i=0,a=t.length;i<a;i++){let a=t[i];if(g(a)){let t=v(e),i=r.get(a).__webglTexture;n.bindTexture(t,i),_(t),n.unbindTexture()}}}let de=[],fe=[];function B(t){if(t.samples>0){if(me(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer);let f=t.texture.mipmaps;f&&f.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),d){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRen
vendor: 10,161 bytes, lines 4372-4396
4372derbuffer[n]);let t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),c===!0&&(de.length=0,fe.length=0,de.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&t.resolveDepthBuffer===!1&&(de.push(l),fe.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,fe)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,de))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),d)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,u.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,u.__webglColorRenderbuffer[t]);let a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,u.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&t.resolveDepthBuffer===!1&&c){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}}function pe(e){return Math.min(i.maxSamples,e.samples)}function me(e){let n=r.get(e);return e.samples>0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function he(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function V(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(nh.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&J(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):_m(`WebGLTextures: Unsupported texture color space:`,n)),t}function H(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=k,this.resetTextureUnits=O,this.setTexture2D=j,this.setTexture2DArray=ee,this.setTexture3D=M,this.setTextureCube=te,this.rebindTextures=z,this.setupRenderTarget=le,this.updateRenderTargetMipmap=ue,this.updateMultisampleRenderTarget=B,this.setupDepthRenderbuffer=ce,this.setupFrameBufferTexture=ae,this.useMultisampledRTT=me,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function sO(e,t){function n(n,r=``){let i,a=nh.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779)if(a===`srgb`)if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===35840||n===35841||n===35842||n===35843)if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491)if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821)if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===36492||n===36494||n===36495)if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===36283||n===36284||n===36285||n===36286)if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}var cO=` 4373void main() { 4374 4375 gl_Position = vec4( position, 1.0 ); 4376 4377}`,lO=` 4378uniform sampler2DArray depthColor; 4379uniform float depthWidth; 4380uniform float depthHeight; 4381 4382void main() { 4383 4384 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 4385 4386 if ( coord.x >= 1.0 ) { 4387 4388 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 4389 4390 } else { 4391 4392 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 4393 4394 } 4395 4396}`,uO=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Zy(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new I_({vertexShader:cO,fragmentShader:lO,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new T_(new Ox(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},dO=class extends bm{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new uO,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new Y,C=null,w=new V_;w.viewport=new ph;let T=new V_;T.viewport=new ph;let E=[w,T],D=new mC,O=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new Y_,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new Y_,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new Y_,b[e]=t),t.getHandSpace()};function A(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function j(){r.removeEventListener(`select`,A),r.removeEventListener(`selectstart`,A),r.removeEventListener(`selectend`,A),r.removeEventListener(`squeeze`,A),r.removeEventListener(`squeezestart`,A),r.removeEventListener(`squeezeend`,A),r.removeEventListener(`end`,j),r.removeEventListener(`inputsourceschange`,ee);for(let e=0;e<b.length;e++){let t=x[e];t!==null&&(x[e]=null,b[e].disconnect(t))}for(let e in O=null,k=null,h.reset(),g)delete g[e];e.setRenderTarget(v),f=null,d=null,u=null,r=null,y=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(S.width,S.height,!1),n.dispatchEvent({type:`sessionend`})}this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting===!0&&J(`WebXRManager: Cannot change framebuffer scale while presenting.`)},this.setReferenceSpaceType=function(e){o=e,n.isPresenting===!0&&J(`WebXRManager: Cannot change reference space type while presenting.`)},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return d===null?f:d},this.getBinding=function(){return u===null&&m&&(u=new XRWebGLBinding(r,t)),u},this.getFrame=function(){return p}
vendor: 6,626 bytes, line 4396
4396,this.getSession=function(){return r},this.setSession=async function(l){if(r=l,r!==null){if(v=e.getRenderTarget(),r.addEventListener(`select`,A),r.addEventListener(`selectstart`,A),r.addEventListener(`selectend`,A),r.addEventListener(`squeeze`,A),r.addEventListener(`squeezestart`,A),r.addEventListener(`squeezeend`,A),r.addEventListener(`end`,j),r.addEventListener(`inputsourceschange`,ee),_.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(S),m&&`createProjectionLayer`in XRWebGLBinding.prototype){let n=null,a=null,o=null;_.depth&&(o=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=_.stencil?Af:kf,a=_.stencil?Cf:vf);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=this.getBinding(),d=u.createProjectionLayer(s),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new hh(d.textureWidth,d.textureHeight,{format:Of,type:pf,depthTexture:new Yy(d.textureWidth,d.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{let n={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:i};f=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new hh(f.framebufferWidth,f.framebufferHeight,{format:Of,type:pf,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(s),c=null,a=await r.requestReferenceSpace(o),re.setContext(r),re.start(),n.isPresenting=!0,n.dispatchEvent({type:`sessionstart`})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return h.getDepthTexture()};function ee(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],r=x.indexOf(n);r>=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],r=x.indexOf(n);if(r===-1){for(let e=0;e<b.length;e++)if(e>=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let M=new X,te=new X;function N(e,t,n){M.setFromMatrixPosition(t.matrixWorld),te.setFromMatrixPosition(n.matrixWorld);let r=M.distanceTo(te),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function P(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||k!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&3,T.layers.mask=D.layers.mask&5;let i=e.parent,a=D.cameras;P(D,i);for(let e=0;e<a.length;e++)P(a[e],i);a.length===2?N(D,w,T):D.projectionMatrix.copy(w.projectionMatrix),F(e,D,i)};function F(e,t,n){n===null?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=wm*2*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}this.getCamera=function(){return D},this.getFoveation=function(){if(!(d===null&&f===null))return s},this.setFoveation=function(e){s=e,d!==null&&(d.fixedFoveation=e),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return h.texture!==null},this.getDepthSensingMesh=function(){return h.getMesh(D)},this.getCameraTexture=function(e){return g[e]};let I=null;function ne(t,i){if(l=i.getViewerPose(c||a),p=i,l!==null){let t=l.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let i=!1;t.length!==D.cameras.length&&(D.cameras.length=0,i=!0);for(let n=0;n<t.length;n++){let r=t[n],a=null;if(f!==null)a=f.getViewport(r);else{let t=u.getViewSubImage(d,r);a=t.viewport,n===0&&(e.setRenderTargetTextures(y,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(y))}let o=E[n];o===void 0&&(o=new V_,o.layers.enable(n),o.viewport=new ph,E[n]=o),o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(r.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),n===0&&(D.matrix.copy(o.matrix),D.matrix.decompose(D.position,D.quaternion,D.scale)),i===!0&&D.cameras.push(o)}let a=r.enabledFeatures;if(a&&a.includes(`depth-sensing`)&&r.depthUsage==`gpu-optimized`&&m){u=n.getBinding();let e=u.getDepthInformation(t[0]);e&&e.isValid&&e.texture&&h.init(e,r.renderState)}if(a&&a.includes(`camera-access`)&&m){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=g[n];e||(e=new Zy,g[n]=e),e.sourceTexture=u.getCameraImage(n)}}}}for(let e=0;e<b.length;e++){let t=x[e],n=b[e];t!==null&&n!==void 0&&n.update(t,i,c||a)}I&&I(t,i),i.detectedPlanes&&n.dispatchEvent({type:`planesdetected`,data:i}),p=null}let re=new rT;re.setAnimationLoop(ne),this.setAnimationLoop=function(e){I=e},this.dispose=function(){}}},fO=new rg,pO=new qh;function mO(e,t){function n(e,t){e.matrixAutoUpdate===!0&&e.updateMatrix(),t.value.copy(e.matrix)}function r(t,n){n.color.getRGB(t.fogColor.value,M_(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)}function i(e,t,n,r,i){t.isMeshBasicMaterial||t.isMeshLambertMaterial?a(e,t):t.isMeshToonMaterial?(a(e,t),d(e,t)):t.isMeshPhongMaterial?(a(e,t),u(e,t)):t.isMeshStandardMaterial?(a(e,t),f(e,t),t.isMeshPhysicalMaterial&&p(e,t,i)):t.isMeshMat
vendor: 8,477 bytes, line 4396
4396capMaterial?(a(e,t),m(e,t)):t.isMeshDepthMaterial?a(e,t):t.isMeshDistanceMaterial?(a(e,t),h(e,t)):t.isMeshNormalMaterial?a(e,t):t.isLineBasicMaterial?(o(e,t),t.isLineDashedMaterial&&s(e,t)):t.isPointsMaterial?c(e,t,n,r):t.isSpriteMaterial?l(e,t):t.isShadowMaterial?(e.color.value.copy(t.color),e.opacity.value=t.opacity):t.isShaderMaterial&&(t.uniformsNeedUpdate=!1)}function a(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,r.side===1&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),r.side===1&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,fO.copy(o),fO.x*=-1,fO.y*=-1,fO.z*=-1,a.isCubeTexture&&a.isRenderTargetTexture===!1&&(fO.y*=-1,fO.z*=-1),e.envMapRotation.value.setFromMatrix4(pO.makeRotationFromEuler(fO)),e.flipEnvMap.value=a.isCubeTexture&&a.isRenderTargetTexture===!1?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function hO(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(m(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,g));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e<s;e++)if(o.indexOf(e)===-1)return o.push(e),e;return _m(`WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.`),0}function f(t){let n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=r.length;t<n;t++){let n=Array.isArray(r[t])?r[t]:[r[t]];for(let r=0,i=n.length;r<i;r++){let i=n[r];if(p(i,t,r,a)===!0){let t=i.__offset,n=Array.isArray(i.value)?i.value:[i.value],r=0;for(let a=0;a<n.length;a++){let o=n[a],s=h(o);typeof o==`number`||typeof o==`boolean`?(i.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+r,i.__data)):o.isMatrix3?(i.__data[0]=o.elements[0],i.__data[1]=o.elements[1],i.__data[2]=o.elements[2],i.__data[3]=0,i.__data[4]=o.elements[3],i.__data[5]=o.elements[4],i.__data[6]=o.elements[5],i.__data[7]=0,i.__data[8]=o.elements[6],i.__data[9]=o.elements[7],i.__data[10]=o.elements[8],i.__data[11]=0):(o.toArray(i.__data,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,i.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}function p(e,t,n,r){let i=e.value,a=t+`_`+n;if(r[a]===void 0)return typeof i==`number`||typeof i==`boolean`?r[a]=i:r[a]=i.clone(),!0;{let e=r[a];if(typeof i==`number`||typeof i==`boolean`){if(e!==i)return r[a]=i,!0}else if(e.equals(i)===!1)return e.copy(i),!0}return!1}function m(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e<r;e++){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){let t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){let r=i[e],a=h(r),o=n%16,s=o%a.boundary,c=o+s;n+=s,c!==0&&16-c<a.storage&&(n+=16-c),t.__data=new Float32Array(a.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=a.storage}}}let r=n%16;return r>0&&(n+=16-r),e.__size=n,e.__cache={},this}
vendor: 1,801 bytes, line 4396
4396function h(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?J(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):J(`WebGLRenderer: Unsupported uniform value type.`,e),t}function g(t){let n=t.target;n.removeEventListener(`dispose`,g);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function _(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:_}}var gO=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,
vendor: 30,780 bytes, line 4396
439614942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),_O=null;function vO(){return _O===null&&(_O=new Mv(gO,16,16,Nf,bf),_O.name=`DFG_LUT`,_O.minFilter=cf,_O.magFilter=cf,_O.wrapS=ef,_O.wrapT=ef,_O.generateMipmaps=!1,_O.needsUpdate=!0),_O}var yO=class{constructor(e={}){let{canvas:t=dm(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=pf}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([If,Pf,Mf]),g=new Set([pf,vf,gf,Cf,xf,Sf]),_=new Uint32Array(4),v=new Int32Array(4),y=null,b=null,x=[],S=[],C=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let w=this,T=!1;this._outputColorSpace=Pp;let E=0,D=0,O=null,k=-1,A=null,j=new ph,ee=new ph,M=null,te=new Z(0),N=0,P=t.width,F=t.height,I=1,ne=null,re=null,L=new ph(0,0,P,F),ie=new ph(0,0,P,F),R=!1,ae=new Qv,oe=!1,se=!1,ce=new qh,z=new X,le=new ph,ue={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},de=!1;function fe(){return O===null?I:1}let B=n;function pe(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r182`),t.addEventListener(`webglcontextlost`,Le,!1),t.addEventListener(`webglcontextrestored`,Re,!1),t.addEventListener(`webglcontextcreationerror`,ze,!1),B===null){let t=`webgl2`;if(B=pe(t,e),B===null)throw pe(t)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(e){throw _m(`WebGLRenderer: `+e.message),e}let me,he,V,H,U,ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe;function Fe(){me=new LT(B),me.init(),Me=new sO(B,me),he=new pT(B,me,e,Me),V=new aO(B,me),he.reversedDepthBuffer&&d&&V.buffers.depth.setReversed(!0),H=new BT(B),U=new RD,ge=new oO(B,me,V,U,he,Me,H),_e=new hT(w),ve=new IT(w),ye=new iT(B),Ne=new dT(B,ye),be=new RT(B,ye,H,Ne),xe=new HT(B,be,ye,H),ke=new VT(B,he,ge),Ee=new mT(U),Se=new LD(w,_e,ve,me,he,Ne,Ee),Ce=new mO(w,U),we=new HD,Te=new YD(me),Oe=new uT(w,_e,ve,V,xe,p,s),De=new rO(w,xe,he),Pe=new hO(B,H,he,V),Ae=new fT(B,me,H),je=new zT(B,me,H),H.programs=Se.programs,w.capabilities=he,w.extensions=me,w.properties=U,w.renderLists=we,w.shadowMap=De,w.state=V,w.info=H}Fe(),m!==1009&&(C=new WT(m,t.width,t.height,r,i));let Ie=new dO(w,B);this.xr=Ie,this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){let e=me.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=me.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){e!==void 0&&(I=e,this.setSize(P,F,!1))},this.getSize=function(e){return e.set(P,F)},this.setSize=function(e,n,r=!0){if(Ie.isPresenting){J(`WebGLRenderer: Can't change size while VR device is presenting.`);return}P=e,F=n,t.width=Math.floor(e*I),t.height=Math.floor(n*I),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),C!==null&&C.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(P*I,F*I).floor()},this.setDrawingBufferSize=function(e,n,r){P=e,F=n,I=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){console.error(`THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t<e.length;t++)if(e[t].isOutputPass===!0){console.warn(`THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.`);break}}C.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(j)},this.getViewport=function(e){return e.copy(L)},this.setViewport=function(e,t,n,r){e.isVector4?L.set(e.x,e.y,e.z,e.w):L.set(e,t,n,r),V.viewport(j.copy(L).multiplyScalar(I).round())},this.getScissor=function(e){return e.copy(ie)},this.setScissor=function(e,t,n,r){e.isVector4?ie.set(e.x,e.y,e.z,e.w):ie.set(e,t,n,r),V.scissor(ee.copy(ie).multiplyScalar(I).round())},this.getScissorTest=function(){return R},this.setScissorTest=function(e){V.setScissorTest(R=e)},this.setOpaqueSort=function(e){ne=e},this.setTransparentSort=function(e){re=e},this.getClearColor=function(e){return e.copy(Oe.getClearColor())},this.setClearColor=function(){Oe.setClearColor(...arguments)},this.getClearAlpha=function(){return Oe.getClearAlpha()},this.setClearAlpha=function(){Oe.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(O!==null){let t=O.texture.format;e=h.has(t)}if(e){let e=O.texture.type,t=g.has(e),n=Oe.getClearColor(),r=Oe.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(_[0]=i,_[1]=a,_[2]=o,_[3]=r,B.clearBufferuiv(B.COLOR,0,_)):(v[0]=i,v[1]=a,v[2]=o,v[3]=r,B.clearBufferiv(B.COLOR,0,v))}else r|=B.COLOR_BUFFER_BIT}t&&(r|=B.DEPTH_BUFFER_BIT),n&&(r|=B.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),B.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener(`webglcontextlost`,Le,!1),t.removeEventListener(`webglcontextrestored`,Re,!1),t.removeEventListener(`webglcontextcreationerror`,ze,!1),Oe.dispose(),we.dispose(),Te.dispose(),U.dispose(),_e.dispose(),ve.dispose(),xe.dispose(),Ne.dispose(),Pe.dispose(),Se.dispose(),Ie.dispose(),Ie.removeEventListener(`sessionstart`,Ge),Ie.removeEventListener(`sessionend`,Ke),qe.stop()};function Le(e){e.preventDefault(),gm(`WebGLRenderer: Context Lost.`),T=!0}function Re(){gm(`WebGLRenderer: Context Restored.`),T=!1;let e=H.autoReset,t=De.enabled,n=De.autoUpdate,r=De.needsUpdate,i=De.type;Fe(),H.autoReset=e,De.enabled=t,De.autoUpdate=n,De.needsUpdate=r,De.type=i}function ze(e){_m(`WebGLRenderer: A WebGL context could not be created. Reason: `,e.statusMessage)}function W(e){let t=e.target;t.removeEventListener(`dispose`,W),Be(t)}function Be(e){Ve(e),U.remove(e)}function Ve(e){let t=U.get(e).programs;t!==void 0&&(t.forEach(function(e){Se.releaseProgram(e)}),e.isShaderMaterial&&Se.releaseShaderCache(e))}this.renderBufferDirect=function(e,t,n,r,i,a){t===null&&(t=ue);let o=i.isMesh&&i.matrixWorld.determinant()<0,s=G(e,t,n,r,i);V.setMaterial(r,o);let c=n.index,l=1;if(r.wireframe===!0){if(c=be.getWireframeAttribute(n),c===void 0)return;l=2}let u=n.drawRange,d=n.attributes.position,f=u.start*l,p=(u.start+u.count)*l;a!==null&&(f=Math.max(f,a.start*l),p=Math.min(p,(a.start+a.count)*l)),c===null?d!=null&&(f=Math.max(f,0),p=Math.min(p,d.count)):(f=Math.max(f,0),p=Math.min(p,c.count));let m=p-f;if(m<0||m===1/0)return;Ne.setup(i,r,s,n,c);let h,g=Ae;if(c!==null&&(h=ye.get(c),g=je,g.setIndex(h)),i.isMesh)r.wireframe===!0?(V.setLineWidth(r.wireframeLinewidth*fe()),g.setMode(B.LINES)):g.setMode(B.TRIANGLES);else if(i.isLine){let e=r.linewidth;e===void 0&&(e=1),V.setLineWidth(e*fe()),i.isLineSegments?g.setMode(B.LINES):i.isLineLoop?g.setMode(B.LINE_LOOP):g.setMode(B.LINE_STRIP)}else i.isPoints?g.setMode(B.POINTS):i.isSprite&&g.setMode(B.TRIANGLES);if(i.isBatchedMesh)if(i._multiDrawInstances!==null)vm(`WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.`),g.renderMultiDrawInstances(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount,i._multiDrawInstances);else if(me.get(`WEBGL_multi_draw`))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{let e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=c?ye.get(c).bytesPerElement:1,o=U.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(B,`_gl_DrawID`,r),g.render(e[r]/a,t[r])}else if(i.isInstancedMesh)g.renderInstances(f,m,i.count);else if(n.isInstancedBufferGeometry){let e=n._maxInstanceCount===void 0?1/0:n._maxInstanceCount,t=Math.min(n.instanceCount,e);g.renderInstances(f,m,t)}else g.render(f,m)};function He(e,t,n){e.transparent===!0&&e.side===2&&e.forceSinglePass===!1?(e.side=1,e.needsUpdate=!0,$e(e,t,n),e.side=0,e.needsUpdate=!0,$e(e,t,n),e.side=2):$e(e,t,n)}this.compile=function(e,t,n=null){n===null&&(n=e),b=Te.get(n),b.init(t),S.push(b),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(b.pushLight(e),e.castShadow&&b.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(b.pushLight(e),e.castShadow&&b.pushShadow(e))}),b.setupLights();let r=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){let a=t[i];He(a,n,e),r.add(a)}else He(t,n,e),r.add(t)}),b=S.pop(),r},this.compileAsync=function(e,t,n=null){let r=this.compile(e,t,n);return new Promise(t=>{function n(){if(r.forEach(function(e){U.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}me.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let Ue=null;function We(e){Ue&&Ue(e)}function Ge(){qe.stop()}function Ke(){qe.start()}let qe=new rT;qe.setAnimationLoop(We),typeof self<`u`&&qe.setContext(self),this.setAnimationLoop=function(e){Ue=e,Ie.setAnimationLoop(e),e===null?qe.stop():qe.start()},Ie.addEventListener(`sessionstart`,Ge),Ie.addEventListener(`sessionend`,Ke),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){_m(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(T===!0)return;let n=Ie.enabled===!0&&Ie.isPresenting===!0,r=C!==null&&(O===null||n)&&C.begin(w,O);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Ie.enabled===!0&&Ie.isPresenting===!0&&(C===null||C.isCompositing()===!1)&&(Ie.cameraAutoUpdate===!0&&Ie.updateCamera(t),t=Ie.getCamera()),e.isScene===!0&&e.onBeforeRender(w,e,t,O),b=Te.get(e,S.length),b.init(t),S.push(b),ce.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ae.setFromProjectionMatrix(ce,tm,t.reversedDepth),se=this.localClippingEnabled,oe=Ee.init(this.clippingPlanes,se),y=we.get(e,x.length),y.init(),x.push(y),Ie.enabled===!0&&Ie.isPresenting===!0){let e=w.xr.getDepthSensingMesh();e!==null&&Je(e,t,-1/0,w.sortObjects)}Je(e,t,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(ne,re),de=Ie.enabled===!1||Ie.isPresenting===!1||Ie.hasDepthSensing()===!1,de&&Oe.addToRenderList(y,e),this.info.render.frame++,oe===!0&&Ee.beginShadows();let i=b.state.shadowsArray;if(De.render(i,e,t),oe===!0&&Ee.endShadows(),this.info.autoReset===!0&&this.info.reset(),(r&&C.hasRenderPass())===!1){let n=y.opaque,r=y.transmissive;if(b.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t<a;t++){let a=i[t];Xe(n,r,e,a)}de&&Oe.render(e);for(let t=0,n=i.length;t<n;t++){let n=i[t];Ye(y,e,n,n.viewport)}}else r.length>0&&Xe(n,r,e,t),de&&Oe.render(e),Ye(y,e,t)}O!==null&&D===0&&(ge.updateMultisampleRenderTarget(O),ge.updateRenderTargetMipmap(O)),r&&C.end(w),e.isScene===!0&&e.onAfterRender(w,e,t),Ne.resetDefaultState(),k=-1,A=null,S.pop(),S.length>0?(b=S[S.length-1],oe===!0&&Ee.setGlobalState(w.clippingPlanes,b.state.camera)):b=null,x.pop(),y=x.length>0?x[x.length-1]:null};function Je(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)b.pushLight(e),e.castShadow&&b.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ae.intersectsSprite(e)){r&&le.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ce);let t=xe.update(e),i=e.material;i.visible&&y.push(e,t,i,n,le.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ae.intersectsObject(e))){let t=xe.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),le.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),le.copy(e.boundingSphere.center)),le.applyMatrix4(e.matrixWorld).applyMatrix4(ce)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a<o;a++){let o=r[a],s=i[o.materialIndex];s&&s.visible&&y.push(e,t,s,n,le.z,o)}}else i.visible&&y.push(e,t,i,n,le.z,null)}}let i=e.children;for(let e=0,a=i.length;e<a;e++)Je(i[e],t,n,r)}function Ye(e,t,n,r){let{opaque:i,transmissive:a,transparent:o}=e;b.setupLightsView(n),oe===!0&&Ee.setGlobalState(w.clippingPlanes,n),r&&V.viewport(j.copy(r)),i.length>0&&Ze(i,t,n),a.length>0&&Ze(a,t,n),o.length>0&&Ze(o,t,n),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1)}function Xe(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(b.state.transmissionRenderTarget[r.id]===void 0){let e=me.has(`EXT_color_buffer_half_float`)||me.has(`EXT_color_buffer_float`);b.state.transmissionRenderTarget[r.id]=new hh(1,1,{generateMipmaps:!0,type:e?bf:pf,minFilter:df,samples:he.samples,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:nh.workingColorSpace})}let a=b.state.transmissionRenderTarget[r.id],o=r.viewport||j;a.setSize(o.z*w.transmissionResolutionScale,o.w*w.transmissionResolutionScale);let s=w.getRenderTarget(),c=w.getActiveCubeFace(),l=w.getActiveMipmapLevel();w.setRenderTarget(a),w.getClearColor(te),N=w.getClearAlpha(),N<1&&w.setClearColor(16777215,.5),w.clear(),de&&Oe.render(n);let u=w.toneMapping;w.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),b.setupLightsView(r),oe===!0&&Ee.setGlobalState(w.clippingPlanes,r),Ze(e,n,r),ge.updateMultisampleRenderTarget(a),ge.updateRenderTargetMipmap(a),me.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i<a;i++){let{object:a,geometry:o,material:s,group:c}=t[i];if(s.side===2&&a.layers.test(r.layers)){let t=s.side;s.side=1,s.needsUpdate=!0,Qe(a,n,r,o,s,c),s.side=t,s.needsUpdate=!0,e=!0}}e===!0&&(ge.updateMultisampleRenderTarget(a),ge.updateRenderTargetMipmap(a))}w.setRenderTarget(s,c,l),w.setClearColor(te,N),d!==void 0&&(r.viewport=d),w.toneMapping=u}function Ze(e,t,n){let r=t.isScene===!0?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){let a=e[i],{object:o,geometry:s,group:c}=a,l=a.material;l.allowOverride===!0&&r!==null&&(l=r),o.layers.test(n.layers)&&Qe(o,t,n,s,l,c)}}function Qe(e,t,n,r,i,a){e.onBeforeRender(w,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(w,t,n,r,e,a),i.transparent===!0&&i.side===2&&i.forceSinglePass===!1?(i.side=1,i.needsUpdate=!0,w.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,w.renderBufferDirect(n,t,r,i,e,a),i.side=2):w.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(w,t,n,r,i,a)}function $e(e,t,n){t.isScene!==!0&&(t=ue);let r=U.get(e),i=b.state.lights,a=b.state.shadowsArray,o=i.state.version,s=Se.getParameters(e,i.state,a,t,n),c=Se.getProgramCacheKey(s),l=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?ve:_e).get(e.envMap||r.environment),r.envMapRotation=r.environment!==null&&e.envMap===null?t.environmentRotation:e.envMapRotation,l===void 0&&(e.addEventListener(`dispose`,W),l=new Map,r.programs=l);let u=l.get(c);if(u!==void 0){if(r.currentProgram===u&&r.lightsStateVersion===o)return tt(e,s),u}else s.uniforms=Se.getUniforms(e),e.onBeforeCompile(s,w),u=Se.acquireProgram(s,c),l.set(c,u),r.uniforms=s.uniforms;let d=r.uniforms;return(!e.isShaderMaterial&&!e.isRawShaderMaterial||e.clipping===!0)&&(d.clippingPlanes=Ee.uniform),tt(e,s),r.needsLights=rt(e),r.lightsStateVersion=o,r.needsLights&&(d.ambientLightColor.value=i.state.ambient,d.lightProbe.value=i.state.probe,d.directionalLights.value=i.state.directional,d.directionalLightShadows.value=i.state.directionalShadow,d.spotLights.value=i.state.spot,d.spotLightShadows.value=i.state.spotShadow,d.rectAreaLights.value=i.state.rectArea,d.ltc_1.value=i.state.rectAreaLTC1,d.ltc_2.value=i.state.rectAreaLTC2,d.pointLights.value=i.state.point,d.pointLightShadows.value=i.state.pointShadow,d.hemisphereLights.value=i.state.hemi,d.directionalShadowMap.value=i.state.directionalShadowMap,d.directionalShadowMatrix.value=i.state.directionalShadowMatrix,d.spotShadowMap.value=i.state.spotShadowMap,d.spotLightMatrix.value=i.state.spotLightMatrix,d.spotLightMap.value=i.state.spotLightMap,d.pointShadowMap.value=i.state.pointShadowMap,d.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=u,r.uniformsList=null,u}function et(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=ZE.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function tt(e,t){let n=U.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function G(e,t,n,r,i){t.isScene!==!0&&(t=ue),ge.resetTextureUnits();let a=t.fog,o=r.isMeshStandardMaterial?t.environment:null,s=O===null?w.outputColorSpace:O.isXRRenderTarget===!0?O.texture.colorSpace:Fp,c=(r.isMeshStandardMaterial?ve:_e).get(r.envMap||o),l=r.vertexColors===!0&&!!n.attributes.color&&n.attributes.color.itemSize===4,u=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),d=!!n.morphAttributes.position,f=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=0;r.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(m=w.toneMapping);let h=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=h===void 0?0:h.length,_=U.get(r),v=b.state.lights;if(oe===!0&&(se===!0||e!==A)){let t=e===A&&r.id===k;Ee.setState(r,e,t)}let y=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==v.state.version?y=!0:_.outputColorSpace===s?i.isBatchedMesh&&_.batching===!1||!i.isBatchedMesh&&_.batching===!0||i.isBatchedMesh&&_.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&_.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&_.instancing===!1||!i.isInstancedMesh&&_.instancing===!0||i.isSkinnedMesh&&_.skinning===!1||!i.isSkinnedMesh&&_.skinning===!0||i.isInstancedMesh&&_.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&_.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&_.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&_.instancingMorph===!1&&i.morphTexture!==null?y=!0:_.envMap===c?r.fog===!0&&_.fog!==a||_.numClippingPlanes!==void 0&&(_.numClippingPlanes!==Ee.numPlanes||_.numIntersection!==Ee.numIntersection)?y=!0:_.vertexAlphas===l&&_.vertexTangents===u&&_.morphTargets===d&&_.morphNormals===f&&_.morphColors===p&&_.toneMapping===m?_.morphTargetsCount!==g&&(y=!0):y=!0:y=!0:y=!0:(y=!0,_.__version=r.version);let x=_.currentProgram;y===!0&&(x=$e(r,t,i));let S=!1,C=!1,T=!1,E=x.getUniforms(),D=_.uniforms;if(V.useProgram(x.program)&&(S=!0,C=!0,T=!0),r.id!==k&&(k=r.id,C=!0),S||A!==e){V.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),E.setValue(B,`projectionMatrix`,e.projectionMatrix),E.setValue(B,`viewMatrix`,e.matrixWorldInverse);let t=E.map.cameraPosition;t!==void 0&&t.setValue(B,z.setFromMatrixPosition(e.matrixWorld)),he.logarithmicDepthBuffer&&E.setValue(B,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&E.setValue(B,`isOrthographic`,e.isOrthographicCamera===!0),A!==e&&(A=e,C=!0,T=!0)}if(_.needsLights&&(v.state.directionalShadowMap.length>0&&E.setValue(B,`directionalShadowMap`,v.state.directionalShadowMap,ge),v.state.spotShadowMap.length>0&&E.setValue(B,`spotShadowMap`,v.state.spotShadowMap,ge),v.state.pointShadowMap.length>0&&E.setValue(B,`pointShadowMap`,v.state.pointShadowMap,ge)),i.isSkinnedMesh){E.setOptional(B,i,`bindMatrix`),E.setOptional(B,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),E.setValue(B,`boneTexture`,e.boneTexture,ge))}i.isBatchedMesh&&(E.setOptional(B,i,`batchingTexture`),E.setValue(B,`batchingTexture`,i._matricesTexture,ge),E.setOptional(B,i,`batchingIdTexture`),E.setValue(B,`batchingIdTexture`,i._indirectTexture,ge),E.setOptional(B,i,`batchingColorTexture`),i._colorsTexture!==null&&E.setValue(B,`batchingColorTexture`,i._colorsTexture,ge));let j=n.morphAttributes;if((j.position!==void 0||j.normal!==void 0||j.color!==void 0)&&ke.update(i,n,x),(C||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,E.setValue(B,`receiveShadow`,i.receiveShadow)),r.isMeshGouraudMaterial&&r.envMap!==null&&(D.envMap.value=c,D.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1),r.isMeshStandardMaterial&&r.envMap===null&&t.environment!==null&&(D.envMapIntensity.value=t.environmentIntensity),D.dfgLUT!==void 0&&(D.dfgLUT.value=vO()),C&&(E.setValue(B,`toneMappingExposure`,w.toneMappingExposure),_.needsLights&&nt(D,T),a&&r.fog===!0&&Ce.refreshFogUniforms(D,a),Ce.refreshMaterialUniforms(D,r,I,F,b.state.transmissionRenderTarget[e.id]),ZE.upload(B,et(_),D,ge)),r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(ZE.upload(B,et(_),D,ge),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&E.setValue(B,`center`,i.center),E.setValue(B,`modelViewMatrix`,i.modelViewMatrix),E.setValue(B,`normalMatrix`,i.normalMatrix),E.setValue(B,`modelMatrix`,i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];Pe.update(n,x),Pe.bind(n,x)}}return x}function nt(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function rt(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&e.lights===!0}this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return O},this.setRenderTargetTextures=function(e,t,n){let r=U.get(e);r.__autoAllocateDepthBuffer=e.resolveDepthBuffer===!1,r.__autoAllocateDepthBuffer===!1&&(r.__useRenderToTexture=!1),U.get(e.texture).__webglTexture=t,U.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=U.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=t===void 0};let it=B.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){O=e,E=t,D=n;let r=null,i=!1,a=!1;if(e){let o=U.get(e);if(o.__useDefaultFramebuffer!==void 0){V.bindFramebuffer(B.FRAMEBUFFER,o.__webglFramebuffer),j.copy(e.viewport),ee.copy(e.scissor),M=e.scissorTest,V.viewport(j),V.scissor(ee),V.setScissorTest(M),k=-1;return}else if(o.__webglFramebuffer===void 0)ge.setupRenderTarget(e);else if(o.__hasExternalTextures)ge.rebindTextures(e,U.get(e.texture).__webglTexture,U.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(o.__boundDepthTexture!==t){if(t!==null&&U.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error(`WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.`);ge.setupDepthRenderbuffer(e)}}let s=e.texture;(s.isData3DTexture||s.isDataArrayTexture||s.isCompressedArrayTexture)&&(a=!0);let c=U.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(c[t])?c[t][n]:c[t],i=!0):r=e.samples>0&&ge.useMultisampledRTT(e)===!1?U.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,j.copy(e.viewport),ee.copy(e.scissor),M=e.scissorTest}else j.copy(L).multiplyScalar(I).floor(),ee.copy(ie).multiplyScalar(I).floor(),M=R;if(n!==0&&(r=it),V.bindFramebuffer(B.FRAMEBUFFER,r)&&V.drawBuffers(e,r),V.viewport(j),V.scissor(ee),V.setScissorTest(M),i){let r=U.get(e.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t<e.textures.length;t++){let i=U.get(e.textures[t]);B.framebufferTextureLayer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0+t,i.__webglTexture,n,r)}}else if(e!==null&&n!==0){let t=U.get(e.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_2D,t.__webglTexture,n)}k=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget)){_m(`WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let c=U.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){V.bindFramebuffer(B.FRAMEBUFFER,c);try{let o=e.textures[s],c=o.format,l=o.type;if(!he.textureFormatReadable(c)){_m(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!he.textureTypeReadable(l)){_m(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&B.readBuffer(B.COLOR_ATTACHMENT0+s),B.readPixels(t,n,r,i,Me.convert(c),Me.convert(l),a))}finally{let e=O===null?null:U.get(O).__webglFramebuffer;V.bindFramebuffer(B.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=U.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c)if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){V.bindFramebuffer(B.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(!he.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!he.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=B.createBuffer();B.bindBuffer(B.PIXEL_PACK_BUFFER,d),B.bufferData(B.PIXEL_PACK_BUFFER,a.byteLength,B.STREAM_READ),e.textures.length>1&&B.readBuffer(B.COLOR_ATTACHMENT0+s),B.readPixels(t,n,r,i,Me.convert(l),Me.convert(u),0);let f=O===null?null:U.get(O).__webglFramebuffer;V.bindFramebuffer(B.FRAMEBUFFER,f);let p=B.fenceSync(B.SYNC_GPU_COMMANDS_COMPLETE,0);return B.flush(),await ym(B,p,4),B.bindBuffer(B.PIXEL_PACK_BUFFER,d),B.getBufferSubData(B.PIXEL_PACK_BUFFER,0,a),B.deleteBuffer(d),B.deleteSync(p),a}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;ge.setTexture2D(e,0),B.copyTexSubImage2D(B.TEXTURE_2D,n,0,0,o,s,i,a),V.unbindTexture()};let at=B.createFramebuffer(),ot=B.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=null){a===null&&(i===0?a=0:(vm(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),a=i,i=0));let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=Me.convert(t.format),_=Me.convert(t.type),v;t.isData3DTexture?(ge.setTexture3D(t,0),v=B.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(ge.setTexture2DArray(t,0),v=B.TEXTURE_2D_ARRAY):(ge.setTexture2D(t,0),v=B.TEXTURE_2D),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,t.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,t.unpackAlignment);let y=B.getParameter(B.UNPACK_ROW_LENGTH),b=B.getParameter(B.UNPACK_IMAGE_HEIGHT),x=B.getParameter(B.UNPACK_SKIP_PIXELS),S=B.getParameter(B.UNPACK_SKIP_ROWS),
4396C=B.getParameter(B.UNPACK_SKIP_IMAGES);B.pixelStorei(B.UNPACK_ROW_LENGTH,h.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,h.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,l),B.pixelStorei(B.UNPACK_SKIP_ROWS,u),B.pixelStorei(B.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=U.get(e),r=U.get(t),h=U.get(n.__renderTarget),g=U.get(r.__renderTarget);V.bindFramebuffer(B.READ_FRAMEBUFFER,h.__webglFramebuffer),V.bindFramebuffer(B.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n<c;n++)w&&(B.framebufferTextureLayer(B.READ_FRAMEBUFFER,B.COLOR_ATTACHMENT0,U.get(e).__webglTexture,i,d+n),B.framebufferTextureLayer(B.DRAW_FRAMEBUFFER,B.COLOR_ATTACHMENT0,U.get(t).__webglTexture,a,m+n)),B.blitFramebuffer(l,u,o,s,f,p,o,s,B.DEPTH_BUFFER_BIT,B.NEAREST);V.bindFramebuffer(B.READ_FRAMEBUFFER,null),V.bindFramebuffer(B.DRAW_FRAMEBUFFER,null)}else if(i!==0||e.isRenderTargetTexture||U.has(e)){let n=U.get(e),r=U.get(t);V.bindFramebuffer(B.READ_FRAMEBUFFER,at),V.bindFramebuffer(B.DRAW_FRAMEBUFFER,ot);for(let e=0;e<c;e++)w?B.framebufferTextureLayer(B.READ_FRAMEBUFFER,B.COLOR_ATTACHMENT0,n.__webglTexture,i,d+e):B.framebufferTexture2D(B.READ_FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_2D,n.__webglTexture,i),T?B.framebufferTextureLayer(B.DRAW_FRAMEBUFFER,B.COLOR_ATTACHMENT0,r.__webglTexture,a,m+e):B.framebufferTexture2D(B.DRAW_FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_2D,r.__webglTexture,a),i===0?T?B.copyTexSubImage3D(v,a,f,p,m+e,l,u,o,s):B.copyTexSubImage2D(v,a,f,p,l,u,o,s):B.blitFramebuffer(l,u,o,s,f,p,o,s,B.COLOR_BUFFER_BIT,B.NEAREST);V.bindFramebuffer(B.READ_FRAMEBUFFER,null),V.bindFramebuffer(B.DRAW_FRAMEBUFFER,null)}else T?e.isDataTexture||e.isData3DTexture?B.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h.data):t.isCompressedArrayTexture?B.compressedTexSubImage3D(v,a,f,p,m,o,s,c,g,h.data):B.texSubImage3D(v,a,f,p,m,o,s,c,g,_,h):e.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,a,f,p,o,s,g,_,h.data):e.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,a,f,p,h.width,h.height,g,h.data):B.texSubImage2D(B.TEXTURE_2D,a,f,p,o,s,g,_,h);B.pixelStorei(B.UNPACK_ROW_LENGTH,y),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,b),B.pixelStorei(B.UNPACK_SKIP_PIXELS,x),B.pixelStorei(B.UNPACK_SKIP_ROWS,S),B.pixelStorei(B.UNPACK_SKIP_IMAGES,C),a===0&&t.generateMipmaps&&B.generateMipmap(v),V.unbindTexture()},this.initRenderTarget=function(e){U.get(e).__webglFramebuffer===void 0&&ge.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?ge.setTextureCube(e,0):e.isData3DTexture?ge.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?ge.setTexture2DArray(e,0):ge.setTexture2D(e,0),V.unbindTexture()},this.resetState=function(){E=0,D=0,O=null,V.reset(),Ne.reset()},typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}get coordinateSystem(){return tm}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=nh._getDrawingBufferColorSpace(e),t.unpackColorSpace=nh._getUnpackColorSpace()}},bO=s((e=>{var t=h();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),xO=s(((e,t)=>{t.exports=bO()})),SO=s((e=>{var t=h(),n=xO();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),CO=u(s(((e,t)=>{t.exports=SO()}))(),1),wO=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({}
4396,t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},TO=(e=>e?wO(e):wO),{useSyncExternalStoreWithSelector:EO}=CO.default,DO=e=>e;function OO(e,t=DO,n){let r=EO(e.subscribe,e.getState,e.getInitialState,t,n);return S.useDebugValue(r),r}var kO=(e,t)=>{let n=TO(e),r=(e,r=t)=>OO(n,e,r);return Object.assign(r,n),r},AO=((e,t)=>e?kO(e,t):kO),jO=e=>typeof e==`object`&&typeof e.then==`function`,MO=[];function NO(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;let r=e.length;if(t.length!==r)return!1;for(let i=0;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}function PO(e,t=null,n=!1,r={}){t===null&&(t=[e]);for(let e of MO)if(NO(t,e.keys,e.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(e,`error`))throw e.error;if(Object.prototype.hasOwnProperty.call(e,`response`))return r.lifespan&&r.lifespan>0&&(e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(e.remove,r.lifespan)),e.response;if(!n)throw e.promise}let i={keys:t,equal:r.equal,remove:()=>{let e=MO.indexOf(i);e!==-1&&MO.splice(e,1)},promise:(jO(e)?e:e(...t)).then(e=>{i.response=e,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(e=>i.error=e)};if(MO.push(i),!n)throw i.promise}
4396var FO=(e,t,n)=>PO(e,t,!1,n),IO=(e,t,n)=>void PO(e,t,!0,n),LO=e=>{if(e===void 0||e.length===0)MO.splice(0,MO.length);else{let t=MO.find(t=>NO(e,t.keys,t.equal));t&&t.remove()}},RO=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,A();else{var t=n(l);t!==null&&j(b,t.startTime-e)}}var x=!1,S=-1,C=5,w=-1;function T(){return!(e.unstable_now()-w<C)}function E(){if(x){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,_(S),S=-1),p=!0;var a=f;try{b:{for(y(t),d=n(c);d!==null&&!(d.expirationTime>t&&T());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,y(t),i=!0;break b}d===n(c)&&r(c),y(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(b,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():x=!1}}}var D;if(typeof v==`function`)D=function(){v(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){g(E,0)};function A(){x||(x=!0,D())}function j(t,n){S=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,A())},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(S),S=-1):h=!0,j(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,A())),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),zO=s(((e,t)=>{t.exports=RO()})),BO=s(((e,t)=>{t.exports=function(e){function t(e,t,n,r){return new Gi(e,t,n,r)}function n(){}function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(e){return typeof e!=`object`||!e?null:(e=Da&&e[Da]||e[`@@iterator`],typeof e==`function`?e:null)}function a(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===Oa?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ma:return`Fragment`;case pa:return`Portal`;case ga:return`Profiler`;case ha:return`StrictMode`;case xa:return`Suspense`;case Sa:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case ya:return(e.displayName||`Context`)+`.Provider`;case va:return(e._context.displayName||`Context`)+`.Consumer`;case ba:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case Ca:return t=e.displayName||null,t===null?a(e.type)||`Memo`:t;case wa:t=e._payload,e=e._init;try{return a(e(t))}catch{}}return null}function o(e){if(Aa===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Aa=t&&t[1]||``,ja=-1<e.stack.indexOf(` 4397 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 4398`+Aa+e+ja}function s(e,t){if(!e||Ma)return``;Ma=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}
vendor: 4,641 bytes, lines 4398-4403
4398else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),s=a[0],c=a[1];if(s&&c){var l=s.split(` 4399`),u=c.split(` 4400`);for(i=r=0;r<l.length&&!l[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<u.length&&!u[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===l.length||i===u.length)for(r=l.length-1,i=u.length-1;1<=r&&0<=i&&l[r]!==u[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==u[i]){if(r!==1||i!==1)do if(r--,i--,0>i||l[r]!==u[i]){var d=` 4401`+l[r].replace(` at new `,` at `);return e.displayName&&d.includes(`<anonymous>`)&&(d=d.replace(`<anonymous>`,e.displayName)),d}while(1<=r&&0<=i);break}}}finally{Ma=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?o(n):``}function c(e){switch(e.tag){case 26:case 27:case 5:return o(e.type);case 16:return o(`Lazy`);case 13:return o(`Suspense`);case 19:return o(`SuspenseList`);case 0:case 15:return e=s(e.type,!1),e;case 11:return e=s(e.type.render,!1),e;case 1:return e=s(e.type,!0),e;default:return``}}function l(e){try{var t=``;do t+=c(e),e=e.return;while(e);return t}catch(e){return` 4402Error generating stack: `+e.message+` 4403`+e.stack}}function u(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function d(e){if(u(e)!==e)throw Error(r(188))}function f(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return d(a),e;if(o===i)return d(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(e.tag!==4&&(t=m(e),t!==null))return t;e=e.sibling}return null}function g(e){return{current:e}}function _(e){0>zs||(e.current=Rs[zs],Rs[zs]=null,zs--)}function v(e,t){zs++,Rs[zs]=e.current,e.current=t}function y(e){return e>>>=0,e===0?32:31-(Hs(e)/Us|0)|0}function b(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function x(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=e.warmLanes;e=e.finishedLanes!==0;var s=n&134217727;return s===0?(s=n&~i,s===0?a===0?e||(o=n&~o,o!==0&&(r=b(o))):r=b(a):r=b(s)):(n=s&~i,n===0?(a&=s,a===0?e||(o=s&~o,o!==0&&(r=b(o))):r=b(a)):r=b(n)),r===0?0:t!==0&&t!==r&&(t&i)===0&&(i=r&-r,o=t&-t,i>=o||i===32&&o&4194176)?t:r}function S(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function C(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+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 w(){var e=Ws;return Ws<<=1,!(Ws&4194176)&&(Ws=128),e}function T(){var e=Gs;return Gs<<=1,!(Gs&62914560)&&(Gs=4194304),e}function E(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}
4403function D(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function O(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Vs(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&k(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function k(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Vs(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&4194218}function A(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Vs(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function j(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ee(e){if(ic&&typeof ic.onCommitFiberRoot==`function`)try{ic.onCommitFiberRoot(rc,e,void 0,(e.current.flags&128)==128)}catch{}}function M(e){if(typeof tc==`function`&&nc(e),ic&&typeof ic.setStrictMode==`function`)try{ic.setStrictMode(rc,e)}catch{}}function te(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function N(e,t){if(typeof e==`object`&&e){var n=oc.get(e);return n===void 0?(t={value:e,source:t,stack:l(t)},oc.set(e,t),t):n}return{value:e,source:t,stack:l(t)}}function P(e,t){sc[cc++]=uc,sc[cc++]=lc,lc=e,uc=t}function F(e,t,n){dc[fc++]=mc,dc[fc++]=hc,dc[fc++]=pc,pc=e;var r=mc;e=hc;var i=32-Vs(r)-1;r&=~(1<<i),n+=1;var a=32-Vs(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,mc=1<<32-Vs(t)+i|n<<i|r,hc=a+e}else mc=1<<a|n<<i|r,hc=e}function I(e){e.return!==null&&(P(e,1),F(e,1,0))}function ne(e){for(;e===lc;)lc=sc[--cc],sc[cc]=null,uc=sc[--cc],sc[cc]=null;for(;e===pc;)pc=dc[--fc],dc[fc]=null,hc=dc[--fc],dc[fc]=null,mc=dc[--fc],dc[fc]=null}function re(e,t){v(vc,t),v(_c,e),v(gc,null),e=Ra(t),_(gc),v(gc,e)}function L(){_(gc),_(_c),_(vc)}function ie(e){e.memoizedState!==null&&v(yc,e);var t=gc.current,n=za(t,e.type);t!==n&&(v(_c,e),v(gc,n))}function R(e){_c.current===e&&(_(gc),_(_c)),yc.current===e&&(_(yc),Xa?mo._currentValue=po:mo._currentValue2=po)}function ae(e){throw le(N(Error(r(418,``)),e)),Tc}function oe(e,t){if(!$a)throw Error(r(175));ss(e.stateNode,e.type,e.memoizedProps,t,e)||ae(e)}function se(e){for(bc=e.return;bc;)switch(bc.tag){case 3:case 27:wc=!0;return;case 5:case 13:wc=!1;return;default:bc=bc.return}}function ce(e){if(!$a||e!==bc)return!1;if(!Sc)return se(e),Sc=!0,!1;var t=!1;if(Ms?e.tag!==3&&e.tag!==27&&(e.tag!==5||hs(e.type)&&!Ga(e.type,e.memoizedProps))&&(t=!0):e.tag!==3&&(e.tag!==5||hs(e.type)&&!Ga(e.type,e.memoizedProps))&&(t=!0),t&&xc&&ae(e),se(e),e.tag===13){if(!$a)throw Error(r(316));if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));xc=us(e)}else xc=bc?es(e.stateNode):null;return!0}function z(){$a&&(xc=bc=null,Sc=!1)}function le(e){Cc===null?Cc=[e]:Cc.push(e)}function ue(){for(var e=Dc,t=Oc=Dc=0;t<e;){var n=Ec[t];Ec[t++]=null;var r=Ec[t];Ec[t++]=null;var i=Ec[t];Ec[t++]=null;var a=Ec[t];if(Ec[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&pe(n,i,a)}}function de(e,t,n,r){Ec[Dc++]=e,Ec[Dc++]=t,Ec[Dc++]=n,Ec[Dc++]=r,Oc|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function fe(e,t,n,r){return de(e,t,n,r),me(e)}function B(e,t){return de(e,null,null,t),me(e)}function pe(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;i&&t!==null&&e.tag===3&&(a=e.stateNode,i=31-Vs(n),a=a.hiddenUpdates,e=a[i],e===null?a[i]=[t]:e.push(t),t.lane=n|536870912)}function me(e){if(50<Su)throw Su=0,Cu=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}function he(e){e!==Ac&&e.next===null&&(Ac===null?kc=Ac=e:Ac=Ac.next=e),Mc=!0,jc||(jc=!0,ve(H))}function V(e,t){if(!Nc&&Mc){Nc=!0;do for(var n=!1,r=kc;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Vs(42|e)+1)-1,a&=i&~(o&~s),a=a&201326677?a&201326677|1:a?a|2:0}a!==0&&(n=!0,_e(r,a))}else a=Zl,a=x(r,r===q?a:0),!(a&3)||S(r,a)||(n=!0,_e(r,a));r=r.next}
vendor: 9,579 bytes, line 4403
4403while(n);Nc=!1}}function H(){Mc=jc=!1;var e=0;Pc!==0&&(ao()&&(e=Pc),Pc=0);for(var t=Xs(),n=null,r=kc;r!==null;){var i=r.next,a=U(r,t);a===0?(r.next=null,n===null?kc=i:n.next=i,i===null&&(Ac=n)):(n=r,(e!==0||a&3)&&(Mc=!0)),r=i}V(e,!1)}function U(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Vs(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=C(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Zl,n=x(e,e===t?n:0),r=e.callbackNode,n===0||e===t&&Ql===2||e.cancelPendingCommit!==null)return r!==null&&r!==null&&qs(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||S(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&qs(r),j(n)){case 2:case 8:n=Qs;break;case 32:n=$s;break;case 268435456:n=ec;break;default:n=$s}return r=ge.bind(null,e),n=Ks(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&qs(r),e.callbackPriority=2,e.callbackNode=null,2}function ge(e,t){var n=e.callbackNode;if(Ii()&&e.callbackNode!==n)return null;var r=Zl;return r=x(e,e===q?r:0),r===0?null:(fi(e,r,t),U(e,Xs()),e.callbackNode!=null&&e.callbackNode===n?ge.bind(null,e):null)}function _e(e,t){if(Ii())return null;fi(e,t,!0)}function ve(e){go?_o(function(){Yl&6?Ks(Zs,e):e()}):Ks(Zs,e)}function ye(){return Pc===0&&(Pc=w()),Pc}function be(e,t){if(Fc===null){var n=Fc=[];Ic=0,Lc=ye(),Rc={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ic++,t.then(xe,xe),t}function xe(){if(--Ic===0&&Fc!==null){Rc!==null&&(Rc.status=`fulfilled`);var e=Fc;Fc=null,Lc=0,Rc=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Se(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}function Ce(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function we(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Te(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ee(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=me(e),pe(e,null,n),t}return de(e,r,t,n),me(e)}function De(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194176)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,A(e,n)}}function Oe(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ke(){if(Bc){var e=Rc;if(e!==null)throw e}}function Ae(e,t,n,r){Bc=!1;var i=e.updateQueue;zc=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Zl&f)===f:(r&f)===f){f!==0&&f===Lc&&(Bc=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=ua({},d,f);break a;case 2:zc=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),au|=o,e.lanes=o,e.memoizedState=d}}function je(e,t){if(typeof e!=`function`)throw Error(r(191,e));e.call(t)}function Me(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)je(n[e],t)}function Ne(e,t){if(ac(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Vc.call(t,i)||!ac(e[i],t[i]))return!1}return!0}function Pe(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Fe(){}function Ie(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Fe,Fe),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,e===Hc?Error(r(483)):e;default:if(typeof t.status==`string`)t.then(Fe,Fe);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,e===Hc?Error(r(483)):e}throw Gc=t,Hc}}function Le(){if(Gc===null)throw Error(r(459));var e=Gc;return Gc=null,e}function Re(e){var t=qc;return qc+=1,Kc===null&&(Kc=[]),Ie(Kc,e,t)}function ze(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function W(e,t){throw t.$$typeof===da?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Be(e){var t=e._init;return t(e._payload)}function Ve(e){function n(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function a(t,r){if(!e)return null;for(;r!==null;)n(t,r),r=r.sibling;return null}function o(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function s(e,t){return e=qi(e,t),e.index=0,e.sibling=null,e}function c(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=33554434,n):(r=r.index,r<n?(t.flags|=33554434,n):r)):(t.flags|=1048576,n)}function l(t){return e&&t.alternate===null&&(t.flags|=33554434),t}function u(e,t,n,r){return t===null||t.tag!==6?(t=Qi(n,e.mode,r),t.return=e,t):(t=s(t,n),t.return=e,t)}function d(e,t,n,r){var i=n.type;return i===ma?p(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===wa&&Be(i)===t.type)?(t=s(t,n.props),ze(t,n),t.return=e,t):(t=Yi(n.type,n.key,n.props,null,e.mode,r),ze(t,n),t.return=e,t)}function f(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=$i(n,e.mode,r),t.return=e,t):(t=s(t,n.children||[]),t.return=e,t)}function p(e,t,n,r,i){return t===null||t.tag!==7?(t=Xi(n,e.mode,r,i),t.return=e,t):(t=s(t,n),t.return=e,t)}function m(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Qi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case fa:return n=Yi(t.type,t.key,t.props,null,e.mode,n),ze(n,t),n.return=e,n;case pa:return t=$i(t,e.mode,n),t.return=e,t;case wa:var r=t._init;return t=r(t._payload),m(e,t,n)}if(Na(t)||i(t))return t=Xi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return m(e,Re(t),n);if(t.$$typeof===ya)return m(e,Xn(e,t),n);W(e,t)}return null}function h(e,t,n,r){var a=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return a===null?u(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case fa:return n.key===a?d(e,t,n,r):null;case pa:return n.key===a?f(e,t,n,r):null;case wa:return a=n._init,n=a(n._payload),h(e,t,n,r)}if(Na(n)||i(n))return a===null?p(e,t,n,r,null):null;if(typeof n.then==`function`)return h(e,t,Re(n),r);if(n.$$typeof===ya)return h(e,t,Xn(e,n),r);W(e,n)}return null}function g(e,t,n,r,a){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,u(t,e,``+r,a);if(typeof r==`object`&&r){switch(r.$$typeof){case fa:return e=e.get(r.key===null?n:r.key)||null,d(t,e,r,a);case pa:return e=e.get(r.key===null?n:r.key)||null,f(t,e,r,a);case wa:var o=r._init;return r=o(r._payload),g(e,t,n,r,a)}if(Na(r)||i(r))return e=e.get(n)||null,p(t,e,r,a,null);if(typeof r.then==`function`)return g(e,t,n,Re(r),a);if(r.$$typeof===ya)return g(e,t,n,Xn(t,r),a);W(t,r)}return null}function _(t,r,i,s){for(var l=null,u=null,d=r,f=r=0,p=null;d!==null&&f<i.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var _=h(t,d,i[f],s);if(_===null){d===null&&(d=p);break}e&&d&&_.alternate===null&&n(t,d),r=c(_,r,f),u===null?l=_:u.sibling=_,u=_,d=p}if(f===i.length)return a(t,d),Sc&&P(t,f),l;if(d===null){for(;f<i.length;f++)d=m(t,i[f],s),d!==null&&(r=c(d,r,f),u===null?l=d:u.sibling=d,u=d);return Sc&&P(t,f),l}for(d=o(d);f<i.length;f++)p=g(d,t,f,i[f],s),p!==null&&(e&&p.alternate!==null&&d.delete(p.key===null?f:p.key),r=c(p,r,f),u===null?l=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return n(t,e)}),Sc&&P(t,f),l}function v(t,i,s,l){if(s==null)throw Error(r(151));for(var u=null,d=null,f=i,p=i=0,_=null,v=s.next();f!==null&&!v.done;p++,v=s.next()){f.index>
vendor: 2,136 bytes, line 4403
4403p?(_=f,f=null):_=f.sibling;var y=h(t,f,v.value,l);if(y===null){f===null&&(f=_);break}e&&f&&y.alternate===null&&n(t,f),i=c(y,i,p),d===null?u=y:d.sibling=y,d=y,f=_}if(v.done)return a(t,f),Sc&&P(t,p),u;if(f===null){for(;!v.done;p++,v=s.next())v=m(t,v.value,l),v!==null&&(i=c(v,i,p),d===null?u=v:d.sibling=v,d=v);return Sc&&P(t,p),u}for(f=o(f);!v.done;p++,v=s.next())v=g(f,t,p,v.value,l),v!==null&&(e&&v.alternate!==null&&f.delete(v.key===null?p:v.key),i=c(v,i,p),d===null?u=v:d.sibling=v,d=v);return e&&f.forEach(function(e){return n(t,e)}),Sc&&P(t,p),u}function y(e,t,o,c){if(typeof o==`object`&&o&&o.type===ma&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case fa:a:{for(var u=o.key;t!==null;){if(t.key===u){if(u=o.type,u===ma){if(t.tag===7){a(e,t.sibling),c=s(t,o.props.children),c.return=e,e=c;break a}}else if(t.elementType===u||typeof u==`object`&&u&&u.$$typeof===wa&&Be(u)===t.type){a(e,t.sibling),c=s(t,o.props),ze(c,o),c.return=e,e=c;break a}a(e,t);break}else n(e,t);t=t.sibling}o.type===ma?(c=Xi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=Yi(o.type,o.key,o.props,null,e.mode,c),ze(c,o),c.return=e,e=c)}return l(e);case pa:a:{for(u=o.key;t!==null;){if(t.key===u)if(t.tag===4&&t.stateNode.containerInfo===o.containerInfo&&t.stateNode.implementation===o.implementation){a(e,t.sibling),c=s(t,o.children||[]),c.return=e,e=c;break a}else{a(e,t);break}else n(e,t);t=t.sibling}c=$i(o,e.mode,c),c.return=e,e=c}return l(e);case wa:return u=o._init,o=u(o._payload),y(e,t,o,c)}if(Na(o))return _(e,t,o,c);if(i(o)){if(u=i(o),typeof u!=`function`)throw Error(r(150));return o=u.call(o),v(e,t,o,c)}if(typeof o.then==`function`)return y(e,t,Re(o),c);if(o.$$typeof===ya)return y(e,t,Xn(e,o),c);W(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,t!==null&&t.tag===6?(a(e,t.sibling),c=s(t,o),c.return=e,e=c):(a(e,t),c=Qi(o,e.mode,c),c.return=e,e=c),l(e)):a(e,t)}return function(e,n,r,i){try{qc=0;var a=y(e,n,r,i);return Kc=null,a}catch(n){if(n===Hc)throw n;var o=t(29,n,null,e.mode);return o.lanes=i,o.return=e,o}}}function He(e,t){e=ru,v(Zc,e),v(Xc,t),ru=e|t.baseLanes}
vendor: 6,966 bytes, line 4403
4403function Ue(){v(Zc,ru),v(Xc,Xc.current)}function We(){ru=Zc.current,_(Xc),_(Zc)}function Ge(e){var t=e.alternate;v(el,el.current&1),v(Qc,e),$c===null&&(t===null||Xc.current!==null||t.memoizedState!==null)&&($c=e)}function Ke(e){if(e.tag===22){if(v(el,el.current),v(Qc,e),$c===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&($c=e)}}else qe(e)}function qe(){v(el,el.current),v(Qc,Qc.current)}function Je(e){_(Qc),$c===e&&($c=null),_(el)}function Ye(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Jo(n)||Yo(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Xe(){throw Error(r(321))}function Ze(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ac(e[n],t[n]))return!1;return!0}function Qe(e,t,n,r,i,a){return tl=a,nl=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ka.H=e===null||e.memoizedState===null?ml:hl,sl=!1,a=n(r,i),sl=!1,ol&&(a=et(t,n,r,i)),$e(e),a}function $e(e){ka.H=pl;var t=rl!==null&&rl.next!==null;if(tl=0,il=rl=nl=null,al=!1,ll=0,ul=null,t)throw Error(r(300));e===null||bl||(e=e.dependencies,e!==null&&qn(e)&&(bl=!0))}function et(e,t,n,i){nl=e;var a=0;do{if(ol&&(ul=null),ll=0,ol=!1,25<=a)throw Error(r(301));if(a+=1,il=rl=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ka.H=gl,o=t(n,i)}while(ol);return o}function tt(){var e=ka.H,t=e.useState()[0];return t=typeof t.then==`function`?ot(t):t,e=e.useState()[0],(rl===null?null:rl.memoizedState)!==e&&(nl.flags|=1024),t}function G(){var e=cl!==0;return cl=0,e}function nt(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rt(e){if(al){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}al=!1}tl=0,il=rl=nl=null,ol=!1,ll=cl=0,ul=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return il===null?nl.memoizedState=il=e:il=il.next=e,il}function at(){if(rl===null){var e=nl.alternate;e=e===null?null:e.memoizedState}else e=rl.next;var t=il===null?nl.memoizedState:il.next;if(t!==null)il=t,rl=e;else{if(e===null)throw nl.alternate===null?Error(r(467)):Error(r(310));rl=e,e={memoizedState:rl.memoizedState,baseState:rl.baseState,baseQueue:rl.baseQueue,queue:rl.queue,next:null},il===null?nl.memoizedState=il=e:il=il.next=e}return il}function ot(e){var t=ll;return ll+=1,ul===null&&(ul=[]),e=Ie(ul,e,t),t=nl,(il===null?t.memoizedState:il.next)===null&&(t=t.alternate,ka.H=t===null||t.memoizedState===null?ml:hl),e}function st(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ot(e);if(e.$$typeof===ya)return Yn(e)}throw Error(r(438,String(e)))}function ct(e){var t=null,n=nl.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=nl.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=fl(),nl.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=Ea;return t.index++,n}function lt(e,t){return typeof t==`function`?t(e):t}function ut(e){return dt(at(),rl,e)}function dt(e,t,n){var i=e.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=n;var a=e.baseQueue,o=i.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,i.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(tl&f)===f:(Zl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Lc&&(d=!0);else if((tl&p)===p){u=u.next,p===Lc&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,nl.lanes|=p,au|=p;f=u.action,sl&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,nl.lanes|=f,au|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!ac(o,e.memoizedState)&&(bl=!0,d&&(n=Rc,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,i.lastRenderedState=o}return a===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function ft(e){var t=at(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);ac(o,t.memoizedState)||(bl=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function pt(e,t,n){var i=nl,a=at(),o=Sc;if(o){if(n===void 0)throw Error(r(407));n=n()}else n=t();var s=!ac((rl||a).memoizedState,n);if(s&&(a.memoizedState=n,bl=!0),a=a.queue,Rt(gt.bind(null,i,a,e),[e]),a.getSnapshot!==t||s||il!==null&&il.memoizedState.tag&1){if(i.flags|=2048,Nt(9,ht.bind(null,i,a,n,t),{destroy:void 0},null),q===null)throw Error(r(349));o||tl&60||mt(i,t,n)}return n}function mt(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=nl.updateQueue,t===null?(t=fl(),nl.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ht(e,t,n,r){t.value=n,t.getSnapshot=r,_t(t)&&vt(e)}function gt(e,t,n){return n(function(){_t(t)&&vt(e)})}function _t(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ac(e,n)}catch{return!0}}function vt(e){var t=B(e,2);t!==null&&di(t,e,2)}function yt(e){var t=it();if(typeof e==`function`){var n=e;if(e=n(),sl){M(!0);try{n()}finally{M(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:e},t}function bt(e,t,n,r){return e.baseState=n,dt(e,rl,typeof r==`function`?r:lt)}function xt(e,t,n,i,a){if(an(e))throw Error(r(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};ka.T===null?o.isTransition=!1:n(!0),i(o),n=t.pending,n===null?(o.next=t.pending=o,St(t,o)):(o.next=n.next,t.pending=n.next=o)}}function St(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=ka.T,o={};ka.T=o;try{var s=n(i,r),c=ka.S;c!==null&&c(o,s),Ct(e,t,s)}catch(n){Tt(e,t,n)}finally{ka.T=a}}else try{a=n(i,r),Ct(e,t,a)}catch(n){Tt(e,t,n)}}function Ct(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){wt(e,t,n)},function(n){return Tt(e,t,n)}):wt(e,t,n)}function wt(e,t,n){t.status=`fulfilled`,t.value=n,Et(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,St
vendor: 5,841 bytes, line 4403
4403(e,n)))}function Tt(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Et(t),t=t.next;while(t!==r)}e.action=null}function Et(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Dt(e,t){return t}function Ot(e,t){if(Sc){var n=q.formState;if(n!==null){a:{var r=nl;if(Sc){if(xc){var i=Qo(xc,wc);if(i){xc=es(i),r=$o(i);break a}}ae(r)}r=!1}r&&(t=n[0])}}n=it(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dt,lastRenderedState:t},n.queue=r,n=tn.bind(null,nl,r),r.dispatch=n,r=yt(!1);var a=rn.bind(null,nl,!1,r.queue);return r=it(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xt.bind(null,nl,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function kt(e){return At(at(),rl,e)}function At(e,t,n){t=dt(e,t,Dt)[0],e=ut(lt)[0],t=typeof t==`object`&&t&&typeof t.then==`function`?ot(t):t;var r=at(),i=r.queue,a=i.dispatch;return n!==r.memoizedState&&(nl.flags|=2048,Nt(9,jt.bind(null,i,n),{destroy:void 0},null)),[t,a,e]}function jt(e,t){e.action=t}function Mt(e){var t=at(),n=rl;if(n!==null)return At(t,n,e);at(),t=t.memoizedState,n=at();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Nt(e,t,n,r){return e={tag:e,create:t,inst:n,deps:r,next:null},t=nl.updateQueue,t===null&&(t=fl(),nl.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Pt(){return at().memoizedState}function Ft(e,t,n,r){var i=it();nl.flags|=e,i.memoizedState=Nt(1|t,n,{destroy:void 0},r===void 0?null:r)}function It(e,t,n,r){var i=at();r=r===void 0?null:r;var a=i.memoizedState.inst;rl!==null&&r!==null&&Ze(r,rl.memoizedState.deps)?i.memoizedState=Nt(t,n,a,r):(nl.flags|=e,i.memoizedState=Nt(1|t,n,a,r))}function Lt(e,t){Ft(8390656,8,e,t)}function Rt(e,t){It(2048,8,e,t)}function zt(e,t){return It(4,2,e,t)}function Bt(e,t){return It(4,4,e,t)}function Vt(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ht(e,t,n){n=n==null?null:n.concat([e]),It(4,4,Vt.bind(null,t,e),n)}function Ut(){}function Wt(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ze(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gt(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ze(t,r[1]))return r[0];if(r=e(),sl){M(!0);try{e()}finally{M(!1)}}return n.memoizedState=[r,t],r}function Kt(e,t,n){return n===void 0||tl&1073741824?e.memoizedState=t:(e.memoizedState=n,e=ui(),nl.lanes|=e,au|=e,n)}function qt(e,t,n,r){return ac(n,t)?n:Xc.current===null?tl&42?(e=ui(),nl.lanes|=e,au|=e,t):(bl=!0,e.memoizedState=n):(e=Kt(e,n,r),ac(e,t)||(bl=!0),e)}function Jt(e,t,n,r,i){var a=ro();no(a!==0&&8>a?a:8);var o=ka.T,s={};ka.T=s,rn(e,!1,t,n);try{var c=i(),l=ka.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nn(e,t,Se(c,r),li(e)):nn(e,t,r,li(e))}catch(n){nn(e,t,{then:function(){},status:`rejected`,reason:n},li())}finally{no(a),ka.T=o}}function Yt(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:po,baseState:po,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:po},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xt(){return Yn(mo)}function Zt(){return at().memoizedState}function Qt(){return at().memoizedState}function $t(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=li();e=Te(n);var r=Ee(t,e,n);r!==null&&(di(r,t,n),De(r,t,n)),t={cache:Qn()},e.payload=t;return}t=t.return}}function en(e,t,n){var r=li();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},an(e)?on(t,n):(n=fe(e,t,n,r),n!==null&&(di(n,e,r),sn(n,t,r)))}function tn(e,t,n){nn(e,t,n,li())}function nn(e,t,n,r){var i={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(an(e))on(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,ac(s,o))return de(e,t,i,0),q===null&&ue(),!1}catch{}if(n=fe(e,t,i,r),n!==null)return di(n,e,r),sn(n,t,r),!0}return!1}function rn(e,t,n,i){if(i={lane:2,revertLane:ye(),action:i,hasEagerState:!1,eagerState:null,next:null},an(e)){if(t)throw Error(r(479))}else t=fe(e,n,i,2),t!==null&&di(t,e,2)}function an(e){var t=e.alternate;return e===nl||t!==null&&t===nl}function on(e,t){ol=al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sn(e,t,n){if(n&4194176){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,A(e,n)}}function cn(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ua({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}function ln(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ne(n,r)||!Ne(i,a):!0}function un(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_l.enqueueReplaceState(t,t.state,null)}function dn(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=ua({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function fn(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function pn(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}
vendor: 4,615 bytes, line 4403
4403function mn(e,t,n){return n=Te(n),n.tag=3,n.payload={element:null},n.callback=function(){fn(e,t)},n}function hn(e){return e=Te(e),e.tag=3,e}function gn(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){pn(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){pn(t,n,r),typeof i!=`function`&&(gu===null?gu=new Set([this]):gu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function _n(e,t,n,i,a){if(n.flags|=32768,typeof i==`object`&&i&&typeof i.then==`function`){if(t=n.alternate,t!==null&&Kn(t,n,a,!0),n=Qc.current,n!==null){switch(n.tag){case 13:return $c===null?Ci():n.alternate===null&&iu===0&&(iu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===Wc?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),zi(e,i,a)),!1;case 22:return n.flags|=65536,i===Wc?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),zi(e,i,a)),!1}throw Error(r(435,n.tag))}return zi(e,i,a),Ci(),!1}if(Sc)return t=Qc.current,t===null?(i!==Tc&&(t=Error(r(423),{cause:i}),le(N(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,i=N(i,n),a=mn(e.stateNode,i,a),Oe(e,a),iu!==4&&(iu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==Tc&&(e=Error(r(422),{cause:i}),le(N(e,n)))),!1;var o=Error(r(520),{cause:i});if(o=N(o,n),uu===null?uu=[o]:uu.push(o),iu!==4&&(iu=2),t===null)return!0;i=N(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=mn(n.stateNode,i,e),Oe(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(gu===null||!gu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=hn(a),gn(a,e,n,i),Oe(n,a),!1}n=n.return}while(n!==null);return!1}function vn(e,t,n,r){t.child=e===null?Yc(t,null,n,r):Jc(t,e.child,n,r)}function yn(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Jn(t),r=Qe(e,t,n,o,a,i),s=G(),e!==null&&!bl?(nt(e,t,i),Rn(e,t,i)):(Sc&&s&&I(t),t.flags|=1,vn(e,t,r,i),t.child)}function bn(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,xn(e,t,a,r,i)):(e=Yi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!zn(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ne:n,n(o,r)&&e.ref===t.ref)return Rn(e,t,i)}return t.flags|=1,e=qi(a,r),e.ref=t.ref,e.return=t,t.child=e}function xn(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ne(a,r)&&e.ref===t.ref)if(bl=!1,t.pendingProps=r=a,zn(e,i))e.flags&131072&&(bl=!0);else return t.lanes=e.lanes,Rn(e,t,i)}return Tn(e,t,n,r,i)}function Sn(e,t,n){var r=t.pendingProps,i=r.children,a=(t.stateNode._pendingVisibility&2)!=0,o=e===null?null:e.memoizedState;if(wn(e,t),r.mode===`hidden`||a){if(t.flags&128){if(r=o===null?n:o.baseLanes|n,e!==null){for(i=t.child=e.child,a=0;i!==null;)a=a|i.lanes|i.childLanes,i=i.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return Cn(e,t,r,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&tr(t,o===null?null:o.cachePool),o===null?Ue():He(t,o),Ke(t);else return t.lanes=t.childLanes=536870912,Cn(e,t,o===null?n:o.baseLanes|n,n)}else o===null?(e!==null&&tr(t,null),Ue(),qe(t)):(tr(t,o.cachePool),He(t,o),qe(t),t.memoizedState=null);return vn(e,t,i,n),t.child}function Cn(e,t,n,r){var i=er();return i=i===null?null:{parent:Xa?Ol._currentValue:Ol._currentValue2,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&tr(t,null),Ue(),Ke(t),e!==null&&Kn(e,t,r,!0),null}function wn(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=2097664);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=2097664)}}function Tn(e,t,n,r,i){return Jn(t),n=Qe(e,t,n,r,void 0,i),r=G(),e!==null&&!bl?(nt(e,t,i),Rn(e,t,i)):(Sc&&r&&I(t),t.flags|=1,vn(e,t,n,i),t.child)}function En(e,t,n,r,i,a){return Jn(t),t.updateQueue=null,n=et(t,r,n,i),$e(e),r=G(),e!==null&&!bl?(nt(e,t,a),Rn(e,t,a)):(Sc&&r&&I(t),t.flags|=1,vn(e,t,n,a),t.child)}function Dn(e,t,n,r,i){if(Jn(t),t.stateNode===null){var a=Bs,o=n.contextType;typeof o==`object`&&o&&(a=Yn(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_l,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={}
4403,Ce(t),o=n.contextType,a.context=typeof o==`object`&&o?Yn(o):Bs,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(cn(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_l.enqueueReplaceState(a,a.state,null),Ae(t,r,a,i),ke(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=dn(n,s);a.props=c;var l=a.context,u=n.contextType;o=Bs,typeof u==`object`&&u&&(o=Yn(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&un(t,a,r,o),zc=!1;var f=t.memoizedState;a.state=f,Ae(t,r,a,i),ke(),l=t.memoizedState,s||f!==l||zc?(typeof d==`function`&&(cn(t,n,d,r),l=t.memoizedState),(c=zc||ln(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,we(e,t),o=t.memoizedProps,u=dn(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Bs,typeof l==`object`&&l&&(c=Yn(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&un(t,a,r,c),zc=!1,f=t.memoizedState,a.state=f,Ae(t,r,a,i),ke();var p=t.memoizedState;o!==d||f!==p||zc||e!==null&&e.dependencies!==null&&qn(e.dependencies)?(typeof s==`function`&&(cn(t,n,s,r),p=t.memoizedState),(u=zc||ln(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qn(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,wn(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Jc(t,e.child,null,i),t.child=Jc(t,null,n,i)):vn(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Rn(e,t,i),e}function On(e,t,n,r){return z(),t.flags|=256,vn(e,t,n,r),t.child}function kn(e){return{baseLanes:e,cachePool:nr()}}function An(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cu),e}function jn(e,n,i){var a=n.pendingProps,o=!1,s=(n.flags&128)!=0,c;if((c=s)||(c=e!==null&&e.memoizedState===null?!1:(el.current&2)!=0),c&&(o=!0,n.flags&=-129),c=(n.flags&32)!=0,n.flags&=-33,e===null){if(Sc){if(o?Ge(n):qe(n),Sc){var l=xc,u;(u=l)&&(l=os(l,wc),l===null?u=!1:(n.memoizedState={dehydrated:l,treeContext:pc===null?null:{id:mc,overflow:hc},retryLane:536870912},u=t(18,null,null,0),u.stateNode=l,u.return=n,n.child=u,bc=n,xc=null,u=!0)),u||ae(n)}if(l=n.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return Yo(l)?n.lanes=16:n.lanes=536870912,null;Je(n)}return l=a.children,a=a.fallback,o?(qe(n),o=n.mode,l=Nn({mode:`hidden`,children:l},o),a=Xi(a,o,i,null),l.return=n,a.return=n,l.sibling=a,n.child=l,o=n.child,o.memoizedState=kn(i),o.childLanes=An(e,c,i),n.memoizedState=xl,a):(Ge(n),Mn(n,l))}if(u=e.memoizedState,u!==null&&(l=u.dehydrated,l!==null)){if(s)n.flags&256?(Ge(n),n.flags&=-257,n=Pn(e,n,i)):n.memoizedState===null?(qe(n),o=a.fallback,l=n.mode,a=Nn({mode:`visible`,children:a.children},l),o=Xi(o,l,i,null),o.flags|=2,a.return=n,o.return=n,a.sibling=o,n.child=a,Jc(n,e.child,null,i),a=n.child,a.memoizedState=kn(i),a.childLanes=An(e,c,i),n.memoizedState=xl,n=o):(qe(n),n.child=e.child,n.flags|=128,n=null);else if(Ge(n),Yo(l))c=Xo(l).digest,a=Error(r(419)),a.stack=``,a.digest=c,le({value:a,source:null,stack:null}),n=Pn(e,n,i);else if(bl||Kn(e,n,i,!1),c=(i&e.childLanes)!==0,bl||c){if(c=q,c!==null){if(a=i&-i,a&42)a=1;else switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=64;break;case 268435456:a=134217728;break;default:a=0}if(a=(a&(c.suspendedLanes|i))===0?a:0,a!==0&&a!==u.retryLane)throw u.retryLane=a,B(e,a),di(c,e,a),yl}Jo(l)||Ci(),n=Pn(e,n,i)}else Jo(l)?(n.flags|=128,n.child=e.child,n=Hi.bind(null,e),Zo(l,n),n=null):(e=u.treeContext,$a&&(xc=rs(l),bc=n,Sc=!0,Cc=null,wc=!1,e!==null&&(dc[fc++]=mc,dc[fc++]=hc,dc[fc++]=pc,mc=e.id,hc=e.overflow,pc=n)),n=Mn(n,a.children),n.flags|=4096);return n}return o?(qe(n),o=a.fallback,l=n.mode,u=e.child,s=u.sibling,a=qi(u,{mode:`hidden`,children:a.children}),a.subtreeFlags=u.subtreeFlags&31457280,s===null?(o=Xi(o,l,i,null),o.flags|=2):o=qi(s,o),o.return=n,a.return=n,a.sibling=o,n.child=a,a=o,o=n.child,l=e.child.memoizedState,l===null?l=kn(i):(u=l.cac
4403hePool,u===null?u=nr():(s=Xa?Ol._currentValue:Ol._currentValue2,u=u.parent===s?u:{parent:s,pool:s}),l={baseLanes:l.baseLanes|i,cachePool:u}),o.memoizedState=l,o.childLanes=An(e,c,i),n.memoizedState=xl,a):(Ge(n),i=e.child,e=i.sibling,i=qi(i,{mode:`visible`,children:a.children}),i.return=n,i.sibling=null,e!==null&&(c=n.deletions,c===null?(n.deletions=[e],n.flags|=16):c.push(e)),n.child=i,n.memoizedState=null,i)}function Mn(e,t){return t=Nn({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Nn(e,t){return Zi(e,t,0,null)}function Pn(e,t,n){return Jc(t,e.child,null,n),e=Mn(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fn(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wn(e.return,t,n)}function In(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Ln(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(vn(e,t,r.children,n),r=el.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fn(e,n,t);else if(e.tag===19)Fn(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(v(el,r),i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ye(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),In(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ye(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}In(t,!0,n,null,a);break;case`together`:In(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Rn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),au|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Kn(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=qi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zn(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qn(e))):!0}function Bn(e,t,n){switch(t.tag){case 3:re(t,t.stateNode.containerInfo),Hn(t,Ol,e.memoizedState.cache),z();break;case 27:case 5:ie(t);break;case 4:re(t,t.stateNode.containerInfo);break;case 10:Hn(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ge(t),e=Rn(e,t,n),e===null?null:e.sibling):jn(e,t,n):(Ge(t),t.flags|=128,null);Ge(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Kn(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ln(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),v(el,el.current),r)break;return null;case 22:case 23:return t.lanes=0,Sn(e,t,n);case 24:Hn(t,Ol,e.memoizedState.cache)}return Rn(e,t,n)}function Vn(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)bl=!0;else{if(!zn(e,n)&&!(t.flags&128))return bl=!1,Bn(e,t,n);bl=!!(e.flags&131072)}else bl=!1,Sc&&t.flags&1048576&&F(t,uc,t.index);switch(t.lanes=0,t.tag){case 16:a:{e=t.pendingProps;var i=t.elementType,o=i._init;if(i=o(i._payload),t.type=i,typeof i==`function`)Ki(i)?(e=dn(i,e),t.tag=1,t=Dn(null,t,i,e,n)):(t.tag=0,t=Tn(null,t,i,e,n));else{if(i!=null){if(o=i.$$typeof,o===ba){t.tag=11,t=yn(null,t,i,e,n);break a}else if(o===Ca){t.tag=14,t=bn(null,t,i,e,n);break a}}throw t=a(i)||i,Error(r(306,t,``))}}return t;case 0:return Tn(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,o=dn(i,t.pendingProps),Dn(e,t,i,o,n);case 3:a:{if(re(t,t.stateNode.containerInfo),e===null)throw Error(r(387));var s=t.pendingProps;o=t.memoizedState,i=o.element,we(e,t),Ae(t,s,null,n);var c=t.memoizedState;if(s=c.cache,Hn(t,Ol,s),s!==o.cache&&Gn(t,[Ol],n,!0),ke(),s=c.element,$a&&o.isDehydrated)if(o={element:s,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=On(e,t,s,n);break a}else if(s!==i){i=N(Error(r(424)),t),le(i),t=On(e,t,s,n);break a}else for($a&&(xc=ns(t.stateNode.containerInfo),bc=t,Sc=!0,Cc=null,wc=!0),n=Yc(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(z(),s===i){t=Rn(e,t,n);break a}vn(e,t,s,n)}t=t.child}return t;case 26:if(vs)return wn(e,t),e===null?(n=xs(t.type,null,t.pendingProps,null))?t.memoizedState=n:Sc||(t.stateNode=Ds(t.type,t.pendingProps,vc.current,t)):t.memoizedState=xs(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:if(Ms)return ie(t),e===null&&Ms&&Sc&&(i=t.stateNode=Ns(t.type,t.pendingProps,vc.current,gc.current,!1),bc=t,wc=!0,xc=ts(i)),i=t.pendingProps.children,e!==null||Sc?vn(e,t,i,n):t.child=Jc(t,null,i,n),wn(e,t),t.child;case 5:return e===null&&Sc&&(gs(t.type,t.pendingProps,gc.current),(o=i=xc)&&(i=is(i,t.type,t.pendingProps,wc),i===null?o=!1:(t.stateNode=i,bc=t,xc=ts(i),wc=!1,o=!0)),o||ae(t)),ie(t),o=t.type,s=t.pendingProps,c=e===null?null:e.memoizedProps,i=s.children,Ga(o,s)?i=null:c!==null&&Ga(o,c)&&(t.flags|=32),t.memoizedState!==null&&(o=Qe(e,t,tt,null,null,n),Xa?mo._currentValue=o:mo._currentValue2=o),wn(e,t),vn(e,t,i,n),t.child;case 6:return e===null&&Sc&&(_s(t.pendingProps,gc.current),(e=n=xc)&&(n=as(n,t.pendingProps,wc),n===null?e=!1:(t.stateNode=n,bc=t,xc=null,e=!0)),e||ae(t)),null;case 13:return jn(e,t,n);case 4:return re(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Jc(t,null,i,n):vn(e,t,i,n),t.child;case 11:return yn(e,t,t.type,t.pendingProps,n);case 7:return vn(e,t,t.pendingProps,n),t.child;case 8:return vn(e,t,t.pendingProps.children,n),t.child;case 12:return vn(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Hn(t,t.type,i.value),vn(e,t,i.children,n),t.child;case 9:return o=t.type._context,i=t.pendingProps.children,Jn(t),o=Yn(o),i=i(o),t.flags|=1,vn(e,t,i,n),t.child;case 14:return bn(e,t,t.type,t.pendingProps,n);case 15:return xn(e,t,t.type,t.pendingProps,n);case 19:return Ln(e,t,n);case 22:return Sn(e,t,n);case 24:return Jn(t),i=Yn(Ol),e===null?(o=er(),o===null&&(o=q,s=Qn(),o.pooledCache=s,s.refCount++,s!==null&&(o.pooledCacheLanes|=n),o=s),t.memoizedState={parent:i,
4403cache:o},Ce(t),Hn(t,Ol,o)):((e.lanes&n)!==0&&(we(e,t),Ae(t,null,null,n),ke()),o=e.memoizedState,s=t.memoizedState,o.parent===i?(i=s.cache,Hn(t,Ol,i),i!==o.cache&&Gn(t,[Ol],n,!0)):(o={parent:i,cache:i},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Hn(t,Ol,i))),vn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Hn(e,t,n){Xa?(v(Sl,t._currentValue),t._currentValue=n):(v(Sl,t._currentValue2),t._currentValue2=n)}function Un(e){var t=Sl.current;Xa?e._currentValue=t:e._currentValue2=t,_(Sl)}function Wn(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gn(e,t,n,i){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wn(o.return,n,e),i||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(r(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wn(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Kn(e,t,n,i){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(r(387));if(s=s.memoizedProps,s!==null){var c=a.type;ac(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===yc.current){if(s=a.alternate,s===null)throw Error(r(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mo]:e.push(mo))}a=a.return}e!==null&&Gn(t,e,n,i),t.flags|=262144}function qn(e){for(e=e.firstContext;e!==null;){var t=e.context;if(!ac(Xa?t._currentValue:t._currentValue2,e.memoizedValue))return!0;e=e.next}return!1}function Jn(e){Cl=e,wl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yn(e){return Zn(Cl,e)}function Xn(e,t){return Cl===null&&Jn(e),Zn(e,t)}function Zn(e,t){var n=Xa?t._currentValue:t._currentValue2;if(t={context:t,memoizedValue:n,next:null},wl===null){if(e===null)throw Error(r(308));wl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else wl=wl.next=t;return n}function Qn(){return{controller:new Tl,data:new Map,refCount:0}}function $n(e){e.refCount--,e.refCount===0&&El(Dl,function(){e.controller.abort()})}function er(){var e=Al.current;return e===null?q.pooledCache:e}function tr(e,t){t===null?v(Al,Al.current):v(Al,t.pool)}function nr(){var e=er();return e===null?null:{parent:Xa?Ol._currentValue:Ol._currentValue2,pool:e}}function rr(e){e.flags|=4}function ir(e,t){if(e!==null&&e.child===t.child)return!1;if(t.flags&16)return!0;for(e=t.child;e!==null;){if(e.flags&13878||e.subtreeFlags&13878)return!0;e=e.sibling}return!1}function ar(e,t,n,r){if(Za)for(n=t.child;n!==null;){if(n.tag===5||n.tag===6)Ua(e,n.stateNode);else if(!(n.tag===4||Ms&&n.tag===27)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}else if(Qa)for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=Ko(a,i.type,i.memoizedProps)),Ua(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=qo(a,i.memoizedProps)),Ua(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),ar(e,i,!0,!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function or(e,t,n,r){if(Qa)for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=Ko(a,i.type,i.memoizedProps)),Uo(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=qo(a,i.memoizedProps)),Uo(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),or(e,i,!(i.memoizedProps!==null&&i.memoizedProps.mode===`manual`),!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function sr(e,t){if(Qa&&ir(e,t)){e=t.stateNode;var n=e.containerInfo,r=Ho();or(r,t,!1,!1),e.pendingChildren=r,rr(t),Wo(n,r)}}function cr(e,t,n,r){if(Za)e.memoizedProps!==r&&rr(t);else if(Qa){var i=e.stateNode,a=e.memoizedProps;if((e=ir(e,t))||a!==r){var o=gc.current;a=Vo(i,n,a,r,!e,null),a===i?t.stateNode=i:(Wa(a,n,r,o)&&rr(t),t.stateNode=a,e?ar(a,t,!1,!1):rr(t))}else t.stateNode=i}}
4403function lr(e,t,n){if(so(t,n)){if(e.flags|=16777216,!co(t,n))if(xi())e.flags|=8192;else throw Gc=Wc,Uc}else e.flags&=-16777217}function ur(e,t){if(ks(t)){if(e.flags|=16777216,!As(t))if(xi())e.flags|=8192;else throw Gc=Wc,Uc}else e.flags&=-16777217}function dr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:T(),e.lanes|=t,lu|=t)}function fr(e,t){if(!Sc)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&31457280,r|=i.flags&31457280,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function mr(e,t,n){var i=t.pendingProps;switch(ne(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pr(t),null;case 1:return pr(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Un(Ol),L(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(ce(t)?rr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Cc!==null&&(pi(Cc),Cc=null))),sr(e,t),pr(t),null;case 26:if(vs){n=t.type;var a=t.memoizedState;return e===null?(rr(t),a===null?(pr(t),lr(t,n,i)):(pr(t),ur(t,a))):a?a===e.memoizedState?(pr(t),t.flags&=-16777217):(rr(t),pr(t),ur(t,a)):(Za?e.memoizedProps!==i&&rr(t):cr(e,t,n,i),pr(t),lr(t,n,i)),null}case 27:if(Ms){if(R(t),n=vc.current,a=t.type,e!==null&&t.stateNode!=null)Za?e.memoizedProps!==i&&rr(t):cr(e,t,a,i);else{if(!i){if(t.stateNode===null)throw Error(r(166));return pr(t),null}e=gc.current,ce(t)?oe(t,e):(e=Ns(a,i,n,e,!0),t.stateNode=e,rr(t))}return pr(t),null}case 5:if(R(t),n=t.type,e!==null&&t.stateNode!=null)cr(e,t,n,i);else{if(!i){if(t.stateNode===null)throw Error(r(166));return pr(t),null}e=gc.current,ce(t)?oe(t,e):(a=Ha(n,i,vc.current,e,t),ar(a,t,!1,!1),t.stateNode=a,Wa(a,n,i,e)&&rr(t))}return pr(t),lr(t,t.type,t.pendingProps),null;case 6:if(e&&t.stateNode!=null)n=e.memoizedProps,Za?n!==i&&rr(t):Qa&&(n===i?t.stateNode=e.stateNode:(t.stateNode=Ka(i,vc.current,gc.current,t),rr(t)));else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(e=vc.current,n=gc.current,ce(t)){if(!$a)throw Error(r(176));if(e=t.stateNode,n=t.memoizedProps,i=null,a=bc,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}cs(e,n,t,i)||ae(t)}else t.stateNode=Ka(i,e,n,t)}return pr(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ce(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(r(318));if(!$a)throw Error(r(344));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(r(317));ls(a,t)}else z(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pr(t),a=!1}else Cc!==null&&(pi(Cc),Cc=null),a=!0;if(!a)return t.flags&256?(Je(t),t):(Je(t),null)}if(Je(t),t.flags&128)return t.lanes=n,t;if(n=i!==null,e=e!==null&&e.memoizedState!==null,n){i=t.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool);var o=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),dr(t,t.updateQueue),pr(t),null;case 4:return L(),sr(e,t),e===null&&to(t.stateNode.containerInfo),pr(t),null;case 10:return Un(t.type),pr(t),null;case 19:if(_(el),a=t.memoizedState,a===null)return pr(t),null;if(i=(t.flags&128)!=0,o=a.rendering,o===null)if(i)fr(a,!1);else{if(iu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ye(e),o!==null){for(t.flags|=128,fr(a,!1),e=o.updateQueue,t.updateQueue=e,dr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ji(n,e),n=n.sibling;return v(el,el.current&1|2),t.child}e=e.sibling}a.tail!==null&&Xs()>mu&&(t.flags|=128,i=!0,fr(a,!1),t.lanes=4194304)}else{if(!i)if(e=Ye(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,dr(t,e),fr(a,!0),a.tail===null&&a.tailMode===`hidden`&&!o.alternate&&!Sc)return pr(t),null}else 2*Xs()-a.renderingStartTime>mu&&n!==536870912&&(t.flags|=128,i=!0,fr(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e===null?t.child=o:e.sibling=o,a.last=o)}return a.tail===null?(pr(t),null):(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Xs(),t.sibling=null,e=el.current,v(el,i?e&1|2:e&1),t);case 22:case 23:return Je(t),We(),i=t.memoizedState!==null,e===null?i&&(t.flags|=8192):e.memoizedState!==null!==i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(pr(t),t.subtreeFlags&6&&(t.flags|=8192)):pr(t),n=t.updateQueue,n!==null&&dr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&_(Al),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Un(Ol),pr(t),null;case 25:return null}throw Error(r(156,t.tag))}function hr(e,t){switch(ne(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
4403case 3:return Un(Ol),L(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return R(t),null;case 13:if(Je(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));z()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(el),null;case 4:return L(),null;case 10:return Un(t.type),null;case 22:case 23:return Je(t),We(),e!==null&&_(Al),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Un(Ol),null;case 25:return null;default:return null}}function gr(e,t){switch(ne(t),t.tag){case 3:Un(Ol),L();break;case 26:case 27:case 5:R(t);break;case 4:L();break;case 13:Je(t);break;case 19:_(el);break;case 10:Un(t.type);break;case 22:case 23:Je(t),We(),e!==null&&_(Al);break;case 24:Un(Ol)}}function _r(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ri(t,t.return,e)}}function vr(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n;try{s()}catch(e){Ri(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ri(t,t.return,e)}}function yr(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Me(t,n)}catch(t){Ri(e,e.return,t)}}}function br(e,t,n){n.props=dn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ri(e,t,n)}}function xr(e,t){try{var n=e.ref;if(n!==null){var r=e.stateNode;switch(e.tag){case 26:case 27:case 5:var i=La(r);break;default:i=r}typeof n==`function`?e.refCleanup=n(i):n.current=i}}catch(n){Ri(e,t,n)}}function Sr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ri(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ri(e,t,n)}else n.current=null}function Cr(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{ko(r,t,n,e)}catch(t){Ri(e,e.return,t)}}function wr(e,t,n){try{Ao(e.stateNode,e.type,n,t,e)}catch(t){Ri(e,e.return,t)}}function Tr(e){return e.tag===5||e.tag===3||(vs?e.tag===26:!1)||(Ms?e.tag===27:!1)||e.tag===4}function Er(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Tr(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&(!Ms||e.tag!==27)&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Dr(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?Mo(n,e,t):Do(n,e);else if(!(r===4||Ms&&r===27)&&(e=e.child,e!==null))for(Dr(e,t,n),e=e.sibling;e!==null;)Dr(e,t,n),e=e.sibling}function Or(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?jo(n,e,t):Eo(n,e);else if(!(r===4||Ms&&r===27)&&(e=e.child,e!==null))for(Or(e,t,n),e=e.sibling;e!==null;)Or(e,t,n),e=e.sibling}function kr(e,t,n){e=e.containerInfo;try{Go(e,n)}catch(e){Ri(t,t.return,e)}}function Ar(e,t){for(Ba(e.containerInfo),Fl=t;Fl!==null;)if(e=Fl,t=e.child,e.subtreeFlags&1028&&t!==null)t.return=e,Fl=t;else for(;Fl!==null;){e=Fl;var n=e.alternate;switch(t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if(t&1024&&n!==null){t=void 0;var i=e,a=n.memoizedProps;n=n.memoizedState;var o=i.stateNode;try{var s=dn(i.type,a,i.elementType===i.type);t=o.getSnapshotBeforeUpdate(s,n),o.__reactInternalSnapshotBeforeUpdate=t}catch(e){Ri(i,i.return,e)}}break;case 3:t&1024&&Za&&Bo(e.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(r(163))}if(t=e.sibling,t!==null){t.return=e.return,Fl=t;break}Fl=e.return}return s=Il,Il=!1,s}function jr(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Hr(e,n),r&4&&_r(5,n);break;case 1:if(Hr(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ri(n,n.return,e)}else{var i=dn(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ri(n,n.return,e)}}r&64&&yr(n),r&512&&xr(n,n.return);break;case 3:if(Hr(e,n),r&64&&(r=n.updateQueue,r!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=La(n.child.stateNode);break;case 1:e=n.child.stateNode}try{Me(r,e)}catch(e){Ri(n,n.return,e)}}break;case 26:if(vs){Hr(e,n),r&512&&xr(n,n.return);break}case 27:case 5:Hr(e,n),t===null&&r&4&&Cr(n),r&512&&xr(n,n.return);break;case 12:Hr(e,n);break;case 13:Hr(e,n),r&4&&Fr(e,n);break;case 22:if(i=n.memoizedState!==null||jl,!i){t=t!==null&&t.memoizedState!==null||Ml;var a=jl,o=Ml;jl=i,(Ml=t)&&!o?Wr(e,n,(n.subtreeFlags&8772)!=0):Hr(e,n),jl=a,Ml=o}r&512&&(n.memoizedProps.mode===`manual`?xr(n,n.return):Sr(n,n.return));break;default:Hr(e,n)}}function Mr(e){var t=e.alternate;t!==null&&(e.alternate=null,Mr(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&oo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nr(e,t,n){for(n=n.child;n!==null;)Pr(e,t,n),n=n.sibling}function Pr(e,t,n){if(ic&&typeof ic.onCommitFiberUnmount==`function`)try{ic.onCommitFiberUnmount(rc,n)}catch{}switch(n.tag){case 26:if(vs){Ml||Sr(n,t),Nr(e,t,n),n.memoizedState?Cs(n.memoizedState):n.stateNode&&Es(n.stateNode);break}case 27:if(Ms){Ml||Sr(n,t);var r=Ll,i=Rl;Ll=n.stateNode,Nr(e,t,n),Is(n.stateNode),Ll=r,Rl=i;break}case 5:Ml||Sr(n,t);case 6:if(Za){if(r=Ll,i=Rl,Ll=null,Nr(e,t,n),Ll=r,Rl=i,Ll!==null)if(Rl)try{Po(Ll,n.stateNode)}catch(e){Ri(n,t,e)}else try{No(Ll,n.stateNode)}catch(e){Ri(n,t,e)}}else Nr(e,t,n);break;case 18:Za&&Ll!==null&&(Rl?ms(Ll,n.stateNode):ps(Ll,n.stateNode));break;case 4:Za?(r=Ll,i=Rl,Ll=n.stateNode.containerInfo,Rl=!0,Nr(e,t,n),Ll=r,Rl=i):(Qa&&kr(n.stateNode,n,Ho()),Nr(e,t,n));break;case 0:case 11:case 14:case 15:Ml||vr(2,n,t),Ml||vr(4,n,t),Nr(e,t,n);break;case 1:Ml||(Sr(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&br(n,t,r)),Nr(e,t,n);break;case 21:Nr(e,t,n);break;case 22:Ml||Sr(n,t),Ml=(r=Ml)||n.memoizedState!==null,Nr(e,t,n),Ml=r;break;default:Nr(e,t,n)}}function Fr(e,t){if($a&&t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fs(e)}catch(e){Ri(t,t.return,e)}}function Ir(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Pl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Pl),t;default:throw Error(r(435,e.tag))}}function Lr(e,t){var n=Ir(e);t.forEach(function(t){var r=Ui.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}function Rr(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i],o=e,s=t;if(Za){var c=s;a:for(;c!==null;){switch(c.tag){case 27:case 5:Ll=c.stateNode,Rl=!1;break a;case 3:Ll=c.stateNode.containerInfo,Rl=!0;break a;case 4:Ll=c.stateNode.containerInfo,Rl=!0;break a}c=c.return}if(Ll===null)throw Error(r(160));Pr(o,s,a),Ll=null,Rl=!1}else Pr(o,s,a);o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)zr(t,e),t=t.sibling}function zr(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rr(t,e),Br(e),i&4&&(vr(3,e,e.return),_r(3,e),vr(5,e,e.return));break;case 1:Rr(t,e),Br(e),i&512&&(Ml||n===null||Sr(n,n.return)),i&64&&jl&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:if(vs){var a=zl;Rr(t,e),Br(e),i&512&&(Ml||n===null||Sr(n,n.return)),i&4&&(i=n===null?null:n.memoizedState,t=e.memoizedState,n===null?t===null?e.stateNode===null?e.stateNode=ws(a,e.type,e.memoizedProps,e):Ts(a,e.type,e.stateNode):e.stateNode=Ss(a,t,e.memoizedProps):i===t?t===null&&e.stateNode!==null&&wr(e,e.memoizedProps,n.memoizedProps):(i===null?n.stateNode!==null&&Es(n.stateNode):Cs(i),t===null?Ts(a,e.type,e.stateNode):Ss(a,t,e.memoizedProps)));break}case 27:if(Ms&&i&4&&e.alternate===null){a=e.stateNode;var o=e.memoizedProps;try{Ps(a),Fs(e.type,o,a,e)}catch(t){Ri(e,e.return,t)}}case 5:if(Rr(t,e),Br(e),i&512&&(Ml||n===null||Sr(n,n.return)),Za){if(e.flags&32){t=e.stateNode;try{Fo(t)}catch(t){Ri(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,wr(e,t,n===null?t:n.memoizedProps)),i&1024&&(Nl=!0)}break;case 6:if(Rr(t,e),Br(e),i&4&&Za){if(e.stateNode===null)throw Error(r(162));i=e.memoizedProps,n=n===null?i:n.memoizedProps,t=e.stateNode;try{Oo(t,n,i)}catch(t){Ri(e,e.return,t)}}break;case 3:if(vs?(Os(),a=zl,zl=bs(t.containerInfo),Rr(t,e),zl=a):Rr(t,e),Br(e),i&4){if(Za&&$a&&n!==null&&n.memoizedState.isDehydrated)try{ds(t.containerInfo)}catch(t){Ri(e,e.return,t)}if(Qa){i=t.containerInfo,n=t.pendingChildren;try{Go(i,n)}catch(t){Ri(e,e.return,t)}}}Nl&&(Nl=!1,Vr(e));break;case 4:vs?(n=zl,zl=bs(e.stateNode.containerInfo),Rr(t,e),Br(e),zl=n):(Rr(t,e),Br(e)),i&4&&Qa&&kr(e.stateNode,e,e.stateNode.pendingChildren);break;case 12:Rr(t,e),Br(e);break;case 13:Rr(t,e),Br(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(pu=Xs()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lr(e,i)));break;case 22:i&512&&(Ml||n===null||Sr(n,n.return)),a=e.memoizedState!==null;var s=n!==null&&n.memoizedState!==null,c=jl,l=Ml;if(jl=c||a,Ml=l||s,Rr(t,e),Ml=l,jl=c,Br(e),t=e.stateNode,t._current=e,t._visibility&=-3,t._visibility|=t._pendingVisibility&2,i&8192&&(t._visibility=a?t._visibility&-2:t._visibility|1,a&&(t=jl||Ml,n===null||s||t||Ur(e)),Za&&(e.memoizedProps===null||e.memoizedProps.mode!==`manual`))){a:if(n=null,Za)for(t=e;;){if(t.tag===5||vs&&t.tag===26||Ms&&t.tag===27){if(n===null){s=n=t;try{o=s.stateNode,a?Io(o):Ro(s.stateNode,s.memoizedProps)}catch(e){Ri(s,s.return,e)}}}else if(t.tag===6){if(n===null){s=t;try{var u=s.stateNode;a?Lo(u):zo(u,s.memoizedProps)}catch(e){Ri(s,s.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Lr(e,n))));break;case 19:Rr(t,e),Br(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lr(e,i)));break;case 21:break;default:Rr(t,e),Br(e)}}function Br(e){var t=e.flags;if(t&2){try{if(Za&&(!Ms||e.tag!==27)){a:{for(var n=e.return;n!==null;){if(Tr(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 27:if(Ms){var a=i.stateNode;Or(e,Er(e),a);break}case 5:var o=i.stateNode;i.flags&32&&(Fo(o),i.flags&=-33),Or(e,Er(e),o);break;case 3:case 4:var s=i.stateNode.containerInfo;Dr(e,Er(e),s);break;default:throw Error(r(161))}}}catch(t){Ri(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vr(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vr(t),t.tag===5&&t.flags&1024&&ho(t.stateNode),e=e.sibling}}function Hr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)jr(e,t.alternate,t),t=t.sibling}function Ur(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vr(4,t,t.return),Ur(t);break;case 1:Sr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&br(t,t.return,n),Ur(t);break;case 26:case 27:case 5:Sr(t,t.return),Ur(t);break;case 22:Sr(t,t.return),t.memoizedState===null&&Ur(t);break;default:Ur(t)}e=e.sibling}}function Wr(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Wr(i,a,n),_r(4,a);break;case 1:if(Wr(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ri(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;
4403if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)je(c[i],s)}catch(e){Ri(r,r.return,e)}}n&&o&64&&yr(a),xr(a,a.return);break;case 26:case 27:case 5:Wr(i,a,n),n&&r===null&&o&4&&Cr(a),xr(a,a.return);break;case 12:Wr(i,a,n);break;case 13:Wr(i,a,n),n&&o&4&&Fr(i,a);break;case 22:a.memoizedState===null&&Wr(i,a,n),xr(a,a.return);break;default:Wr(i,a,n)}t=t.sibling}}function Gr(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&$n(n))}function Kr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$n(e))}function qr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jr(e,t,n,r),t=t.sibling}function Jr(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:qr(e,t,n,r),i&2048&&_r(9,t);break;case 3:qr(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$n(e)));break;case 12:if(i&2048){qr(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ri(t,t.return,e)}}else qr(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,t.memoizedState===null?a._visibility&4?qr(e,t,n,r):(a._visibility|=4,Yr(e,t,n,r,(t.subtreeFlags&10256)!=0)):a._visibility&4?qr(e,t,n,r):Xr(e,t),i&2048&&Gr(t.alternate,t);break;case 24:qr(e,t,n,r),i&2048&&Kr(t.alternate,t);break;default:qr(e,t,n,r)}}function Yr(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Yr(a,o,s,c,i),_r(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=4,Yr(a,o,s,c,i)):u._visibility&4?Yr(a,o,s,c,i):Xr(a,o),i&&l&2048&&Gr(o.alternate,o);break;case 24:Yr(a,o,s,c,i),i&&l&2048&&Kr(o.alternate,o);break;default:Yr(a,o,s,c,i)}t=t.sibling}}function Xr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Xr(n,r),i&2048&&Gr(r.alternate,r);break;case 24:Xr(n,r),i&2048&&Kr(r.alternate,r);break;default:Xr(n,r)}t=t.sibling}}function Zr(e){if(e.subtreeFlags&Bl)for(e=e.child;e!==null;)Qr(e),e=e.sibling}function Qr(e){switch(e.tag){case 26:Zr(e),e.flags&Bl&&(e.memoizedState===null?uo(e.type,e.memoizedProps):js(zl,e.memoizedState,e.memoizedProps));break;case 5:Zr(e),e.flags&Bl&&uo(e.type,e.memoizedProps);break;case 3:case 4:if(vs){var t=zl;zl=bs(e.stateNode.containerInfo),Zr(e),zl=t}else Zr(e);break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Bl,Bl=16777216,Zr(e),Bl=t):Zr(e));break;default:Zr(e)}}function $r(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ei(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Fl=r,ri(r,e)}$r(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ti(e),e=e.sibling}function ti(e){switch(e.tag){case 0:case 11:case 15:ei(e),e.flags&2048&&vr(9,e,e.return);break;case 3:ei(e);break;case 12:ei(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&4&&(e.return===null||e.return.tag!==13)?(t._visibility&=-5,ni(e)):ei(e);break;default:ei(e)}}function ni(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Fl=r,ri(r,e)}$r(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vr(8,t,t.return),ni(t);break;case 22:n=t.stateNode,n._visibility&4&&(n._visibility&=-5,ni(t));break;default:ni(t)}e=e.sibling}}function ri(e,t){for(;Fl!==null;){var n=Fl;switch(n.tag){case 0:case 11:case 15:vr(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:$n(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Fl=r;else a:for(n=e;Fl!==null;){r=Fl;var i=r.sibling,a=r.return;if(Mr(r),r===n){Fl=null;break a}if(i!==null){i.return=a,Fl=i;break a}Fl=a}}}function ii(e){var t=eo(e);if(t!=null){if(typeof t.memoizedProps[`data-testname`]!=`string`)throw Error(r(364));return t}if(e=yo(e),e===null)throw Error(r(362));return e.stateNode.current}function ai(e,t){var n=e.tag;switch(t.$$typeof){case Hl:if(e.type===t.value)return!0;break;case Ul:a:{for(t=t.value,e=[e,0],n=0;n<e.length;){var i=e[n++],a=i.tag,o=e[n++],s=t[o];if(a!==5&&a!==26&&a!==27||!So(i)){for(;s!=null&&ai(i,s);)o++,s=t[o];if(o===t.length){t=!0;break a}else for(i=i.child;i!==null;)e.push(i,o),i=i.sibling}}t=!1}return t;case Wl:if((n===5||n===26||n===27)&&Co(e.stateNode,t.value))return!0;break;case Kl:if((n===5||n===6||n===26||n===27)&&(e=xo(e),e!==null&&0<=e.indexOf(t.value)))return!0;break;case Gl:if((n===5||n===26||n===27)&&(e=e.memoizedProps[`data-testname`],typeof e==`string`&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function oi(e){switch(e.$$typeof){case Hl:return`<`+(a(e.value)||`Unknown`)+`>`;case Ul:return`:has(`+(oi(e)||``)+`)`;case Wl:return`[role="`+e.value+`"]`;case Kl:return`"`+e.value+`"`;case Gl:return`[data-testname="`+e.value+`"]`;default:throw Error(r(365))}}function si(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],a=i.tag,o=e[r++],s=t[o];if(a!==5&&a!==26&&a!==27||!So(i)){for(;s!=null&&ai(i,s);)o++,s=t[o];if(o===t.length)n.push(i);else for(i=i.child;i!==null;)e.push(i,o),i=i.sibling}}return n}function ci(e,t){if(!vo)throw Error(r(363));e=ii(e),e=si(e,t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var i=e[n++],a=i.tag;if(a===5||a===26||a===27)So(i)||t.push(i.stateNode);else for(i=i.child;i!==null;)e.push(i),i=i.sibling}return t}function li(){if(Yl&2&&Zl!==0)return Zl&-Zl;if(ka.T!==null){var e=Lc;return e===0?ye():e}return io()}function ui(){cu===0&&(cu=!(Zl&536870912)||Sc?w():536870912);var e=Qc.current;return e!==null&&(e.flags|=32),cu}function di(e,t,n){(e===q&&Ql===2||e.cancelPendingCommit!==null)&&(yi(e,0),gi(e,Zl,cu,!1)),D(e,n),(!(Yl&2)||e!==q)&&(e===q&&(!(Yl&2)&&(ou|=n),iu===4&&gi(e,Zl,cu,!1)),he(e))}function fi(e,t,n){if(Yl&6)throw Error(r(327));var i=!n&&(t&60)==0&&(t&e.expiredLanes)===0||S(e,t),a=i?Ei(e,t):wi(e,t,!0),o=i;do{if(a===0){tu&&!i&&gi(e,t,0,!1);break}else if(a===6)gi(e,t,0,!eu);else{if(n=e.current.alternate,o&&!hi(n)){a=wi(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=uu;var l=$a&&c.current.memoizedState.isDehydrated;if(l&&(yi(c,s).flags|=256),s=wi(c,s,!1),s!==2){if(nu&&!l){c.errorRecoveryDisabledLanes|=o,ou|=o,a=4;break a}o=du,du=a,o!==null&&pi(o)}a=s}if(o=!1,a!==2)continue}}if(a===1){yi(e,0),gi(e,t,0,!0);break}a:{switch(i=e,a){case 0:case 1:throw Error(r(345));case 4:if((t&4194176)===t){gi(i,t,cu,!eu);break a}break;case 2:du=null;break;case 3:case 5:break;default:throw Error(r(329))}if(i.finishedWork=n,i.finishedLanes=t,(t&62914560)===t&&(o=pu+300-Xs(),10<o)){if(gi(i,t,cu,!eu),x(i,0)!==0)break a;i.timeoutHandle=qa(mi.bind(null,i,n,du,hu,fu,t,cu,ou,lu,eu,2,-0,0),o);break a}mi(i,n,du,hu,fu,t,cu,ou,lu,eu,0,-0,0)}}break}while(1);he(e)}
vendor: 4,562 bytes, line 4403
4403function pi(e){du===null?du=e:du.push.apply(du,e)}function mi(e,t,n,r,i,a,o,s,c,l,u,d,f){var p=t.subtreeFlags;if((p&8192||(p&16785408)==16785408)&&(lo(),Qr(t),t=fo(),t!==null)){e.cancelPendingCommit=t(Ni.bind(null,e,n,r,i,o,s,c,1,d,f)),gi(e,a,o,!l);return}Ni(e,n,r,i,o,s,c,u,d,f)}function hi(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ac(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gi(e,t,n,r){t&=~su,t&=~ou,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Vs(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&k(e,n,t)}function _i(){return Yl&6?!0:(V(0,!1),!1)}function vi(){if(Xl!==null){if(Ql===0)var e=Xl.return;else e=Xl,wl=Cl=null,rt(e),Kc=null,qc=0,e=Xl;for(;e!==null;)gr(e.alternate,e),e=e.return;Xl=null}}function yi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;n!==Ya&&(e.timeoutHandle=Ya,Ja(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vi(),q=e,Xl=n=qi(e.current,null),Zl=t,Ql=0,$l=null,eu=!1,tu=S(e,t),nu=!1,lu=cu=su=ou=au=iu=0,du=uu=null,fu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Vs(r),a=1<<i;t|=e[i],r&=~a}return ru=t,ue(),n}function bi(e,t){nl=null,ka.H=pl,t===Hc?(t=Le(),Ql=3):t===Uc?(t=Le(),Ql=4):Ql=t===yl?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$l=t,Xl===null&&(iu=1,fn(e,N(t,e.current)))}function xi(){var e=Qc.current;return e===null?!0:(Zl&4194176)===Zl?$c===null:(Zl&62914560)===Zl||Zl&536870912?e===$c:!1}function Si(){var e=ka.H;return ka.H=pl,e===null?pl:e}function K(){var e=ka.A;return ka.A=Vl,e}function Ci(){iu=4,eu||(Zl&4194176)!==Zl&&Qc.current!==null||(tu=!0),!(au&134217727)&&!(ou&134217727)||q===null||gi(q,Zl,cu,!1)}function wi(e,t,n){var r=Yl;Yl|=2;var i=Si(),a=K();(q!==e||Zl!==t)&&(hu=null,yi(e,t)),t=!1;var o=iu;a:do try{if(Ql!==0&&Xl!==null){var s=Xl,c=$l;switch(Ql){case 8:vi(),o=6;break a;case 3:case 2:case 6:Qc.current===null&&(t=!0);var l=Ql;if(Ql=0,$l=null,Ai(e,s,c,l),n&&tu){o=0;break a}break;default:l=Ql,Ql=0,$l=null,Ai(e,s,c,l)}}Ti(),o=iu;break}catch(t){bi(e,t)}while(1);return t&&e.shellSuspendCounter++,wl=Cl=null,Yl=r,ka.H=i,ka.A=a,Xl===null&&(q=null,Zl=0,ue()),o}function Ti(){for(;Xl!==null;)Oi(Xl)}function Ei(e,t){var n=Yl;Yl|=2;var i=Si(),a=K();q!==e||Zl!==t?(hu=null,mu=Xs()+500,yi(e,t)):tu=S(e,t);a:do try{if(Ql!==0&&Xl!==null){t=Xl;var o=$l;b:switch(Ql){case 1:Ql=0,$l=null,Ai(e,t,o,1);break;case 2:if(Pe(o)){Ql=0,$l=null,ki(t);break}t=function(){Ql===2&&q===e&&(Ql=7),he(e)},o.then(t,t);break a;case 3:Ql=7;break a;case 4:Ql=5;break a;case 7:Pe(o)?(Ql=0,$l=null,ki(t)):(Ql=0,$l=null,Ai(e,t,o,7));break;case 5:var s=null;switch(Xl.tag){case 26:s=Xl.memoizedState;case 5:case 27:var c=Xl,l=c.type,u=c.pendingProps;if(s?As(s):co(l,u)){Ql=0,$l=null;var d=c.sibling;if(d!==null)Xl=d;else{var f=c.return;f===null?Xl=null:(Xl=f,ji(f))}break b}}Ql=0,$l=null,Ai(e,t,o,5);break;case 6:Ql=0,$l=null,Ai(e,t,o,6);break;case 8:vi(),iu=6;break a;default:throw Error(r(462))}}Di();break}catch(t){bi(e,t)}while(1);return wl=Cl=null,ka.H=i,ka.A=a,Yl=n,Xl===null?(q=null,Zl=0,ue(),iu):0}function Di(){for(;Xl!==null&&!Js();)Oi(Xl)}function Oi(e){var t=Vn(e.alternate,e,ru);e.memoizedProps=e.pendingProps,t===null?ji(e):Xl=t}function ki(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=En(n,t,t.pendingProps,t.type,void 0,Zl);break;case 11:t=En(n,t,t.pendingProps,t.type.render,t.ref,Zl);break;case 5:rt(t);default:gr(n,t),t=Xl=Ji(t,ru),t=Vn(n,t,ru)}e.memoizedProps=e.pendingProps,t===null?ji(e):Xl=t}function Ai(e,t,n,r){wl=Cl=null,rt(t),Kc=null,qc=0;var i=t.return;try{if(_n(e,i,t,n,Zl)){iu=1,fn(e,N(n,e.current)),Xl=null;return}}catch(t){if(i!==null)throw Xl=i,t;iu=1,fn(e,N(n,e.current)),Xl=null;return}t.flags&32768?(Sc||r===1?e=!0:tu||Zl&536870912?e=!1:(eu=e=!0,(r===2||r===3||r===6)&&(r=Qc.current,r!==null&&r.tag===13&&(r.flags|=16384))),Mi(t,e)):ji(t)}function ji(e){var t=e;do{if(t.flags&32768){Mi(t,eu);return}e=t.return;var n=mr(t.alternate,t,ru);if(n!==null){Xl=n;return}if(t=t.sibling,t!==null){Xl=t;return}Xl=t=e}while(t!==null);iu===0&&(iu=5)}function Mi(e,t){do{var n=hr(e.alternate,e);if(n!==null){n.flags&=32767,Xl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deleti
4403ons=null),!t&&(e=e.sibling,e!==null)){Xl=e;return}Xl=e=n}while(e!==null);iu=6,Xl=null}function Ni(e,t,n,r,i,a,o,s,c,l){var u=ka.T,d=ro();try{no(2),ka.T=null,Pi(e,t,n,r,d,i,a,o,s,c,l)}finally{ka.T=u,no(d)}}function Pi(e,t,n,i,a,o,s,c){do Ii();while(vu!==null);if(Yl&6)throw Error(r(327));var l=e.finishedWork;if(i=e.finishedLanes,l===null)return null;if(e.finishedWork=null,e.finishedLanes=0,l===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var u=l.lanes|l.childLanes;if(u|=Oc,O(e,i,u,o,s,c),e===q&&(Xl=q=null,Zl=0),!(l.subtreeFlags&10256)&&!(l.flags&10256)||_u||(_u=!0,bu=u,xu=n,Wi($s,function(){return Ii(!0),null})),n=(l.flags&15990)!=0,l.subtreeFlags&15990||n?(n=ka.T,ka.T=null,o=ro(),no(2),s=Yl,Yl|=4,Ar(e,l),zr(l,e),Va(e.containerInfo),e.current=l,jr(e,l.alternate,l),Ys(),Yl=s,no(o),ka.T=n):e.current=l,_u?(_u=!1,vu=e,yu=i):Fi(e,u),u=e.pendingLanes,u===0&&(gu=null),ee(l.stateNode,a),he(e),t!==null)for(a=e.onRecoverableError,l=0;l<t.length;l++)u=t[l],a(u.value,{componentStack:u.stack});return yu&3&&Ii(),u=e.pendingLanes,i&4194218&&u&42?e===Cu?Su++:(Su=0,Cu=e):Su=0,V(0,!1),null}function Fi(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$n(t)))}function Ii(){if(vu!==null){var e=vu,t=bu;bu=0;var n=j(yu),i=32>n?32:n;n=ka.T;var a=ro();try{if(no(i),ka.T=null,vu===null)var o=!1;else{i=xu,xu=null;var s=vu,c=yu;if(vu=null,yu=0,Yl&6)throw Error(r(331));var l=Yl;if(Yl|=4,ti(s.current),Jr(s,s.current,c,i),Yl=l,V(0,!1),ic&&typeof ic.onPostCommitFiberRoot==`function`)try{ic.onPostCommitFiberRoot(rc,s)}catch{}o=!0}return o}finally{no(a),ka.T=n,Fi(e,t)}}return!1}function Li(e,t,n){t=N(n,t),t=mn(e.stateNode,t,2),e=Ee(e,t,2),e!==null&&(D(e,2),he(e))}function Ri(e,t,n){if(e.tag===3)Li(e,e,n);else for(;t!==null;){if(t.tag===3){Li(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gu===null||!gu.has(r))){e=N(n,e),n=hn(2),r=Ee(t,n,2),r!==null&&(gn(n,r,t,e),D(r,2),he(r));break}}t=t.return}}function zi(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Jl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(nu=!0,i.add(n),e=Bi.bind(null,e,t,n),t.then(e,e))}function Bi(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Zl&n)===n&&(iu===4||iu===3&&(Zl&62914560)===Zl&&300>Xs()-pu?!(Yl&2)&&yi(e,0):su|=n,lu===Zl&&(lu=0)),he(e)}function Vi(e,t){t===0&&(t=T()),e=B(e,t),e!==null&&(D(e,t),he(e))}function Hi(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Vi(e,n)}function Ui(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(t),Vi(e,n)}function Wi(e,t){return Ks(e,t)}function Gi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qi(e,n){var r=e.alternate;return r===null?(r=t(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&31457280,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Ji(e,t){e.flags&=31457282;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.
4403childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Yi(e,n,i,a,o,s){var c=0;if(a=e,typeof e==`function`)Ki(e)&&(c=1);else if(typeof e==`string`)c=vs&&Ms?ys(e,i,gc.current)?26:Ls(e)?27:5:vs?ys(e,i,gc.current)?26:5:Ms&&Ls(e)?27:5;else a:switch(e){case ma:return Xi(i.children,o,s,n);case ha:c=8,o|=24;break;case ga:return e=t(12,i,n,o|2),e.elementType=ga,e.lanes=s,e;case xa:return e=t(13,i,n,o),e.elementType=xa,e.lanes=s,e;case Sa:return e=t(19,i,n,o),e.elementType=Sa,e.lanes=s,e;case Ta:return Zi(i,o,s,n);default:if(typeof e==`object`&&e)switch(e.$$typeof){case _a:case ya:c=10;break a;case va:c=9;break a;case ba:c=11;break a;case Ca:c=14;break a;case wa:c=16,a=null;break a}c=29,i=Error(r(130,e===null?`null`:typeof e,``)),a=null}return n=t(c,i,n,o),n.elementType=e,n.type=a,n.lanes=s,n}function Xi(e,n,r,i){return e=t(7,e,i,n),e.lanes=r,e}function Zi(e,n,i,a){e=t(22,e,a,n),e.elementType=Ta,e.lanes=i;var o={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=o._current;if(e===null)throw Error(r(456));if(!(o._pendingVisibility&2)){var t=B(e,2);t!==null&&(o._pendingVisibility|=2,di(t,e,2))}},attach:function(){var e=o._current;if(e===null)throw Error(r(456));if(o._pendingVisibility&2){var t=B(e,2);t!==null&&(o._pendingVisibility&=-3,di(t,e,2))}}};return e.stateNode=o,e}function Qi(e,n,r){return e=t(6,e,null,n),e.lanes=r,e}function $i(e,n,r){return n=t(4,e.children===null?[]:e.children,e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function ea(e,t,n,r,i,a,o,s){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ya,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=E(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=E(0),this.hiddenUpdates=E(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function ta(e,n,r,i,a,o,s,c,l,u,d,f){return e=new ea(e,n,r,s,c,l,u,f),n=1,!0===o&&(n|=24),o=t(3,null,null,n),e.current=o,o.stateNode=e,n=Qn(),n.refCount++,e.pooledCache=n,n.refCount++,o.memoizedState={element:i,isDehydrated:r,cache:n},Ce(o),e}function na(e){return e?(e=Bs,e):Bs}function ra(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=f(t),e=e===null?null:p(e),e===null?null:La(e.stateNode)}function ia(e,t,n,r,i,a){i=na(i),r.context===null?r.context=i:r.pendingContext=i,r=Te(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ee(e,r,t),n!==null&&(di(n,e,t),De(n,e,t))}function aa(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function oa(e,t){aa(e,t),(e=e.alternate)&&aa(e,t)}var sa={},ca=h(),la=zO(),ua=Object.assign,da=Symbol.for(`react.element`),fa=Symbol.for(`react.transitional.element`),pa=Symbol.for(`react.portal`),ma=Symbol.for(`react.fragment`),ha=Symbol.for(`react.strict_mode`),ga=Symbol.for(`react.profiler`),_a=Symbol.for(`react.provider`),va=Symbol.for(`react.consumer`),ya=Symbol.for(`react.context`),ba=Symbol.for(`react.forward_ref`),xa=Symbol.for(`react.suspense`),Sa=Symbol.for(`react.suspense_list`),Ca=Symbol.for(`react.memo`),wa=Symbol.for(`react.lazy`),Ta=Symbol.for(`react.offscreen`),Ea=Symbol.for(`react.memo_cache_sentinel`),Da=Symbol.iterator,Oa=Symbol.for(`react.client.reference`),ka=ca.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Aa,ja,Ma=!1,Na=Array.isArray,Pa=e.rendererVersion,Fa=e.rendererPackageName,Ia=e.extraDevToolsConfig,La=e.getPublicInstance,Ra=e.getRootHostContext,za=e.getChildHostContext,Ba=e.prepareForCommit,Va=e.resetAfterCommit,Ha=e.createInstance,Ua=e.appendInitialChild,Wa=e.finalizeInitialChildren,Ga=e.shouldSetTextContent,Ka=e.createTextInstance,qa=e.scheduleTimeout,Ja=e.cancelTimeout,Ya=e.noTimeout,Xa=e.isPrimaryRenderer;e.warnsIfNotActing;var Za=e.supportsMutation,Qa=e.supportsPersistence,$a=e.supportsHydration,eo=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var to=e.preparePortalMount;
4403e.prepareScopeUpdate,e.getInstanceFromScope;var no=e.setCurrentUpdatePriority,ro=e.getCurrentUpdatePriority,io=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var ao=e.shouldAttemptEagerTransition,oo=e.detachDeletedInstance;e.requestPostPaintCallback;var so=e.maySuspendCommit,co=e.preloadInstance,lo=e.startSuspendingCommit,uo=e.suspendInstance,fo=e.waitForCommitToBeReady,po=e.NotPendingTransition,mo=e.HostTransitionContext,ho=e.resetFormInstance;e.bindToConsole;var go=e.supportsMicrotasks,_o=e.scheduleMicrotask,vo=e.supportsTestSelectors,yo=e.findFiberRoot,bo=e.getBoundingRect,xo=e.getTextContent,So=e.isHiddenSubtree,Co=e.matchAccessibilityRole,wo=e.setFocusIfFocusable,To=e.setupIntersectionObserver,Eo=e.appendChild,Do=e.appendChildToContainer,Oo=e.commitTextUpdate,ko=e.commitMount,Ao=e.commitUpdate,jo=e.insertBefore,Mo=e.insertInContainerBefore,No=e.removeChild,Po=e.removeChildFromContainer,Fo=e.resetTextContent,Io=e.hideInstance,Lo=e.hideTextInstance,Ro=e.unhideInstance,zo=e.unhideTextInstance,Bo=e.clearContainer,Vo=e.cloneInstance,Ho=e.createContainerChildSet,Uo=e.appendChildToContainerChildSet,Wo=e.finalizeContainerChildren,Go=e.replaceContainerChildren,Ko=e.cloneHiddenInstance,qo=e.cloneHiddenTextInstance,Jo=e.isSuspenseInstancePending,Yo=e.isSuspenseInstanceFallback,Xo=e.getSuspenseInstanceFallbackErrorDetails,Zo=e.registerSuspenseInstanceRetry,Qo=e.canHydrateFormStateMarker,$o=e.isFormStateMarkerMatching,es=e.getNextHydratableSibling,ts=e.getFirstHydratableChild,ns=e.getFirstHydratableChildWithinContainer,rs=e.getFirstHydratableChildWithinSuspenseInstance,is=e.canHydrateInstance,as=e.canHydrateTextInstance,os=e.canHydrateSuspenseInstance,ss=e.hydrateInstance,cs=e.hydrateTextInstance,ls=e.hydrateSuspenseInstance,us=e.getNextHydratableInstanceAfterSuspenseInstance,ds=e.commitHydratedContainer,fs=e.commitHydratedSuspenseInstance,ps=e.clearSuspenseBoundary,ms=e.clearSuspenseBoundaryFromContainer,hs=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var gs=e.validateHydratableInstance,_s=e.validateHydratableTextInstance,vs=e.supportsResources,ys=e.isHostHoistableType,bs=e.getHoistableRoot,xs=e.getResource,Ss=e.acquireResource,Cs=e.releaseResource,ws=e.hydrateHoistable,Ts=e.mountHoistable,Es=e.unmountHoistable,Ds=e.createHoistableInstance,Os=e.prepareToCommitHoistables,ks=e.mayResourceSuspendCommit,As=e.preloadResource,js=e.suspendResource,Ms=e.supportsSingletons,Ns=e.resolveSingletonInstance,Ps=e.clearSingleton,Fs=e.acquireSingletonInstance,Is=e.releaseSingletonInstance,Ls=e.isHostSingletonType,Rs=[],zs=-1,Bs={},Vs=Math.clz32?Math.clz32:y,Hs=Math.log,Us=Math.LN2,Ws=128,Gs=4194304,Ks=la.unstable_scheduleCallback,qs=la.unstable_cancelCallback,Js=la.unstable_shouldYield,Ys=la.unstable_requestPaint,Xs=la.unstable_now,Zs=la.unstable_ImmediatePriority,Qs=la.unstable_UserBlockingPriority,$s=la.unstable_NormalPriority,ec=la.unstable_IdlePriority,tc=la.log,nc=la.unstable_setDisableYieldValue,rc=null,ic=null,ac=typeof Object.is==`function`?Object.is:te,oc=new WeakMap,sc=[],cc=0,lc=null,uc=0,dc=[],fc=0,pc=null,mc=1,hc=``,gc=g(null),_c=g(null),vc=g(null),yc=g(null),bc=null,xc=null,Sc=!1,Cc=null,wc=!1,Tc=Error(r(519)),Ec=[],Dc=0,Oc=0,kc=null,Ac=null,jc=!1,Mc=!1,Nc=!1,Pc=0,Fc=null,Ic=0,Lc=0,Rc=null,zc=!1,Bc=!1,Vc=Object.prototype.hasOwnProperty,Hc=Error(r(460)),Uc=Error(r(474)),Wc={then:function(){}},Gc=null,Kc=null,qc=0,Jc=Ve(!0),Yc=Ve(!1),Xc=g(null),Zc=g(0),Qc=g(null),$c=null,el=g(0),tl=0,nl=null,rl=null,il=null,al=!1,ol=!1,sl=!1,cl=0,ll=0,ul=null,dl=0,fl=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},pl={readContext:Yn,use:st,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe};pl.useCacheRefresh=Xe,pl.useMemoCache=Xe,pl.useHostTransitionStatus=Xe,pl.useFormState=Xe,pl.useActionState=Xe,pl.useOptimistic=Xe;var ml={readContext:Yn,use:st,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:Yn,useEffect:Lt,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ft(4194308,4,Vt.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ft(4194308,4,e,t)},useInsertionEffect:function(e,t){Ft(4,2,e,t)},useMemo:function(e,t){var n=it();t=t===void 0?null:t;var r=e();if(sl){M(!0);try{e()}finally{M(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=it();if(n!==void 0){var i=n(t);if(sl){M(!0);try{n(t)}finally{M(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=en.bind(null,nl,e),[r.memoizedState,e]}
4403,useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=yt(e);var t=e.queue,n=tn.bind(null,nl,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ut,useDeferredValue:function(e,t){return Kt(it(),e,t)},useTransition:function(){var e=yt(!1);return e=Jt.bind(null,nl,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=nl,a=it();if(Sc){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),q===null)throw Error(r(349));Zl&60||mt(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Lt(gt.bind(null,i,o,e),[e]),i.flags|=2048,Nt(9,ht.bind(null,i,o,n,t),{destroy:void 0},null),n},useId:function(){var e=it(),t=q.identifierPrefix;if(Sc){var n=hc,r=mc;n=(r&~(1<<32-Vs(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=cl++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=dl++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},useCacheRefresh:function(){return it().memoizedState=$t.bind(null,nl)}};ml.useMemoCache=ct,ml.useHostTransitionStatus=Xt,ml.useFormState=Ot,ml.useActionState=Ot,ml.useOptimistic=function(e){var t=it();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rn.bind(null,nl,!0,n),n.dispatch=t,[e,t]};var hl={readContext:Yn,use:st,useCallback:Wt,useContext:Yn,useEffect:Rt,useImperativeHandle:Ht,useInsertionEffect:zt,useLayoutEffect:Bt,useMemo:Gt,useReducer:ut,useRef:Pt,useState:function(){return ut(lt)},useDebugValue:Ut,useDeferredValue:function(e,t){return qt(at(),rl.memoizedState,e,t)},useTransition:function(){var e=ut(lt)[0],t=at().memoizedState;return[typeof e==`boolean`?e:ot(e),t]},useSyncExternalStore:pt,useId:Zt};hl.useCacheRefresh=Qt,hl.useMemoCache=ct,hl.useHostTransitionStatus=Xt,hl.useFormState=kt,hl.useActionState=kt,hl.useOptimistic=function(e,t){return bt(at(),rl,e,t)};var gl={readContext:Yn,use:st,useCallback:Wt,useContext:Yn,useEffect:Rt,useImperativeHandle:Ht,useInsertionEffect:zt,useLayoutEffect:Bt,useMemo:Gt,useReducer:ft,useRef:Pt,useState:function(){return ft(lt)},useDebugValue:Ut,useDeferredValue:function(e,t){var n=at();return rl===null?Kt(n,e,t):qt(n,rl.memoizedState,e,t)},useTransition:function(){var e=ft(lt)[0],t=at().memoizedState;return[typeof e==`boolean`?e:ot(e),t]},useSyncExternalStore:pt,useId:Zt};gl.useCacheRefresh=Qt,gl.useMemoCache=ct,gl.useHostTransitionStatus=Xt,gl.useFormState=Mt,gl.useActionState=Mt,gl.useOptimistic=function(e,t){var n=at();return rl===null?(n.baseState=e,[e,n.queue.dispatch]):bt(n,rl,e,t)};var _l={isMounted:function(e){return(e=e._reactInternals)?u(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=li(),i=Te(r);i.payload=t,n!=null&&(i.callback=n),t=Ee(e,i,r),t!==null&&(di(t,e,r),De(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=li(),i=Te(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ee(e,i,r),t!==null&&(di(t,e,r),De(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=li(),r=Te(n);r.tag=2,t!=null&&(r.callback=t),t=Ee(e,r,n),t!==null&&(di(t,e,n),De(t,e,n))}},vl=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},yl=Error(r(461)),bl=!1,xl={dehydrated:null,treeContext:null,retryLane:0},Sl=g(null),Cl=null,wl=null,Tl=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},El=la.unstable_scheduleCallback,Dl=la.unstable_NormalPriority,Ol={$$typeof:ya,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},kl=ka.S;ka.S=function(e,t){typeof t==`object`&&t&&typeof t.then==`function`&&be(e,t),kl!==null&&kl(e,t)};var Al=g(null),jl=!1,Ml=!1,Nl=!1,Pl=typeof WeakSet==`function`?WeakSet:Set,Fl=null,Il=!1,Ll=null,Rl=!1,zl=null,Bl=8192,Vl={getCacheForType:function(e){var t=Yn(Ol),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},Hl=0,Ul=1,Wl=2,Gl=3,Kl=4;if(typeof Symbol==`function`&&Symbol.for){var ql=Symbol.for;Hl=ql(`selector.component`),Ul=ql(`selector.has_pseudo_class`),Wl=ql(`selector.role`),Gl=ql(`selector.test_id`),Kl=ql(`selector.text`)}var Jl=typeof WeakMap==`function`?WeakMap:Map,Yl=0,q=null,Xl=null,Zl=0,Ql=0,$l=null,eu=!1,tu=!1,nu=!1,ru=0,iu=0,au=0,ou=0,su=0,cu=0,lu=0,uu=null,du=null,fu=!1,pu=0,mu=1/0,hu=null,gu=null,_u=!1,vu=null,yu=0,bu=0,xu=null,Su=0,Cu=null;return sa.attemptContinuousHydration=function(e){if(e.tag===13){var t=B(e,67108864);t!==null&&di(t,e,67108864),oa(e,67108864)}},sa.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13){var t=li(),n=B(e,t);n!==null&&di(n,e,t),oa(e,t)}},sa.attemptSynchronousHydration=function(e){switch(e.tag){case 3:if(e=e.stateNode,e.current.memoizedState.isDehydrated){var t=b(e.pendingLanes);if(t!==0){for(e.pendingLanes|=2,e.entangledLanes|=2;t;){var n=1<<31-Vs(t);e.entanglements[1]|=n,t&=~n}he(e),!(Yl&6)&&(mu=Xs()+500,V(0,!1))}}break;case 13:t=B(e,2),t!==null&&di(t,e,2),_i(),oa(e,2)}},sa.batchedUpdates=function(e,t){return e(t)},sa.createComponentSelector=function(e){return{$$typeof:Hl,value:e}},sa.createContainer=function(e,t,n,r,i,a,o,s,c,l){return ta(e,t,!1,null,n,r,a,o,s,c,l,null)},sa.createHasPseudoClassSelector=function(e){return{$$typeof:Ul,value:e}},sa.createHydrationContainer=function(e,t,n,r,i,a,o,s,c,l,u,d,f){return e=ta(n,r,!0,e,i,a,s,c,l,u,d,f),e.context=na(null),n=e.current,r=li(),i=Te(r),i.callback=t??null,Ee(n,i,r),e.current.lanes=r,D(e,r),he(e),e},sa.createPortal=function(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pa,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}},sa.createRoleSelector=function(e){return{$$typeof:Wl,value:e}},sa.createTestNameSelector=function(e){return{$$typeof:Gl,value:e}},sa.createTextSelector=function(e){return{$$typeof:Kl,value:e}},sa.defaultOnCaughtError=function(e){console.error(e)},sa.defaultOnRecoverableError=function(e){vl(e)},sa.defaultOnUncaughtError=function(e){vl(e)},sa.deferredUpdates=function(e){var t=ka.T,n=ro();try{return no(32),ka.T=null,e()}finally{no(n),ka.T=t}},sa.discreteUpdates=function(e,t,n,r,i){var a=ka.T,o=ro();try{return no(2),ka.T=null,e(t,n,r,i)}finally{no(o),ka.T=a,Yl===0&&(mu=Xs()+500)}},sa.findAllNodes=ci,sa.findBoundingRects=function(e,t){if(!vo)throw Error(r(363));t=ci(e,t),e=[];for(var n=0;n<t.length;n++)e.push(bo(t[n]));for(t=e.length-1;0<t;t--){n=e[t];for(var i=n.x,a=i+n.width,o=n.y,s=o+n.height,c=t-1;0<=c;c--)if(t!==c){var l=e[c],u=l.x,d=u+l.width,f=l.y,p=f+l.height;if(i>=u&&o>=f&&a<=d&&s<=p){e.splice(t,1);break}else if(i!==u||n.width!==l.width||p<o||f>s){if(!(o!==f||n.height!==l.height||d<i||u>a)){u>i&&(l.width+=u-i,l.x=i),d<a&&(l.width=a-u),e.splice(t,1);break}}else{f>o&&(l.height+=f-o,l.y=o),p<s&&(l.height=s-f),e.splice(t,1);break}}}return e},sa.findHostInstance=ra,sa.findHostInstanceWithNoPortals=function(e){return e=f(e),e=e===null?null:m(e),e===null?null:La(e.stateNode)},sa.findHostInstanceWithWarning=function(e){return ra(e)},sa.flushPassiveEffects=Ii,sa.flushSyncFromReconciler=function(e){var t=Yl;Yl|=1;var n=ka.T,r=ro();try{if(no(2),ka.T=null,e)return e()}finally{no(r),ka.T=n,Yl=t,!(Yl&6)&&V(0,!1)}},sa.flushSyncWork=_i,sa.focusWithin=function(e,t){if(!vo)throw Error(r(363));for(e=ii(e),t=si(e,t),t=Array.from(t),e=0;e<t.length;){var n=t[e++],i=n.tag;if(!So(n)){if((i===5||i===26||i===27)&&wo(n.stateNode))return!0;for(n=n.child;n!==null;)t.push(n),n=n.sibling}}return!1},sa.getFindAllNodesFailureDescription=function(e,t){if(!vo)throw Error(r(363));var n=0,i=[];e=[ii(e),0];for(var a=0;a<e.length;){var o=e[a++],s=o.tag,c=e[a++],l=t[c];if((s!==5&&s!==26&&s!==27||!So(o))&&(ai(o,l)&&(i.push(oi(l)),c++,c>n&&(n=c)),c<t.length))for(o=o.child;o!==null;)e.push(o,c),o=o.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(oi(t[n]));return`findAllNodes was able to match part of the selector: 4404 `+(i.join(` > `)+` 4405 4406No matching component was found for: 4407 `)+e.join(` > `)}return null},sa.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 27:case 5:return La(e.child.stateNode);default:return e.child.stateNode}},sa.injectIntoDevTools=function(){var e={bundleType:0,version:Pa,rendererPackageName:Fa,currentDispatcherRef:ka,findFiberByHostInstance:eo,reconcilerVersion:`19.0.0`};if(Ia!==null&&(e.rendererConfig=Ia),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;
4407if(t.isDisabled||!t.supportsFiber)e=!0;else{try{rc=t.inject(e),ic=t}catch{}e=!!t.checkDCE}}return e},sa.isAlreadyRendering=function(){return!1},sa.observeVisibleRects=function(e,t,n,i){if(!vo)throw Error(r(363));e=ci(e,t);var a=To(e,n,i).disconnect;return{disconnect:function(){a()}}},sa.shouldError=function(){return null},sa.shouldSuspend=function(){return!1},sa.startHostTransition=function(e,t,i,a){if(e.tag!==5)throw Error(r(476));var o=Yt(e).queue;Jt(e,o,t,po,i===null?n:function(){var t=Yt(e).next.queue;return nn(e,t,{},li()),i(a)})},sa.updateContainer=function(e,t,n,r){var i=t.current,a=li();return ia(i,a,e,t,n,r),a},sa.updateContainerSync=function(e,t,n,r){return t.tag===0&&Ii(),ia(t.current,2,e,t,n,r),2},sa},t.exports.default=t.exports,Object.defineProperty(t.exports,`__esModule`,{value:!0})})),VO=s(((e,t)=>{t.exports=BO()})),HO=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,A();else{var t=n(l);t!==null&&j(b,t.startTime-e)}}var x=!1,S=-1,C=5,w=-1;function T(){return!(e.unstable_now()-w<C)}function E(){if(x){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,_(S),S=-1),p=!0;var a=f;try{b:{for(y(t),d=n(c);d!==null&&!(d.expirationTime>t&&T());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,y(t),i=!0;break b}d===n(c)&&r(c),y(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(b,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():x=!1}}}var D;if(typeof v==`function`)D=function(){v(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){g(E,0)};function A(){x||(x=!0,D())}function j(t,n){S=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,A())},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(S),S=-1):h=!0,j(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,A())),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),UO=s(((e,t)=>{t.exports=HO()})),WO=UO(),GO=u(VO());(()=>typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`))()?S.useLayoutEffect:S.useEffect;function KO(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){let e=KO(r,t,n);if(e)return e;r=t?null:r.sibling}}function qO(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}var JO=qO(S.createContext(null)),YO=class extends S.Component{render(){return S.createElement(JO.Provider,{value:this._reactInternals},this.props.children)}};function XO(){let e=S.useContext(JO);if(e===null)throw Error(`its-fine: useFiber must be called within a <FiberProvider />!`);let t=S.useId();return S.useMemo(()=>{for(let n of[e,e?.alternate]){if(!n)continue;let e=KO(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}var ZO=Symbol.for(`react.context`),QO=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ZO;function $O(){let e=XO(),[t]=S.useState(()=>new Map);t.clear();let n=e;for(;n;){let e=n.type;QO(e)&&e!==JO&&!t.has(e)&&t.set(e,S.use(qO(e))),n=n.return}return t}function ek(){let e=$O();return S.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>S.createElement(t,null,S.createElement(n.Provider,{...r,value:e.get(n)})),e=>S.createElement(YO,{...e})),[e])}function tk(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}S.act;
4407var nk=e=>e&&e.isOrthographicCamera,rk=e=>e&&e.hasOwnProperty(`current`),ik=e=>e!=null&&(typeof e==`string`||typeof e==`number`||e.isColor),ak=((e,t)=>typeof window<`u`&&((e=window.document)?.createElement||(t=window.navigator)?.product===`ReactNative`))()?S.useLayoutEffect:S.useEffect;function ok(e){let t=S.useRef(e);return ak(()=>void(t.current=e),[e]),t}function sk(){let e=XO(),t=ek();return S.useMemo(()=>({children:n})=>(0,K.jsx)(KO(e,!0,e=>e.type===S.StrictMode)?S.StrictMode:S.Fragment,{children:(0,K.jsx)(t,{children:n})}),[e,t])}function ck({set:e}){return ak(()=>(e(new Promise(()=>null)),()=>e(!1)),[e]),null}var lk=(e=>(e=class extends S.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}},e.getDerivedStateFromError=()=>({error:!0}),e))();function uk(e){let t=typeof window<`u`?window.devicePixelRatio??2:1;return Array.isArray(e)?Math.min(Math.max(e[0],t),e[1]):e}function dk(e){return e.__r3f?.root.getState()}var fk={obj:e=>e===Object(e)&&!fk.arr(e)&&typeof e!=`function`,fun:e=>typeof e==`function`,str:e=>typeof e==`string`,num:e=>typeof e==`number`,boo:e=>typeof e==`boolean`,und:e=>e===void 0,nul:e=>e===null,arr:e=>Array.isArray(e),equ(e,t,{arrays:n=`shallow`,objects:r=`reference`,strict:i=!0}={}){if(typeof e!=typeof t||!!e!=!!t)return!1;if(fk.str(e)||fk.num(e)||fk.boo(e))return e===t;let a=fk.obj(e);if(a&&r===`reference`)return e===t;let o=fk.arr(e);if(o&&n===`reference`)return e===t;if((o||a)&&e===t)return!0;let s;for(s in e)if(!(s in t))return!1;if(a&&n===`shallow`&&r===`shallow`){for(s in i?t:e)if(!fk.equ(e[s],t[s],{strict:i,objects:`reference`}))return!1}else for(s in i?t:e)if(e[s]!==t[s])return!1;if(fk.und(s)){if(o&&e.length===0&&t.length===0||a&&Object.keys(e).length===0&&Object.keys(t).length===0)return!0;if(e!==t)return!1}return!0}};function pk(e){let t={nodes:{},materials:{},meshes:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material),e.isMesh&&!t.meshes[e.name]&&(t.meshes[e.name]=e)}),t}function mk(e){for(let t in e.type!==`Scene`&&(e.dispose==null||e.dispose()),e){let n=e[t];n?.type!==`Scene`&&(n==null||n.dispose==null||n.dispose())}}var hk=[`children`,`key`,`ref`];function gk(e){let t={};for(let n in e)hk.includes(n)||(t[n]=e[n]);return t}function _k(e,t,n,r){let i=e,a=i?.__r3f;return a||(a={root:t,type:n,parent:null,children:[],props:gk(r),object:i,eventCount:0,handlers:{},isHidden:!1},i&&(i.__r3f=a)),a}function vk(e,t){if(!t.includes(`-`)||t in e)return{root:e,key:t,target:e[t]};let n=e,r=t.split(`-`);for(let i of r){if(typeof n!=`object`||!n){if(n!==void 0){let e=r.slice(r.indexOf(i)).join(`-`);return{root:n,key:e,target:void 0}}return{root:e,key:t,target:void 0}}t=i,e=n,n=n[t]}return{root:e,key:t,target:n}}var yk=/-\d+$/;function bk(e,t){if(fk.str(t.props.attach)){if(yk.test(t.props.attach)){let n=t.props.attach.replace(yk,``),{root:r,key:i}=vk(e.object,n);Array.isArray(r[i])||(r[i]=[])}let{root:n,key:r}=vk(e.object,t.props.attach);t.previousAttach=n[r],n[r]=t.object}else fk.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function xk(e,t){if(fk.str(t.props.attach)){let{root:n,key:r}=vk(e.object,t.props.attach),i=t.previousAttach;i===void 0?delete n[r]:n[r]=i}else t.previousAttach==null||t.previousAttach(e.object,t.object);delete t.previousAttach}var Sk=[...hk,`args`,`dispose`,`attach`,`object`,`onUpdate`,`dispose`],Ck=new Map;function wk(e){let t=Ck.get(e.constructor);try{t||(t=new e.constructor,Ck.set(e.constructor,t))}catch{}return t}function Tk(e,t){let n={};for(let r in t)if(!Sk.includes(r)&&!fk.equ(t[r],e.props[r]))for(let e in n[r]=t[r],t)e.startsWith(`${r}-`)&&(n[e]=t[e]);for(let r in e.props){if(Sk.includes(r)||t.hasOwnProperty(r))continue;let{root:i,key:a}=vk(e.object,r);if(i.constructor&&i.constructor.length===0){let e=wk(i);fk.und(e)||(n[a]=e[a])}else n[a]=0}return n}var Ek=[`map`,`emissiveMap`,`sheenColorMap`,`specularColorMap`,`envMap`],Dk=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function Ok(e,t){var n;let r=e.__r3f,i=r&&tk(r).getState(),a=r?.eventCount;for(let n in t){let a=t[n];if(Sk.includes(n))continue;if(r&&Dk.test(n)){typeof a==`function`?r.handlers[n]=a:delete r.handlers[n],r.eventCount=Object.keys(r.handlers).length;continue}if(a===void 0)continue;let{root:s,key:c,target:l}=vk(e,n);if(l===void 0&&(typeof s!=`object`||!s))throw Error(`R3F: Cannot set "${n}". Ensure it is an object before setting "${c}".`);if(l instanceof ig&&a instanceof ig)l.mask=a.mask;else if(l instanceof Z&&ik(a))l.set(a);else if(typeof l==`object`&&l&&typeof l.set==`function`&&typeof l.copy==`function`&&a!=null&&a.constructor&&l.constructor===a.constructor)l.copy(a);else if(typeof l==`object`&&l&&typeof l.set==`function`&&Array.isArray(a))typeof l.fromArray==`function`?l.fromArray(a):l.set(...a);else if(typeof l==`object`&&l&&typeof l.set==`function`&&typeof a==`number`)typeof l.setScalar==`function`?l.setScalar(a):l.set(a);else{var o;s[c]=a,i&&!i.linear&&Ek.includes(c)&&(o=s[c])!=null&&o.isTexture&&s[c].format===1023&&s[c].type===1009&&(s[c].colorSpace
4407=Pp)}}if(r!=null&&r.parent&&i!=null&&i.internal&&(n=r.object)!=null&&n.isObject3D&&a!==r.eventCount){let e=r.object,t=i.internal.interaction.indexOf(e);t>-1&&i.internal.interaction.splice(t,1),r.eventCount&&e.raycast!==null&&i.internal.interaction.push(e)}return r&&r.props.attach===void 0&&(r.object.isBufferGeometry?r.props.attach=`geometry`:r.object.isMaterial&&(r.props.attach=`material`)),r&&kk(r),e}function kk(e){var t;if(!e.parent)return;e.props.onUpdate==null||e.props.onUpdate(e.object);let n=(t=e.root)==null||t.getState==null?void 0:t.getState();n&&n.internal.frames===0&&n.invalidate()}function Ak(e,t){e.manual||(nk(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix())}var jk=e=>e?.isObject3D;function Mk(e){return(e.eventObject||e.object).uuid+`/`+e.index+e.instanceId}function Nk(e,t,n,r){let i=n.get(t);i&&(n.delete(t),n.size===0&&(e.delete(r),i.target.releasePointerCapture(r)))}function Pk(e,t){let{internal:n}=e.getState();n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,r)=>{(e.eventObject===t||e.object===t)&&n.hovered.delete(r)}),n.capturedMap.forEach((e,r)=>{Nk(n.capturedMap,t,e,r)})}function Fk(e){function t(t){let{internal:n}=e.getState(),r=t.offsetX-n.initialClick[0],i=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(r*r+i*i))}function n(e){return e.filter(e=>[`Move`,`Over`,`Enter`,`Out`,`Leave`].some(t=>e.__r3f?.handlers[`onPointer`+t]))}function r(t,n){let r=e.getState(),i=new Set,a=[],o=n?n(r.internal.interaction):r.internal.interaction;for(let e=0;e<o.length;e++){let t=dk(o[e]);t&&(t.raycaster.camera=void 0)}r.previousRoot||r.events.compute==null||r.events.compute(t,r);function s(e){let n=dk(e);return!n||!n.events.enabled||n.raycaster.camera===null?[]:(n.raycaster.camera===void 0&&(n.events.compute==null||n.events.compute(t,n,n.previousRoot?.getState()),n.raycaster.camera===void 0&&(n.raycaster.camera=null)),n.raycaster.camera?n.raycaster.intersectObject(e,!0):[])}let c=o.flatMap(s).sort((e,t)=>{let n=dk(e.object),r=dk(t.object);return!n||!r?e.distance-t.distance:r.events.priority-n.events.priority||e.distance-t.distance}).filter(e=>{let t=Mk(e);return i.has(t)?!1:(i.add(t),!0)});r.events.filter&&(c=r.events.filter(c,r));for(let e of c){let t=e.object;for(;t;){var l;(l=t.__r3f)!=null&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if(`pointerId`in t&&r.internal.capturedMap.has(t.pointerId))for(let e of r.internal.capturedMap.get(t.pointerId).values())i.has(Mk(e.intersection))||a.push(e.intersection);return a}function i(e,t,n,r){if(e.length){let i={stopped:!1};for(let o of e){let s=dk(o.object);if(s||o.object.traverseAncestors(e=>{let t=dk(e);if(t)return s=t,!1}),s){let{raycaster:c,pointer:l,camera:u,internal:d}=s,f=new X(l.x,l.y,0).unproject(u),p=e=>d.capturedMap.get(e)?.has(o.eventObject)??!1,m=e=>{let n={intersection:o,target:t.target};d.capturedMap.has(e)?d.capturedMap.get(e).set(o.eventObject,n):d.capturedMap.set(e,new Map([[o.eventObject,n]])),t.target.setPointerCapture(e)},h=e=>{let t=d.capturedMap.get(e);t&&Nk(d.capturedMap,o.eventObject,t,e)},g={};for(let e in t){let n=t[e];typeof n!=`function`&&(g[e]=n)}let _={...o,...g,pointer:l,intersections:e,stopped:i.stopped,delta:n,unprojectedPoint:f,ray:c.ray,camera:u,stopPropagation(){let n=`pointerId`in t&&d.capturedMap.get(t.pointerId);(!n||n.has(o.eventObject))&&(_.stopped=i.stopped=!0,d.hovered.size&&Array.from(d.hovered.values()).find(e=>e.eventObject===o.eventObject)&&a([...e.slice(0,e.indexOf(o)),o]))},target:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:h},currentTarget:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:h},nativeEvent:t};if(r(_),i.stopped===!0)break}}}return e}function a(t){let{internal:n}=e.getState();for(let e of n.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let r=e.eventObject.__r3f;if(n.hovered.delete(Mk(e)),r!=null&&r.eventCount){let n=r.handlers,i={...e,intersections:t};n.onPointerOut==null||n.onPointerOut(i),n.onPointerLeave==null||n.onPointerLeave(i)}}}function o(e,t){for(let n=0;n<t.length;n++){let r=t[n].__r3f;r==null||r.handlers.onPointerMissed==null||r.handlers.onPointerMissed(e)}}function s(s){switch(s){case`onPointerLeave`:case`onPointerCancel`:return()=>a([]);case`onLostPointerCapture`:return t=>{let{internal:n}=e.getState();`pointerId`in t&&n.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{n.capturedMap.has(t.pointerId)&&(n.capturedMap.delete(t.pointerId),a([]))})}}return function(c){let{onPointerMissed:l,internal:u}=e.getState();u.lastEvent.current=c;let d=s===`onPointerMove`,f=s===`onClick`||s===`onContextMenu`||s===`onDoubleClick`,p=r(c,d?n:void 0),m=f?t(c):0;s===`onPointerDown`&&(u.initialClick=[c.offsetX,c.offsetY],u.initialHits=p.map(e=>e.eventObject)),f&&!p.length&&m<=2&&(o(c,u.interaction),l&&l(c)),d&&a(p);function h(e){let t=e.eventObject,n=t.__r3f;if(!(n!=null&&n.eventCount))return;let r=n.handlers;if(d){if(r.onPointerOver||r.onPointerEnter||r.onPointerOut||r.onPointerLeave){let t=Mk(e),n=u.hovered.get(t);n?n.stopped&&e.stopPropagation():(u.hovered.set(t,e),r.onPointerOver==null||r.onPointerOver(e),r.onPointerEnter==null||r.onPointerEnter(e))}r.onPointerMove==null||r.onPointerMove(e)}else{let n=r[s];n?(!f||u.initialHits.includes(t))&&(o(c,u.interaction.filter(e=>!u.initialHits.includes(e))),n(e)):f&&u.initialHits.includes(t)&&o(c,u.interaction.filter(e=>!u.initialHits.includes(e)))}}i(p,c,m,h)}}return{handlePointer:s}}var Ik=e=>
4407!!(e!=null&&e.render),Lk=S.createContext(null),Rk=(e,t)=>{let n=AO((n,r)=>{let i=new X,a=new X,o=new X;function s(e=r().camera,t=a,n=r().size){let{width:s,height:c,top:l,left:u}=n,d=s/c;t.isVector3?o.copy(t):o.set(...t);let f=e.getWorldPosition(i).distanceTo(o);if(nk(e))return{width:s/e.zoom,height:c/e.zoom,top:l,left:u,factor:1,distance:f,aspect:d};{let t=e.fov*Math.PI/180,n=2*Math.tan(t/2)*f,r=n*(s/c);return{width:r,height:n,top:l,left:u,factor:s/r,distance:f,aspect:d}}}let c,l=e=>n(t=>({performance:{...t.performance,current:e}})),u=new Y;return{set:n,get:r,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(t=1)=>e(r(),t),advance:(e,n)=>t(e,n,r()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new hC,pointer:u,mouse:u,frameloop:`always`,onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=r();c&&clearTimeout(c),e.performance.current!==e.performance.min&&l(e.performance.min),c=setTimeout(()=>l(r().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:s},setEvents:e=>n(t=>({...t,events:{...t.events,...e}})),setSize:(e,t,i=0,o=0)=>{let c=r().camera,l={width:e,height:t,top:i,left:o};n(e=>({size:l,viewport:{...e.viewport,...s(c,a,l)}}))},setDpr:e=>n(t=>{let n=uk(e);return{viewport:{...t.viewport,dpr:n,initialDpr:t.viewport.initialDpr||n}}}),setFrameloop:(e=`always`)=>{let t=r().clock;t.stop(),t.elapsedTime=0,e!==`never`&&(t.start(),t.elapsedTime=0),n(()=>({frameloop:e}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:S.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,n)=>{let i=r().internal;return i.priority+=t>0?1:0,i.subscribers.push({ref:e,priority:t,store:n}),i.subscribers=i.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=r().internal;n!=null&&n.subscribers&&(n.priority-=t>0?1:0,n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}}),r=n.getState(),i=r.size,a=r.viewport.dpr,o=r.camera;return n.subscribe(()=>{let{camera:e,size:t,viewport:r,gl:s,set:c}=n.getState();if(t.width!==i.width||t.height!==i.height||r.dpr!==a){i=t,a=r.dpr,Ak(e,t),r.dpr>0&&s.setPixelRatio(r.dpr);let n=typeof HTMLCanvasElement<`u`&&s.domElement instanceof HTMLCanvasElement;s.setSize(t.width,t.height,n)}e!==o&&(o=e,c(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),n.subscribe(t=>e(t)),n};function zk(){let e=S.useContext(Lk);if(!e)throw Error(`R3F: Hooks can only be used within the Canvas component!`);return e}function Bk(e=e=>e,t){return zk()(e,t)}function Vk(e,t=0){let n=zk(),r=n.getState().internal.subscribe,i=ok(e);return ak(()=>r(i,t,n),[t,r,n]),null}var Hk=new WeakMap,Uk=e=>typeof e==`function`&&e?.prototype?.constructor===e;function Wk(e,t){return function(n,...r){let i;return Uk(n)?(i=Hk.get(n),i||(i=new n,Hk.set(n,i))):i=n,e&&e(i),Promise.all(r.map(e=>new Promise((n,r)=>i.load(e,e=>{jk(e?.scene)&&Object.assign(e,pk(e.scene)),n(e)},t,t=>r(Error(`Could not load ${e}: ${t?.message}`))))))}}function Gk(e,t,n,r){let i=Array.isArray(t)?t:[t],a=FO(Wk(n,r),[e,...i],{equal:fk.equ});return Array.isArray(t)?a:a[0]}Gk.preload=function(e,t,n){let r=Array.isArray(t)?t:[t];return IO(Wk(n),[e,...r])},Gk.clear=function(e,t){return LO([e,...Array.isArray(t)?t:[t]])};var Kk={name:`@react-three/fiber`,version:`9.4.2`,description:`A React renderer for Threejs`,keywords:[`react`,`renderer`,`fiber`,`three`,`threejs`],author:`Paul Henschel (https://github.com/drcmda)`,license:`MIT`,maintainers:[`Josh Ellis (https://github.com/joshuaellis)`,`Cody Bennett (https://github.com/codyjasonbennett)`,`Kris Baumgarter (https://github.com/krispya)`],bugs:{url:`https://github.com/pmndrs/react-three-fiber/issues`},homepage:`https://github.com/pmndrs/react-three-fiber#readme`,repository:{type:`git`,url:`git+https://github.com/pmndrs/react-three-fiber.git`},collective:{type:`opencollective`,url:`https://opencollective.com/react-three-fiber`},main:`dist/react-three-fiber.cjs.js`,module:`dist/react-three-fiber.esm.js`,types:`dist/react-three-fiber.cjs.d.ts`,"react-native":`native/dist/react-three-fiber-native.cjs.js`,sideEffects:!1,prec
4407onstruct:{entrypoints:[`index.tsx`,`native.tsx`]},scripts:{prebuild:`cp ../../readme.md readme.md`},dependencies:{"@babel/runtime":`^7.17.8`,"@types/react-reconciler":`^0.32.0`,"@types/webxr":`*`,"base64-js":`^1.5.1`,buffer:`^6.0.3`,"its-fine":`^2.0.0`,"react-reconciler":`^0.31.0`,"react-use-measure":`^2.1.7`,scheduler:`^0.25.0`,"suspend-react":`^0.1.3`,"use-sync-external-store":`^1.4.0`,zustand:`^5.0.3`},peerDependencies:{expo:`>=43.0`,"expo-asset":`>=8.4`,"expo-file-system":`>=11.0`,"expo-gl":`>=11.0`,react:`^19.0.0`,"react-dom":`^19.0.0`,"react-native":`>=0.78`,three:`>=0.156`},peerDependenciesMeta:{"react-dom":{optional:!0},"react-native":{optional:!0},expo:{optional:!0},"expo-asset":{optional:!0},"expo-file-system":{optional:!0},"expo-gl":{optional:!0}}};function qk(e){let t=(0,GO.default)(e);return t.injectIntoDevTools(),t}var Jk=0,Yk={},Xk=/^three(?=[A-Z])/,Zk=e=>`${e[0].toUpperCase()}${e.slice(1)}`,Qk=0,$k=e=>typeof e==`function`;function eA(e){if($k(e)){let t=`${Qk++}`;return Yk[t]=e,t}else Object.assign(Yk,e)}function tA(e,t){let n=Zk(e),r=Yk[n];if(e!==`primitive`&&!r)throw Error(`R3F: ${n} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(e===`primitive`&&!t.object)throw Error(`R3F: Primitives without 'object' are invalid!`);if(t.args!==void 0&&!Array.isArray(t.args))throw Error(`R3F: The args prop must be an array!`)}function nA(e,t,n){var r;return e=Zk(e)in Yk?e:e.replace(Xk,``),tA(e,t),e===`primitive`&&(r=t.object)!=null&&r.__r3f&&delete t.object.__r3f,_k(t.object,n,e,t)}function rA(e){if(!e.isHidden){var t;e.props.attach&&(t=e.parent)!=null&&t.object?xk(e.parent,e):jk(e.object)&&(e.object.visible=!1),e.isHidden=!0,kk(e)}}function iA(e){if(e.isHidden){var t;e.props.attach&&(t=e.parent)!=null&&t.object?bk(e.parent,e):jk(e.object)&&e.props.visible!==!1&&(e.object.visible=!0),e.isHidden=!1,kk(e)}}function aA(e,t,n){let r=t.root.getState();if(!(!e.parent&&e.object!==r.scene)){if(!t.object){let e=Yk[Zk(t.type)];t.object=t.props.object??new e(...t.props.args??[]),t.object.__r3f=t}if(Ok(t.object,t.props),t.props.attach)bk(e,t);else if(jk(t.object)&&jk(e.object)){let r=e.object.children.indexOf(n?.object);if(n&&r!==-1){let n=e.object.children.indexOf(t.object);if(n!==-1){e.object.children.splice(n,1);let i=n<r?r-1:r;e.object.children.splice(i,0,t.object)}else t.object.parent=e.object,e.object.children.splice(r,0,t.object),t.object.dispatchEvent({type:`added`}),e.object.dispatchEvent({type:`childadded`,child:t.object})}else e.object.add(t.object)}for(let e of t.children)aA(t,e);kk(t)}}function oA(e,t){t&&(t.parent=e,e.children.push(t),aA(e,t))}function sA(e,t,n){if(!t||!n)return;t.parent=e;let r=e.children.indexOf(n);r===-1?e.children.push(t):e.children.splice(r,0,t),aA(e,t,n)}function cA(e){if(typeof e.dispose==`function`){let t=()=>{try{e.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<`u`?t():(0,WO.unstable_scheduleCallback)(WO.unstable_IdlePriority,t)}}function lA(e,t,n){if(!t)return;t.parent=null;let r=e.children.indexOf(t);r!==-1&&e.children.splice(r,1),t.props.attach?xk(e,t):jk(t.object)&&jk(e.object)&&(e.object.remove(t.object),Pk(tk(t),t.object));let i=t.props.dispose!==null&&n!==!1;for(let e=t.children.length-1;e>=0;e--){let n=t.children[e];lA(t,n,i)}t.children.length=0,delete t.object.__r3f,i&&t.type!==`primitive`&&t.object.type!==`Scene`&&cA(t.object),n===void 0&&kk(t)}function uA(e,t){for(let n of[e,e.alternate])if(n!==null)if(typeof n.ref==`function`){n.refCleanup==null||n.refCleanup();let e=n.ref(t);typeof e==`function`&&(n.refCleanup=e)}else n.ref&&(n.ref.current=t)}var dA=[];function fA(){for(let[e]of dA){let t=e.parent;if(t){e.props.attach?xk(t,e):jk(e.object)&&jk(t.object)&&t.object.remove(e.object);for(let t of e.children)t.props.attach?xk(e,t):jk(t.object)&&jk(e.object)&&e.object.remove(t.object)}e.isHidden&&iA(e),e.object.__r3f&&delete e.object.__r3f,e.type!==`primitive`&&cA(e.object)}for(let[e,t,n]of dA){e.props=t;let r=e.parent;if(r){let t=Yk[Zk(e.type)];e.object=e.props.object??new t(...e.props.args??[]),e.object.__r3f=e,uA(n,e.object),Ok(e.object,e.props),e.props.attach?bk(r,e):jk(e.object)&&jk(r.object)&&r.object.add(e.object);for(let t of e.children)t.props.attach?bk(e,t):jk(t.object)&&jk(e.object)&&e.object.add(t.object);kk(e)}}dA.length=0}var pA=()=>{},mA={},hA=Jk,gA=0,_A=4,vA=qk({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:nA,removeChild:lA,appendChild:oA,appendInitialChild:oA,insertBefore:sA,appendChildToContainer(e,t){let n=e.getState().scene.__r3f;!t||!n||oA(n,t)},removeChildFromContainer(e,t){let n=e.getState().scene.__r3f;!t||!n||lA(n,t)},insertInContainerBefore(e,t,n){let r=e.getState().scene.__r3f;!t||!n||!r||sA(r,t,n)},getRootHostContext:()=>mA,getChildHostContext:()=>mA,commitUpdate(e,t,n,r,i){var a;tA(t,r);let o=!1;if(e.type===`primitive`&&n.object!==r.object?o=!0:r.args?.length===n.args?.length?(a=r.args)!=null&&a.some((e,t)=>e!==n.args?.[t])&&(o=!0):o=!0,o)dA.push([e,{...r},i]);else{let t=Tk(e,r);Object.keys(t).length&&(Object.assign(e.props,t),Ok(e.object,t))}(i.sibling===null||(i.flags&_A)===gA)&&fA()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>e?.object,prepareForCommit:()=>null,preparePortalMount:e=>_k(e.getState().scene,e,``,{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:rA,unhideInstance:iA,createTextInstance:pA,hideTextInstance:pA,unhideTextInstance:pA,scheduleTimeout:typeof setTimeout==`function`?setTimeout:void 0,cancelTimeout:typeof clearTimeout==`function`?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){}
4407,prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:S.createContext(null),setCurrentUpdatePriority(e){hA=e},getCurrentUpdatePriority(){return hA},resolveUpdatePriority(){if(hA!==Jk)return hA;switch(typeof window<`u`&&window.event?.type){case`click`:case`contextmenu`:case`dblclick`:case`pointercancel`:case`pointerdown`:case`pointerup`:return Jd.DiscreteEventPriority;case`pointermove`:case`pointerout`:case`pointerover`:case`pointerenter`:case`pointerleave`:case`wheel`:return Jd.ContinuousEventPriority;default:return Jd.DefaultEventPriority}},resetFormInstance(){},rendererPackageName:`@react-three/fiber`,rendererVersion:Kk.version}),yA=new Map,bA={objects:`shallow`,strict:!1};function xA(e,t){if(!t&&typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:n,top:r,left:i}=e.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:i}}else if(!t&&typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...t}}function SA(e){let t=yA.get(e),n=t?.fiber,r=t?.store;t&&console.warn(`R3F.createRoot should only be called once!`);let i=typeof reportError==`function`?reportError:console.error,a=r||Rk(VA,HA),o=n||vA.createContainer(a,1,null,!1,null,``,i,i,i,null);t||yA.set(e,{fiber:o,store:a});let s,c,l=!1,u=null;return{async configure(t={}){let n;u=new Promise(e=>n=e);let{gl:r,size:i,scene:o,events:d,onCreated:f,shadows:p=!1,linear:m=!1,flat:h=!1,legacy:g=!1,orthographic:_=!1,frameloop:v=`always`,dpr:y=[1,2],performance:b,raycaster:x,camera:S,onPointerMissed:C}=t,w=a.getState(),T=w.gl;if(!w.gl){let t={canvas:e,powerPreference:`high-performance`,antialias:!0,alpha:!0},n=typeof r==`function`?await r(t):r;T=Ik(n)?n:new yO({...t,...r}),w.set({gl:T})}let E=w.raycaster;E||w.set({raycaster:E=new $C});let{params:D,...O}=x||{};if(fk.equ(O,E,bA)||Ok(E,{...O}),fk.equ(D,E.params,bA)||Ok(E,{params:{...E.params,...D}}),!w.camera||w.camera===c&&!fk.equ(c,S,bA)){c=S;let e=S?.isCamera,t=e?S:_?new WS(0,0,0,0,.1,1e3):new V_(75,0,.1,1e3);e||(t.position.z=5,S&&(Ok(t,S),t.manual||(`aspect`in S||`left`in S||`right`in S||`bottom`in S||`top`in S)&&(t.manual=!0,t.updateProjectionMatrix())),!w.camera&&!(S!=null&&S.rotation)&&t.lookAt(0,0,0)),w.set({camera:t}),E.camera=t}if(!w.scene){let e;o!=null&&o.isScene?(e=o,_k(e,a,``,{})):(e=new Q_,_k(e,a,``,{}),o&&Ok(e,o)),w.set({scene:e})}d&&!w.events.handlers&&w.set({events:d(a)});let k=xA(e,i);if(fk.equ(k,w.size,bA)||w.setSize(k.width,k.height,k.top,k.left),y&&w.viewport.dpr!==uk(y)&&w.setDpr(y),w.frameloop!==v&&w.setFrameloop(v),w.onPointerMissed||w.set({onPointerMissed:C}),b&&!fk.equ(b,w.performance,bA)&&w.set(e=>({performance:{...e.performance,...b}})),!w.xr){let e=(e,t)=>{let n=a.getState();n.frameloop!==`never`&&HA(e,!0,n,t)},t=()=>{let t=a.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||VA(t)},n={connect(){let e=a.getState().gl;e.xr.addEventListener(`sessionstart`,t),e.xr.addEventListener(`sessionend`,t)},disconnect(){let e=a.getState().gl;e.xr.removeEventListener(`sessionstart`,t),e.xr.removeEventListener(`sessionend`,t)}};typeof T.xr?.addEventListener==`function`&&n.connect(),w.set({xr:n})}if(T.shadowMap){let e=T.shadowMap.enabled,t=T.shadowMap.type;if(T.shadowMap.enabled=!!p,fk.boo(p))T.shadowMap.type=2;else if(fk.str(p)){let e={basic:0,percentage:1,soft:2,variance:3};T.shadowMap.type=e[p]??2}else fk.obj(p)&&Object.assign(T.shadowMap,p);(e!==T.shadowMap.enabled||t!==T.shadowMap.type)&&(T.shadowMap.needsUpdate=!0)}return nh.enabled=!g,l||(T.outputColorSpace=m?Fp:Pp,T.toneMapping=h?0:4),w.legacy!==g&&w.set(()=>({legacy:g})),w.linear!==m&&w.set(()=>({linear:m})),w.flat!==h&&w.set(()=>({flat:h})),r&&!fk.fun(r)&&!Ik(r)&&!fk.equ(r,T,bA)&&Ok(T,r),s=f,l=!0,n(),this},render(t){return!l&&!u&&this.configure(),u.then(()=>{vA.updateContainer((0,K.jsx)(CA,{store:a,children:t,onCreated:s,rootElement:e}),o,null,()=>void 0)}),a},unmount(){wA(e)}}}function CA({store:e,children:t,onCreated:n,rootElement:r}){return ak(()=>{let t=e.getState();t.set(e=>({internal:{...e.internal,active:!0}})),n&&n(t),e.getState().events.connected||t.events.connect==null||t.events.connect(r)},[]),(0,K.jsx)(Lk.Provider,{value:e,children:t})}function wA(e,t){let n=yA.get(e),r=n?.fiber;if(r){let i=n?.store.getState();i&&(i.internal.active=!1),vA.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var n,r,a,o;i.events.disconnect==null||i.events.disconnect(),(n=i.gl)==null||(r=n.renderLists)==null||r.dispose==null||r.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(o=i.gl)!=null&&o.xr&&i.xr.disconnect(),mk(i.scene),yA.delete(e),t&&t(e)}catch{}},500)})}}function TA(e,t,n){return(0,K.jsx)(EA,{children:e,container:t,state:n})}function EA({state:e={},children:t,container:n}){let{events:r,size:i,...a}=e,o=zk(),[s]=S.useState(()=>new $C),[c]=S.useState(()=>new Y),l=ok((e,t)=>{let a;if(t.camera&&i){let n=t.camera;a=e.viewport.getCurrentViewport(n,new X,i),n!==e.camera&&Ak(n,i)}return{...e,...t,scene:n,raycaster:s,pointer:c,mouse:c,previousRoot:o,events:{...e.events,...t.events,...r},size:{...e.size,...i},viewport:{...e.viewport,...a},setEvents:e=>t.set(t=>({...t,events:{...t.events,...e}}))}}),u=S.useMemo(()=>{let e=AO((e,t)=>
4407({...a,set:e,get:t})),t=t=>e.setState(e=>l.current(t,e));return t(o.getState()),o.subscribe(t),e},[o,n]);return(0,K.jsx)(K.Fragment,{children:vA.createPortal((0,K.jsx)(Lk.Provider,{value:u,children:t}),u,null)})}var DA=new Set,OA=new Set,kA=new Set;function AA(e,t){if(e.size)for(let{callback:n}of e.values())n(t)}function jA(e,t){switch(e){case`before`:return AA(DA,t);case`after`:return AA(OA,t);case`tail`:return AA(kA,t)}}var MA,NA;function PA(e,t,n){let r=t.clock.getDelta();t.frameloop===`never`&&typeof e==`number`&&(r=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),MA=t.internal.subscribers;for(let e=0;e<MA.length;e++)NA=MA[e],NA.ref.current(NA.store.getState(),r,n);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),t.frameloop===`always`?1:t.internal.frames}var FA=!1,IA=!1,LA,RA,zA;function BA(e){RA=requestAnimationFrame(BA),FA=!0,LA=0,jA(`before`,e),IA=!0;for(let n of yA.values()){var t;zA=n.store.getState(),zA.internal.active&&(zA.frameloop===`always`||zA.internal.frames>0)&&!((t=zA.gl.xr)!=null&&t.isPresenting)&&(LA+=PA(e,zA))}if(IA=!1,jA(`after`,e),LA===0)return jA(`tail`,e),FA=!1,cancelAnimationFrame(RA)}function VA(e,t=1){var n;if(!e)return yA.forEach(e=>VA(e.store.getState(),t));(n=e.gl.xr)!=null&&n.isPresenting||!e.internal.active||e.frameloop===`never`||(t>1?e.internal.frames=Math.min(60,e.internal.frames+t):IA?e.internal.frames=2:e.internal.frames=1,FA||(FA=!0,requestAnimationFrame(BA)))}function HA(e,t=!0,n,r){if(t&&jA(`before`,e),n)PA(e,n,r);else for(let t of yA.values())PA(e,t.store.getState());t&&jA(`after`,e)}var UA={onClick:[`click`,!1],onContextMenu:[`contextmenu`,!1],onDoubleClick:[`dblclick`,!1],onWheel:[`wheel`,!0],onPointerDown:[`pointerdown`,!0],onPointerUp:[`pointerup`,!0],onPointerLeave:[`pointerleave`,!0],onPointerMove:[`pointermove`,!0],onPointerCancel:[`pointercancel`,!0],onLostPointerCapture:[`lostpointercapture`,!0]};function WA(e){let{handlePointer:t}=Fk(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-(e.offsetY/t.size.height)*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(UA).reduce((e,n)=>({...e,[n]:t(n)}),{}),update:()=>{var t;let{events:n,internal:r}=e.getState();(t=r.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{let{set:n,events:r}=e.getState();if(r.disconnect==null||r.disconnect(),n(e=>({events:{...e.events,connected:t}})),r.handlers)for(let e in r.handlers){let n=r.handlers[e],[i,a]=UA[e];t.addEventListener(i,n,{passive:a})}},disconnect:()=>{let{set:t,events:n}=e.getState();if(n.connected){if(n.handlers)for(let e in n.handlers){let t=n.handlers[e],[r]=UA[e];n.connected.removeEventListener(r,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}function GA(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function KA({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){let i=n||(typeof window>`u`?class{}:window.ResizeObserver);if(!i)throw Error(`This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills`);let[a,o]=(0,S.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),s=(0,S.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),c=e?typeof e==`number`?e:e.scroll:null,l=e?typeof e==`number`?e:e.resize:null,u=(0,S.useRef)(!1);(0,S.useEffect)(()=>(u.current=!0,()=>void(u.current=!1)));let[d,f,p]=(0,S.useMemo)(()=>{let e=()=>{if(!s.current.element)return;let{left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d}=s.current.element.getBoundingClientRect(),f={left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d};s.current.element instanceof HTMLElement&&r&&(f.height=s.current.element.offsetHeight,f.width=s.current.element.offsetWidth),Object.freeze(f),u.current&&!ZA(s.current.lastBounds,f)&&o(s.current.lastBounds=f)};return[e,l?GA(e,l):e,c?GA(e,c):e]},[o,r,c,l]);
4407function m(){s.current.scrollContainers&&(s.current.scrollContainers.forEach(e=>e.removeEventListener(`scroll`,p,!0)),s.current.scrollContainers=null),s.current.resizeObserver&&(s.current.resizeObserver.disconnect(),s.current.resizeObserver=null),s.current.orientationHandler&&(`orientation`in screen&&`removeEventListener`in screen.orientation?screen.orientation.removeEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.removeEventListener(`orientationchange`,s.current.orientationHandler))}function h(){s.current.element&&(s.current.resizeObserver=new i(p),s.current.resizeObserver.observe(s.current.element),t&&s.current.scrollContainers&&s.current.scrollContainers.forEach(e=>e.addEventListener(`scroll`,p,{capture:!0,passive:!0})),s.current.orientationHandler=()=>{p()},`orientation`in screen&&`addEventListener`in screen.orientation?screen.orientation.addEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.addEventListener(`orientationchange`,s.current.orientationHandler))}return JA(p,!!t),qA(f),(0,S.useEffect)(()=>{m(),h()},[t,p,f]),(0,S.useEffect)(()=>m,[]),[e=>{!e||e===s.current.element||(m(),s.current.element=e,s.current.scrollContainers=YA(e),h())},a,d]}function qA(e){(0,S.useEffect)(()=>{let t=e;return window.addEventListener(`resize`,t),()=>void window.removeEventListener(`resize`,t)},[e])}function JA(e,t){(0,S.useEffect)(()=>{if(t){let t=e;return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>void window.removeEventListener(`scroll`,t,!0)}},[e,t])}function YA(e){let t=[];if(!e||e===document.body)return t;let{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(e);return[n,r,i].some(e=>e===`auto`||e===`scroll`)&&t.push(e),[...t,...YA(e.parentElement)]}var XA=[`x`,`y`,`top`,`bottom`,`left`,`right`,`width`,`height`],ZA=(e,t)=>XA.every(n=>e[n]===t[n]);qd(),VO(),UO();function QA({ref:e,children:t,fallback:n,resize:r,style:i,gl:a,events:o=WA,eventSource:s,eventPrefix:c,shadows:l,linear:u,flat:d,legacy:f,orthographic:p,frameloop:m,dpr:h,performance:g,raycaster:_,camera:v,scene:y,onPointerMissed:b,onCreated:x,...C}){S.useMemo(()=>eA(nT),[]);let w=sk(),[T,E]=KA({scroll:!0,debounce:{scroll:50,resize:0},...r}),D=S.useRef(null),O=S.useRef(null);S.useImperativeHandle(e,()=>D.current);let k=ok(b),[A,j]=S.useState(!1),[ee,M]=S.useState(!1);if(A)throw A;if(ee)throw ee;let te=S.useRef(null);return ak(()=>{let e=D.current;if(E.width>0&&E.height>0&&e){te.current||=SA(e);async function n(){await te.current.configure({gl:a,scene:y,events:o,shadows:l,linear:u,flat:d,legacy:f,orthographic:p,frameloop:m,dpr:h,performance:g,raycaster:_,camera:v,size:E,onPointerMissed:(...e)=>k.current==null?void 0:k.current(...e),onCreated:e=>{e.events.connect==null||e.events.connect(s?rk(s)?s.current:s:O.current),c&&e.setEvents({compute:(e,t)=>{let n=e[c+`X`],r=e[c+`Y`];t.pointer.set(n/t.size.width*2-1,-(r/t.size.height)*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),x?.(e)}}),te.current.render((0,K.jsx)(w,{children:(0,K.jsx)(lk,{set:M,children:(0,K.jsx)(S.Suspense,{fallback:(0,K.jsx)(ck,{set:j}),children:t??null})})}))}n()}}),S.useEffect(()=>{let e=D.current;if(e)return()=>wA(e)},[]),(0,K.jsx)(`div`,{ref:O,style:{position:`relative`,width:`100%`,height:`100%`,overflow:`hidden`,pointerEvents:s?`none`:`auto`,...i},...C,children:(0,K.jsx)(`div`,{ref:T,style:{width:`100%`,height:`100%`},children:(0,K.jsx)(`canvas`,{ref:D,style:{display:`block`},children:n})})})}function $A(e){return(0,K.jsx)(YO,{children:(0,K.jsx)(QA,{...e})})}function ej(){return ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ej.apply(null,arguments)}var tj=(()=>parseInt(`182`.replace(/\D+/g,``)))();function nj(e,t=Math.PI/3){let n=Math.cos(t),r=1.0000000001*100,i=[new X,new X,new X],a=new X,o=new X,s=new X,c=new X;function l(e){return`${~~(e.x*r)},${~~(e.y*r)},${~~(e.z*r)}`}let u=e.index?e.toNonIndexed():e,d=u.attributes.position,f={};for(let e=0,t=d.count/3;e<t;e++){let t=3*e,n=i[0].fromBufferAttribute(d,t+0),r=i[1].fromBufferAttribute(d,t+1),s=i[2].fromBufferAttribute(d,t+2);a.subVectors(s,r),o.subVectors(n,r);let c=new X().crossVectors(a,o).normalize();for(let e=0;e<3;e++){let t=i[e],n=l(t);n in f||(f[n]=[]),f[n].push(c)}}let p=new Zg(new Float32Array(d.count*3),3,!1);for(let e=0,t=d.count/3;e<t;e++){let t=3*e,r=i[0].fromBufferAttribute(d,t+0),u=i[1].fromBufferAttribute(d,t+1),m=i[2].fromBufferAttribute(d,t+2);a.subVectors(m,u),o.subVectors(r,u),s.crossVectors(a,o).normalize();for(let e=0;e<3;e++){let r=i[e],a=f[l(r)];c.set(0,0,0);for(let e=0,t=a.length;e<t;e++){let t=a[e];s.dot(t)>n&&c.add(t)}c.normalize(),p.setXYZ(t+e,c.x,c.y,c.z)}}return u.setAttribute(`normal`,p),u}var rj=Uint8Array,ij=Uint16Array,aj=Uint32Array,oj=new rj([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sj=new rj([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),cj=new rj([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lj=function(e,t){for(var n=new ij(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new aj(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},uj=lj(oj,2),dj=uj[0],fj=uj[1];dj[28]=258,fj[258]=28;var pj=lj(sj,0),mj=pj[0];pj[1];for(var hj=new ij(32768),gj=0;gj<32768;++gj){var _j=(gj&43690)>>>1|(gj&21845)<<1;_j=(_j&52428)>>>2|(_j&13107)<<2,_j=(_j&61680)>>>4|(_j&3855)<<4,hj[gj]=((_j&65280)>>>8|(_j&255)<<8)>>>1}for(var vj=(function(e,t,n){for(var r=e.length,i=0,a=new ij(t);
vendor: 1,715 bytes, line 4407
4407i<r;++i)++a[e[i]-1];var o=new ij(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new ij(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[hj[d]>>>c]=l}else for(s=new ij(r),i=0;i<r;++i)e[i]&&(s[i]=hj[o[e[i]-1]++]>>>15-e[i]);return s}),yj=new rj(288),gj=0;gj<144;++gj)yj[gj]=8;for(var gj=144;gj<256;++gj)yj[gj]=9;for(var gj=256;gj<280;++gj)yj[gj]=7;for(var gj=280;gj<288;++gj)yj[gj]=8;for(var bj=new rj(32),gj=0;gj<32;++gj)bj[gj]=5;var xj=vj(yj,9,1),Sj=vj(bj,5,1),Cj=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},wj=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Tj=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Ej=function(e){return(e/8|0)+(e&7&&1)},Dj=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof ij?ij:e instanceof aj?aj:rj)(n-t);return r.set(e.subarray(t,n)),r},Oj=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new rj(0);var i=!t||n,a=!n||n.i;n||={},t||=new rj(r*3);var o=function(e){var n=t.length;if(e>n){var r=new rj(Math.max(n*2,e));r.set(t),t=r}},s=n.f||0,c=n.p||0,l=n.b||0,u=n.l,d=n.d,f=n.m,p=n.n,m=r*8;do{if(!u){n.f=s=wj(e,c,1);var h=wj(e,c+1,3);if(c+=3,h)if(h==1)u=xj,d=Sj,f=9,p=5;else if(h==2){var g=wj(e,c,31)+257,_=wj(e,c+10,15)+4,v=g+wj(e,c+5,31)+1;c+=14;for(var y=new rj(v),b=new rj(19),x=0;x<_;++x)b[cj[x]]=wj(e,c+x*3,7);c+=_*3;for(var S=Cj(b),C=(1<<S)-1,w=vj(b,S,1),x=0;x<v;){var T=w[wj(e,c,C)];c+=T&15;var E=T>>>4;if(E<16)y[x++]=E;else{var D=0,O=0;for(E==16?(O=3+wj(e,c,3),c+=2,D=y[x-1]):E==17?(O=3+wj(e,c,7),c+=3):E==18&&(O=11+wj(e,c,127),c+=7);O--;)y[x++]=D}}var k=y.subarray(0,g),A=y.subarray(g);
4407f=Cj(k),p=Cj(A),u=vj(k,f,1),d=vj(A,p,1)}else throw`invalid block type`;else{var E=Ej(c)+4,j=e[E-4]|e[E-3]<<8,ee=E+j;if(ee>r){if(a)throw`unexpected EOF`;break}i&&o(l+j),t.set(e.subarray(E,ee),l),n.b=l+=j,n.p=c=ee*8;continue}if(c>m){if(a)throw`unexpected EOF`;break}}i&&o(l+131072);for(var M=(1<<f)-1,te=(1<<p)-1,N=c;;N=c){var D=u[Tj(e,c)&M],P=D>>>4;if(c+=D&15,c>m){if(a)throw`unexpected EOF`;break}if(!D)throw`invalid length/literal`;if(P<256)t[l++]=P;else if(P==256){N=c,u=null;break}else{var F=P-254;if(P>264){var x=P-257,I=oj[x];F=wj(e,c,(1<<I)-1)+dj[x],c+=I}var ne=d[Tj(e,c)&te],re=ne>>>4;if(!ne)throw`invalid distance`;c+=ne&15;var A=mj[re];if(re>3){var I=sj[re];A+=Tj(e,c)&(1<<I)-1,c+=I}if(c>m){if(a)throw`unexpected EOF`;break}i&&o(l+131072);for(var L=l+F;l<L;l+=4)t[l]=t[l-A],t[l+1]=t[l+1-A],t[l+2]=t[l+2-A],t[l+3]=t[l+3-A];l=L}}n.l=u,n.p=N,n.b=l,u&&(s=1,n.m=f,n.d=d,n.n=p)}while(!s);return l==t.length?t:Dj(t,0,l)},kj=new rj(0),Aj=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw`invalid zlib data`;if(e[1]&32)throw`invalid zlib data: preset dictionaries not supported`};function jj(e,t){return Oj((Aj(e),e.subarray(2,-4)),t)}var Mj=typeof TextDecoder<`u`&&new TextDecoder;try{Mj.decode(kj,{stream:!0})}catch{}var Nj=e=>e&&e.isCubeTexture,Pj=class extends T_{constructor(e,t){let n=Nj(e),r=((n?e.image[0]?.width:e.image.width)??1024)/4,i=Math.floor(Math.log2(r)),a=2**i,o=3*Math.max(a,112),s=4*a,c=[n?`#define ENVMAP_TYPE_CUBE`:``,`#define CUBEUV_TEXEL_WIDTH ${1/o}`,`#define CUBEUV_TEXEL_HEIGHT ${1/s}`,`#define CUBEUV_MAX_MIP ${i}.0`].join(` 4408`)+` 4409 #define ENVMAP_TYPE_CUBE_UV 4410 varying vec3 vWorldPosition; 4411 uniform float radius; 4412 uniform float height; 4413 uniform float angle; 4414 #ifdef ENVMAP_TYPE_CUBE 4415 uniform samplerCube map; 4416 #else 4417 uniform sampler2D map; 4418 #endif 4419 // From: https://www.shadertoy.com/view/4tsBD7 4420 float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 4421 { 4422 float d = dot ( rd, n ); 4423 4424 if( d > 0.0 ) { return 1e6; } 4425 4426 vec3 o = ro - c; 4427 float t = - dot( n, o ) / d; 4428 vec3 q = o + rd * t; 4429 4430 return ( dot( q, q ) < r * r ) ? t : 1e6; 4431 } 4432 // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm 4433 float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 4434 { 4435 vec3 oc = ro - ce; 4436 float b = dot( oc, rd ); 4437 float c = dot( oc, oc ) - ra * ra; 4438 float h = b * b - c; 4439 4440 if( h < 0.0 ) { return -1.0; } 4441 4442 h = sqrt( h ); 4443 4444 return - b + h; 4445 } 4446 vec3 project() 4447 { 4448 vec3 p = normalize( vWorldPosition ); 4449 vec3 camPos = cameraPosition; 4450 camPos.y -= height; 4451 float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); 4452 if( intersection > 0.0 ) { 4453 4454 vec3 h = vec3( 0.0, - height, 0.0 ); 4455 float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); 4456 p = ( camPos + min( intersection, intersection2 ) * p ) / radius; 4457 } else { 4458 p = vec3( 0.0, 1.0, 0.0 ); 4459 } 4460 return p; 4461 } 4462 #include <common> 4463 #include <cube_uv_reflection_fragment> 4464 void main() 4465 { 4466 vec3 projectedWorldPosition = project(); 4467 4468 #ifdef ENVMAP_TYPE_CUBE 4469 vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; 4470 #else 4471 vec3 direction = normalize( projectedWorldPosition ); 4472 vec2 uv = equirectUv( direction ); 4473 vec3 outcolor = texture2D( map, uv ).rgb; 4474 #endif 4475 gl_FragColor = vec4( outcolor, 1.0 ); 4476 #include <tonemapping_fragment> 4477 #include <${tj>=154?`colorspace_fragment`:`encodings_fragment`}> 4478 } 4479 `,l={map:{value:e},height:{value:t?.height||15},radius:{value:t?.radius||100}},u=new Tx(1,16),d=new I_({uniforms:l,fragmentShader:c,vertexShader:` 4480 varying vec3 vWorldPosition; 4481 void main() 4482 { 4483 vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); 4484 vWorldPosition = worldPosition.xyz; 4485 4486 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4487 } 4488 `,side:2});super(u,d)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}},Fj={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` 4489 varying vec2 vUv; 4490 4491 void main() { 4492 4493 vUv = uv; 4494 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4495 4496 } 4497 `,fragmentShader:` 4498 uniform sampler2D tDiffuse; 4499 uniform float h; 4500 4501 varying vec2 vUv; 4502 4503 void main() { 4504 4505 vec4 sum = vec4( 0.0 ); 4506 4507 sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051; 4508 sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918; 4509 sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245; 4510 sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531; 4511 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 4512 sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531; 4513 sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245; 4514 sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918; 4515 sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051; 4516 4517 gl_FragColor = sum; 4518 4519 } 4520 `},Ij={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:` 4521 varying vec2 vUv; 4522 4523 void main() { 4524 4525 vUv = uv; 4526 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4527 4528 } 4529 `,fragmentShader:` 4530 4531 uniform sampler2D tDiffuse; 4532 uniform float v; 4533 4534 varying vec2 vUv; 4535 4536 void main() { 4537 4538 vec4 sum = vec4( 0.0 ); 4539 4540 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051; 4541 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918; 4542 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245; 4543 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531; 4544 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 4545 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531; 4546 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245; 4547 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918; 4548 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051; 4549 4550 gl_FragColor = sum; 4551 4552 } 4553 `},Lj=class extends MS{constructor(e){super(e),this.type=bf}parse(e){let t=function(e,t){switch(e){case 1:throw Error(`THREE.RGBELoader: Read Error: `+(t||``));case 2:throw Error(`THREE.RGBELoader: Write Error: `+(t||``));case 3:throw Error(`THREE.RGBELoader: Bad File Format: `+(t||``));default:case 4:throw Error(`THREE.RGBELoader: Memory Error: `+(t||``))}},n=function(e,t,n){t||=1024;let r=e.pos,i=-1,a=0,o=``,s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=s.indexOf(` 4554`))&&a<t&&r<e.byteLength;)o+=s,a+=s.length,r+=128,s+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<i?(!1!==n&&(e.pos+=a+i+1),o+s.slice(0,i)):!1},r=function(e){let r=/^#\?(\S+)/,i=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*EXPOSURE\s*=\s
4554*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,s=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,c={valid:0,string:``,comments:``,programtype:`RGBE`,format:``,gamma:1,exposure:1,width:0,height:0},l,u;for((e.pos>=e.byteLength||!(l=n(e)))&&t(1,`no header found`),(u=l.match(r))||t(3,`bad initial token`),c.valid|=1,c.programtype=u[1],c.string+=l+` 4555`;l=n(e),!1!==l;){if(c.string+=l+` 4556`,l.charAt(0)===`#`){c.comments+=l+` 4557`;continue}if((u=l.match(i))&&(c.gamma=parseFloat(u[1])),(u=l.match(a))&&(c.exposure=parseFloat(u[1])),(u=l.match(o))&&(c.valid|=2,c.format=u[1]),(u=l.match(s))&&(c.valid|=4,c.height=parseInt(u[1],10),c.width=parseInt(u[2],10)),c.valid&2&&c.valid&4)break}return c.valid&2||t(3,`missing format specifier`),c.valid&4||t(3,`missing image size specifier`),c},i=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&s<e.byteLength;){s+4>e.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n<c&&s<e.byteLength;){r=e[s++];let i=r>128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e<r;e++)u[n++]=t}else u.set(e.subarray(s,s+r),n),n+=r,s+=r}let f=i;for(let e=0;e<f;e++){let t=0;a[o]=u[e+t],t+=i,a[o+1]=u[e+t],t+=i,a[o+2]=u[e+t],t+=i,a[o+3]=u[e+t],o+=4}d--}return a},a=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=e[t+0]*i,n[r+1]=e[t+1]*i,n[r+2]=e[t+2]*i,n[r+3]=1},o=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=qg.toHalfFloat(Math.min(e[t+0]*i,65504)),n[r+1]=qg.toHalfFloat(Math.min(e[t+1]*i,65504)),n[r+2]=qg.toHalfFloat(Math.min(e[t+2]*i,65504)),n[r+3]=qg.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;let c=r(s),l=c.width,u=c.height,d=i(s.subarray(s.pos),l,u),f,p,m;switch(this.type){case yf:m=d.length/4;let e=new Float32Array(m*4);for(let t=0;t<m;t++)a(d,t*4,e,t*4);f=e,p=yf;break;case bf:m=d.length/4;let t=new Uint16Array(m*4);for(let e=0;e<m;e++)o(d,e*4,t,e*4);f=t,p=bf;break;default:throw Error(`THREE.RGBELoader: Unsupported type: `+this.type)}return{width:l,height:u,data:f,header:c.string,gamma:c.gamma,exposure:c.exposure,type:p}}setDataType(e){return this.type=e,this}load(e,t,n,r){function i(e,n){switch(e.type){case yf:case bf:`colorSpace`in e?e.colorSpace=`srgb-linear`:e.encoding=3e3,e.minFilter=cf,e.magFilter=cf,e.generateMipmaps=!1,e.flipY=!0;break}t&&t(e,n)}return super.load(e,i,n,r)}},Rj=tj>=152,zj=class extends MS{constructor(e){super(e),this.type=bf}parse(e){let t=65536,n=t>>3,r=65537,i=16384,a=i-1,o=65535,s=2.7182818**2.2;function c(e,n){for(var r=0,i=0;i<t;++i)(i==0||e[i>>3]&1<<(i&7))&&(n[r++]=i);for(var a=r-1;r<t;)n[r++]=0;return a}function l(e){for(var t=0;t<i;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}let u={l:0,c:0,lc:0};function d(e,t,n,r,i){for(;n<e;)t=t<<8|B(r,i),n+=8;n-=e,u.l=t>>n&(1<<e)-1,u.c=t,u.lc=n}let f=Array(59);function p(e){for(var t=0;t<=58;++t)f[t]=0;for(var t=0;t<r;++t)f[e[t]]+=1;for(var n=0,t=58;t>0;--t){var i=n+f[t]>>1;f[t]=n,n=i}for(var t=0;t<r;++t){var a=e[t];a>0&&(e[t]=a|f[a]++<<6)}}function m(e,t,n,r,i,a,o){for(var s=n,c=0,l=0;i<=a;i++){if(s.value-n.value>r)return!1;d(6,c,l,e,s);var f=u.l;if(c=u.c,l=u.lc,o[i]=f,f==63){if(s.value-n.value>r)throw`Something wrong with hufUnpackEncTable`;d(8,c,l,e,s);var m=u.l+6;if(c=u.c,l=u.lc,i+m>a+1)throw`Something wrong with hufUnpackEncTable`;for(;m--;)o[i++]=0;i--}else if(f>=59){var m=f-59+2;if(i+m>a+1)throw`Something wrong with hufUnpackEncTable`;for(;m--;)o[i++]=0;i--}}p(o)}function h(e){return e&63}function g(e){return e>>6}function _(e,t,n,r){for(;t<=n;t++){var i=g(e[t]),a=h(e[t]);if(i>>a)throw`Invalid table entry`;if(a>14){var o=r[i>>a-14];if(o.len)throw`Invalid table entry`;if(o.lit++,o.p){var s=o.p;o.p=Array(o.lit);for(var c=0;c<o.lit-1;++c)o.p[c]=s[c]}else o.p=[,];o.p[o.lit-1]=t}else if(a)for(var l=0,c=1<<14-a;c>0;c--){var o=r[(i<<14-a)+l];if(o.len||o.p)throw`Invalid table entry`;o.len=a,o.lit=t,l++}}return!0}let v={c:0,lc:0};function y(e,t,n,r){e=e<<8|B(n,r),t+=8,v.c=e,v.lc=t}let b={c:0,lc:0};function x(e,t,n,r,i,a,o,s,c,l){if(e==t){r<8&&(y(n,r,i,o),n=v.c,r=v.lc),r-=8;var u=n>>r,u=new Uint8Array([u])[0];if(c.value+u>l)return!1;for(var d=s[c.value-1];u-- >0;)s[c.value++]=d}else if(c.value<l)s[c.value++]=e;else return!1;b.c=n,b.lc=r}function S(e){return e&65535}function C(e){var t=S(e);return t>32767?t-65536:t}let w={a:0,b:0};function T(e,t){var n=C(e),r=C(t),i=n+(r&1)+(r>>1),a=i,o=i-r;w.a=a,w.b=o}function E(e,t){var n=S(e),r=S(t),i=n-(r>>1)&o;w.a=r+i-32768&o,w.b=i}function D(e,t,n,r,i,a,o){for(var s=o<16384,c=n>i?i:n,l=1,u;l<=c;)l<<=1;for(l>>=1,u=l,l>>=1;l>=1;){for(var d=0,f=d+a*(i-u),p=a*l,m=a*u,h=r*l,g=r*u,_,v,y,b;d<=f;d+=m){for(var x=d,S=d+r*(n-u);x<=S;x+=g){var C=x+h,D=x+p,O=D+h;s?(T(e[x+t],e[D+t]),_=w.a,y=w.b,T(e[C+t],e[O+t]),v=w.a,b=w.b,T(_,v),e[x+t]=w.a,e[C+t]=w.b,T(y,b),e[D+t]=w.a,e[O+t]=w.b):(E(e[x+t],e[D+t]),_=w.a,y=w.b,E(e[C+t],e[O+t]),v=w.a,b=w.b,E(_,v),e[x+t]=w.a,e[C+t]=w.b,E(y,b),e[D+t]=w.a,e[O+t]=w.b)}if(n&l){var D=x+p;s?T(e[x+t],e[D+t]):E(e[x+t],e[D+t]),_=w.a,e[D+t]=w.b,e[x+t]=_}}if(i&l)for(var x=d,S=d+r*(n-u);x<=S;x+=g){var C=x+h;s?T(e[x+t],e[C+t]):E(e[x+t],e[C+t]),_=w.a,e[C+t]=w.b,e[x+t]=_}u=l,l>>=1}return d}function O(e,t,n,r,i,o,s,c,l,u){for(var d=0,f=0,p=c,m=Math.trunc(i.value+(o+7)/8);i.value<m;)for(y(d,f,n,i),d=v.c,f=v.lc;f>=14;){var _=t[d>>f-14&a];if(_.len)f-=_.len,x(_.lit,s,d,f,n,r,i,l,u,p),d=b.c,f=b.lc;else{if(!_.p)throw`hufDecode issues`;var S;for(S=0;S<_.lit;S++){for(var C=h(e[_.p[S]]);f<C&&i.value<m;)y(d,f,n,i),d=v.c,f=v.lc;if(f>=C&&g(e[_.p[S]])==(d>>f-C&(1<<C)-1)){f-=C,x(_.p[S],s,d,f,n,r,i,l,u,p),d=b.c,f=b.lc;break}}if(S==_.lit)throw`hufDecode issues`}}var w=8-o&7;for(d>>=w,f-=w;f>0;){var _=t[d<<14-f&a];if(_.len)f-=_.len,x(_.lit,s,d,f,n,r,i,l,u,p),d=b.c,f=b.lc;else throw`hufDecode issues`}return!0}function k(e,t,n,a,o,s){var c={value:0},u=n.value,d=fe(t,n),f=fe(t,n);n.value+=4;var p=fe(t,n);if(n.value+=4,d<0||d>=r||f<0||f>=r)throw`Something wrong with HUF_ENCSIZE`;var h=Array(r),g=Array(i);if(l(g),m(e,t,n,a-(n.value-u),d,f,h),p>8*(a-(n.value-u)))throw`Something wrong with hufUncompress`;_(h,d,f,g),O(h,g,e,t,n,p,f,s,o,c)}function A(e,t,n){for(var r=0;r<n;++r)t[r]=e[t[r]]}function j(e){for(var t=1;t<e.length;t++)e[t]=e[t-1]+e[t]-128}function ee(e,t){for(var n=0,r=Math.floor((e.length+1)/2),i=0,a=e.length-1;!(i>a||(t[i++]=e[n++],i>a));)t[i++]=e[r++]}function M(e){for(var t=e.byteLength,n=[],r=0,i=new DataView(e);t>0;){var a=i.getInt8(r++);if(a<0){var o=-a;t-=o+1;for(var s=0;s<o;s++)n.push(i.getUint8(r++))}else{var o=a;t-=2;for(var c=i.getUint8(r++),s=0;s<o+1;s++)n.push(c)}}return n}function te(e,t,n,r,i,a){var o=new DataView(a.buffer),s=n[e.idx[0]].width,c=n[e.
vendor: 4,143 bytes, line 4557
4557idx[0]].height,l=3,u=Math.floor(s/8),d=Math.ceil(s/8),f=Math.ceil(c/8),p=s-(d-1)*8,m=c-(f-1)*8,h={value:0},g=Array(l),_=Array(l),v=Array(l),y=Array(l),b=Array(l);for(let n=0;n<l;++n)b[n]=t[e.idx[n]],g[n]=n<1?0:g[n-1]+d*f,_[n]=new Float32Array(64),v[n]=new Uint16Array(64),y[n]=new Uint16Array(d*64);for(let t=0;t<f;++t){var x=8;t==f-1&&(x=m);var S=8;for(let e=0;e<d;++e){e==d-1&&(S=p);for(let e=0;e<l;++e)v[e].fill(0),v[e][0]=i[g[e]++],N(h,r,v[e]),P(v[e],_[e]),F(_[e]);I(_);for(let t=0;t<l;++t)ne(_[t],y[t],e*64)}let a=0;for(let r=0;r<l;++r){let i=n[e.idx[r]].type;for(let e=8*t;e<8*t+x;++e){a=b[r][e];for(let t=0;t<u;++t){let n=t*64+(e&7)*8;o.setUint16(a+0*i,y[r][n+0],!0),o.setUint16(a+2*i,y[r][n+1],!0),o.setUint16(a+4*i,y[r][n+2],!0),o.setUint16(a+6*i,y[r][n+3],!0),o.setUint16(a+8*i,y[r][n+4],!0),o.setUint16(a+10*i,y[r][n+5],!0),o.setUint16(a+12*i,y[r][n+6],!0),o.setUint16(a+14*i,y[r][n+7],!0),a+=16*i}}if(u!=d)for(let e=8*t;e<8*t+x;++e){let t=b[r][e]+8*u*2*i,n=u*64+(e&7)*8;for(let e=0;e<S;++e)o.setUint16(t+e*2*i,y[r][n+e],!0)}}}for(var C=new Uint16Array(s),o=new DataView(a.buffer),w=0;w<l;++w){n[e.idx[w]].decoded=!0;var T=n[e.idx[w]].type;if(n[w].type==2)for(var E=0;E<c;++E){let e=b[w][E];for(var D=0;D<s;++D)C[D]=o.getUint16(e+D*2*T,!0);for(var D=0;D<s;++D)o.setFloat32(e+D*2*T,H(C[D]),!0)}}}function N(e,t,n){for(var r,i=1;i<64;)r=t[e.value],r==65280?i=64:r>>8==255?i+=r&255:(n[i]=r,i++),e.value++}function P(e,t){t[0]=H(e[0]),t[1]=H(e[1]),t[2]=H(e[5]),t[3]=H(e[6]),t[4]=H(e[14]),t[5]=H(e[15]),t[6]=H(e[27]),t[7]=H(e[28]),t[8]=H(e[2]),t[9]=H(e[4]),t[10]=H(e[7]),t[11]=H(e[13]),t[12]=H(e[16]),t[13]=H(e[26]),t[14]=H(e[29]),t[15]=H(e[42]),t[16]=H(e[3]),t[17]=H(e[8]),t[18]=H(e[12]),t[19]=H(e[17]),t[20]=H(e[25]),t[21]=H(e[30]),t[22]=H(e[41]),t[23]=H(e[43]),t[24]=H(e[9]),t[25]=H(e[11]),t[26]=H(e[18]),t[27]=H(e[24]),t[28]=H(e[31]),t[29]=H(e[40]),t[30]=H(e[44]),t[31]=H(e[53]),t[32]=H(e[10]),t[33]=H(e[19]),t[34]=H(e[23]),t[35]=H(e[32]),t[36]=H(e[39]),t[37]=H(e[45]),t[38]=H(e[52]),t[39]=H(e[54]),t[40]=H(e[20]),t[41]=H(e[22]),t[42]=H(e[33]),t[43]=H(e[38]),t[44]=H(e[46]),t[45]=H(e[51]),t[46]=H(e[55]),t[47]=H(e[60]),t[48]=H(e[21]),t[49]=H(e[34]),t[50]=H(e[37]),t[51]=H(e[47]),t[52]=H(e[50]),t[53]=H(e[56]),t[54]=H(e[59]),t[55]=H(e[61]),t[56]=H(e[35]),t[57]=H(e[36]),t[58]=H(e[48]),t[59]=H(e[49]),t[60]=H(e[57]),t[61]=H(e[58]),t[62]=H(e[62]),t[63]=H(e[63])}function F(e){let t=.5*Math.cos(3.14159/4),n=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),i=.5*Math.cos(3*3.14159/16),a=.5*Math.cos(5*3.14159/16),o=.5*Math.cos(3*3.14159/8),s=.5*Math.cos(7*3.14159/16);for(var c=[,,,,],l=[,,,,],u=[,,,,],d=[,,,,],f=0;f<8;++f){var p=f*8;c[0]=r*e[p+2],c[1]=o*e[p+2],c[2]=r*e[p+6],c[3]=o*e[p+6],l[0]=n*e[p+1]+i*e[p+3]+a*e[p+5]+s*e[p+7],l[1]=i*e[p+1]-s*e[p+3]-n*e[p+5]-a*e[p+7],l[2]=a*e[p+1]-n*e[p+3]+s*e[p+5]+i*e[p+7],l[3]=s*e[p+1]-a*e[p+3]+i*e[p+5]-n*e[p+7],u[0]=t*(e[p+0]+e[p+4]),u[3]=t*(e[p+0]-e[p+4]),u[1]=c[0]+c[3],u[2]=c[1]-c[2],d[0]=u[0]+u[1],d[1]=u[3]+u[2],d[2]=u[3]-u[2],d[3]=u[0]-u[1],e[p+0]=d[0]+l[0],e[p+1]=d[1]+l[1],e[p+2]=d[2]+l[2],e[p+3]=d[3]+l[3],e[p+4]=d[3]-l[3],e[p+5]=d[2]-l[2],e[p+6]=d[1]-l[1],e[p+7]=d[0]-l[0]}for(var m=0;m<8;++m)c[0]=r*e[16+m],c[1]=o*e[16+m],c[2]=r*e[48+m],c[3]=o*e[48+m],l[0]=n*e[8+m]+i*e[24+m]+a*e[40+m]+s*e[56+m],l[1]=i*e[8+m]-s*e[24+m]-n*e[40+m]-a*e[56+m],l[2]=a*e[8+m]-n*e[24+m]+s*e[40+m]+i*e[56+m],l[3]=s*e[8+m]-a*e[24+m]+i*e[40+m]-n*e[56+m],u[0]=t*(e[m]+e[32+m]),u[3]=t*(e[m]-e[32+m]),u[1]=c[0]+c[3],u[2]=c[1]-c[2],d[0]=u[0]+u[1],d[1]=u[3]+u[2],d[2]=u[3]-u[2],d[3]=u[0]-u[1],e[0+m]=d[0]+l[0],e[8+m]=d[1]+l[1],e[16+m]=d[2]+l[2],e[24+m]=d[3]+l[3],e[32+m]=d[3]-l[3],e[40+m]=d[2]-l[2],e[48+m]=d[1]-l[1],e[56+m]=d[0]-l[0]}function I(e){for(var t=0;t<64;++t){var n=e[0][t],r=e[1][t],i=e[2][t];e[0][t]=n+1.5747*i,e[1][t]=n-.1873*r-.4682*i,e[2][t]=n+1.8556*r}}function ne(e,t,n){for(var r=0;r<64;++r)t[n+r]=qg.toHalfFloat(re(e[r]))}function re(e){return e<=1?Math.sign(e)*Math.abs(e)**2.2:Math.sign(e)*s**(Math.abs(e)-1)}function L(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function ie(e){var t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(M(t)),r=new
4557Uint8Array(n.length);return j(n),ee(n,r),new DataView(r.buffer)}function R(e){var t=jj(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new Uint8Array(t.length);return j(t),ee(t,n),new DataView(n.buffer)}function ae(e){for(var r=e.viewer,i={value:e.offset.value},a=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),o=new Uint8Array(n),s=0,l=Array(e.channels),u=0;u<e.channels;u++)l[u]={},l[u].start=s,l[u].end=l[u].start,l[u].nx=e.width,l[u].ny=e.lines,l[u].size=e.type,s+=l[u].nx*l[u].ny*l[u].size;var d=U(r,i),f=U(r,i);if(f>=n)throw`Something is wrong with PIZ_COMPRESSION BITMAP_SIZE`;if(d<=f)for(var u=0;u<f-d+1;u++)o[u+d]=pe(r,i);var p=new Uint16Array(t),m=c(o,p),h=fe(r,i);k(e.array,r,i,h,a,s);for(var u=0;u<e.channels;++u)for(var g=l[u],_=0;_<l[u].size;++_)D(a,g.start+_,g.nx,g.size,g.ny,g.nx*g.size,m);A(p,a,s);for(var v=0,y=new Uint8Array(a.buffer.byteLength),b=0;b<e.lines;b++)for(var x=0;x<e.channels;x++){var g=l[x],S=g.nx*g.size,C=new Uint8Array(a.buffer,g.end*2,S*2);y.set(C,v),v+=S*2,g.end+=S}return new DataView(y.buffer)}function oe(e){var t=jj(e.array.slice(e.offset.value,e.offset.value+e.size));let n=e.lines*e.channels*e.width,r=e.type==1?new Uint16Array(n):new Uint32Array(n),i=0,a=0,o=[,,,,];for(let n=0;n<e.lines;n++)for(let n=0;n<e.channels;n++){let n=0;switch(e.type){case 1:o[0]=i,o[1]=o[0]+e.width,i=o[1]+e.width;for(let i=0;i<e.width;++i){let e=t[o[0]++]<<8|t[o[1]++];n+=e,r[a]=n,a++}break;case 2:o[0]=i,o[1]=o[0]+e.width,o[2]=o[1]+e.width,i=o[2]+e.width;for(let i=0;i<e.width;++i){let e=t[o[0]++]<<24|t[o[1]++]<<16|t[o[2]++]<<8;n+=e,r[a]=n,a++}break}}return new DataView(r.buffer)}function se(e){var t=e.viewer,n={value:e.offset.value},r=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),i={version:me(t,n),unknownUncompressedSize:me(t,n),unknownCompressedSize:me(t,n),acCompressedSize:me(t,n),dcCompressedSize:me(t,n),rleCompressedSize:me(t,n),rleUncompressedSize:me(t,n),rleRawSize:me(t,n),totalAcUncompressedCount:me(t,n),totalDcUncompressedCount:me(t,n),acCompression:me(t,n)};if(i.version<2)throw`EXRLoader.parse: `+Ae.compression+` version `+i.version+` is unsupported`;for(var a=[],o=U(t,n)-2;o>0;){var s=ce(t.buffer,n),c=pe(t,n),l=c>>2&3,u=(c>>4)-1,d=new Int8Array([u])[0],f=pe(t,n);a.push({name:s,index:d,type:f,compression:l}),o-=s.length+3}for(var p=Ae.channels,m=Array(e.channels),h=0;h<e.channels;++h){var g=m[h]={},_=p[h];g.name=_.name,g.compression=0,g.decoded=!1,g.type=_.pixelType,g.pLinear=_.pLinear,g.width=e.width,g.height=e.lines}for(var v={idx:[,,,]},y=0;y<e.channels;++y)for(var g=m[y],h=0;h<a.length;++h){var b=a[h];g.name==b.name&&(g.compression=b.compression,b.index>=0&&(v.idx[b.index]=y),g.offset=y)}if(i.acCompressedSize>0)switch(i.acCompression){case 0:var x=new Uint16Array(i.totalAcUncompressedCount);k(e.array,t,n,i.acCompressedSize,x,i.totalAcUncompressedCount);break;case 1:var S=e.array.slice(n.value,n.value+i.totalAcUncompressedCount),C=jj(S),x=new Uint16Array(C.buffer);n.value+=i.totalAcUncompressedCount;break}if(i.dcCompressedSize>0){var w={array:e.array,offset:n,size:i.dcCompressedSize},T=new Uint16Array(R(w).buffer);n.value+=i.dcCompressedSize}if(i.rleRawSize>0){var S=e.array.slice(n.value,n.value+i.rleCompressedSize),C=jj(S),E=M(C.buffer);n.value+=i.rleCompressedSize}for(var D=0,O=Array(m.length),h=0;h<O.length;++h)O[h]=[];for(var A=0;A<e.lines;++A)for(var j=0;j<m.length;++j)O[j].push(D),D+=m[j].width*e.type*2;te(v,O,m,x,T,r);for(var h=0;h<m.length;++h){var g=m[h];if(!g.decoded)switch(g.compression){case 2:for(var ee=0,N=0,A=0;A<e.lines;++A){for(var P=O[h][ee],F=0;F<g.width;++F){for(var I=0;I<2*g.type;++I)r[P++]=E[N+I*g.width*g.height];N++}ee++}break;case 1:default:throw`EXRLoader.parse: unsupported channel compression`}}return new DataView(r.buffer)}function ce(e,t){for(var n=new Uint8Array(e),r=0;n[t.value+r]!=0;)r+=1;var i=new TextDecoder().decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,i}function z(e,t,n){var r=new TextDecoder().decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value+=n,r}function le(e,t){return[de(e,t),fe(e,t)]}function ue(e,t){return[fe(e,t),fe(e,t)]}function de(e,t){var n=e.getInt32(t.value,!0);return t.value+=4,n}function fe(e,t){var n=e.getUint32(t.value,!0);return t.value+=4,n}function B(e,t){var n=e[t.value];return t.value+=1,n}function pe(e,t){var n=e.getUint8(t.value);return t.value+=1,n}let me=function(e,t){let n;return n=`getBigInt64`in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n};function he(e,t){var n=e.getFloat32(t.value,!0);return t.value+=4,n}function V(e,t){return qg.toHalfFloat(he(e,t))}function H(e){var t=(e&31744)>>10,n=e&1023;return(e>>15?-1:1)*(t?t===31?n?NaN:1/0:2**(t-15)*(1+n/1024):6103515625e-14*(n/1024))}function U(e,t){var n=e.getUint16(t.value,!0);return t.value+=2,n}function ge(e,t){return H(U(e,t))}function _e(e,t,n,r){for(var i=n.value,a=[];n.value<i+r-1;){var o=ce(t,n),s=de(e,n),c=pe(e,n);n.value+=3;var l=de(e,n),u=de(e,n);
4557a.push({name:o,pixelType:s,pLinear:c,xSampling:l,ySampling:u})}return n.value+=1,a}function ve(e,t){return{redX:he(e,t),redY:he(e,t),greenX:he(e,t),greenY:he(e,t),blueX:he(e,t),blueY:he(e,t),whiteX:he(e,t),whiteY:he(e,t)}}function ye(e,t){return[`NO_COMPRESSION`,`RLE_COMPRESSION`,`ZIPS_COMPRESSION`,`ZIP_COMPRESSION`,`PIZ_COMPRESSION`,`PXR24_COMPRESSION`,`B44_COMPRESSION`,`B44A_COMPRESSION`,`DWAA_COMPRESSION`,`DWAB_COMPRESSION`][pe(e,t)]}function be(e,t){return{xMin:fe(e,t),yMin:fe(e,t),xMax:fe(e,t),yMax:fe(e,t)}}function xe(e,t){return[`INCREASING_Y`][pe(e,t)]}function Se(e,t){return[he(e,t),he(e,t)]}function Ce(e,t){return[he(e,t),he(e,t),he(e,t)]}function we(e,t,n,r,i){if(r===`string`||r===`stringvector`||r===`iccProfile`)return z(t,n,i);if(r===`chlist`)return _e(e,t,n,i);if(r===`chromaticities`)return ve(e,n);if(r===`compression`)return ye(e,n);if(r===`box2i`)return be(e,n);if(r===`lineOrder`)return xe(e,n);if(r===`float`)return he(e,n);if(r===`v2f`)return Se(e,n);if(r===`v3f`)return Ce(e,n);if(r===`int`)return de(e,n);if(r===`rational`)return le(e,n);if(r===`timecode`)return ue(e,n);if(r===`preview`)return n.value+=i,`skipped`;n.value+=i}function Te(e,t,n){let r={};if(e.getUint32(0,!0)!=20000630)throw`THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.`;r.version=e.getUint8(4);let i=e.getUint8(5);r.spec={singleTile:!!(i&2),longName:!!(i&4),deepFormat:!!(i&8),multiPart:!!(i&16)},n.value=8;for(var a=!0;a;){var o=ce(t,n);if(o==0)a=!1;else{var s=ce(t,n),c=we(e,t,n,s,fe(e,n));c===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${s}'.`):r[o]=c}}if(i&-5)throw console.error(`EXRHeader:`,r),`THREE.EXRLoader: provided file is currently unsupported.`;return r}function Ee(e,t,n,r,i){let a={size:0,viewer:t,array:n,offset:r,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,[Rj?`colorSpace`:`encoding`]:null};switch(e.compression){case`NO_COMPRESSION`:a.lines=1,a.uncompress=L;break;case`RLE_COMPRESSION`:a.lines=1,a.uncompress=ie;break;case`ZIPS_COMPRESSION`:a.lines=1,a.uncompress=R;break;case`ZIP_COMPRESSION`:a.lines=16,a.uncompress=R;break;case`PIZ_COMPRESSION`:a.lines=32,a.uncompress=ae;break;case`PXR24_COMPRESSION`:a.lines=16,a.uncompress=oe;break;case`DWAA_COMPRESSION`:a.lines=32,a.uncompress=se;break;case`DWAB_COMPRESSION`:a.lines=256,a.uncompress=se;break;default:throw`EXRLoader.parse: `+e.compression+` is unsupported`}if(a.scanlineBlockSize=a.lines,a.type==1)switch(i){case yf:a.getter=ge,a.inputSize=2;break;case bf:a.getter=U,a.inputSize=2;break}else if(a.type==2)switch(i){case yf:a.getter=he,a.inputSize=4;break;case bf:a.getter=V,a.inputSize=4}else throw`EXRLoader.parse: unsupported pixelType `+a.type+` for `+e.compression+`.`;a.blockCount=(e.dataWindow.yMax+1)/a.scanlineBlockSize;for(var o=0;o<a.blockCount;o++)me(t,r);a.outputChannels=a.channels==3?4:a.channels;let s=a.width*a.height*a.outputChannels;switch(i){case yf:a.byteArray=new Float32Array(s),a.channels<a.outputChannels&&a.byteArray.fill(1,0,s);break;case bf:a.byteArray=new Uint16Array(s),a.channels<a.outputChannels&&a.byteArray.fill(15360,0,s);break;default:console.error(`THREE.EXRLoader: unsupported type: `,i);break}return a.bytesPerLine=a.width*a.inputSize*a.channels,a.outputChannels==4?a.format=Of:a.format=jf,Rj?a.colorSpace=`srgb-linear`:a.encoding=3e3,a}let De=new DataView(e),Oe=new Uint8Array(e),ke={value:0},Ae=Te(De,e,ke),je=Ee(Ae,De,Oe,ke,this.type),Me={value:0},Ne={R:0,G:1,B:2,A:3,Y:0};for(let e=0;e<je.height/je.scanlineBlockSize;e++){let t=fe(De,ke);je.size=fe(De,ke),je.lines=t+je.scanlineBlockSize>je.height?je.height-t:je.scanlineBlockSize;let n=je.size<je.lines*je.bytesPerLine?je.uncompress(je):L(je);ke.value+=je.size;for(let t=0;t<je.scanlineBlockSize;t++){let r=t+e*je.scanlineBlockSize;if(r>=je.height)break;for(let e=0;e<je.channels;e++){let i=Ne[Ae.channels[e].name];for(let a=0;a<je.width;a++){Me.value=(t*(je.channels*je.width)+e*je.width+a)*je.inputSize;let o=(je.height-1-r)*(je.width*je.outputChannels)+a*je.outputChannels+i;je.byteArray[o]=je.getter(n,Me)}}}}return{header:Ae,width:je.width,height:je.height,data:je.byteArray,format:je.format,[Rj?`colorSpace`:`encoding`]:je[Rj?`colorSpace`:`encoding`],type:this.t
4557ype}}setDataType(e){return this.type=e,this}load(e,t,n,r){function i(e,n){Rj?e.colorSpace=n.colorSpace:e.encoding=n.encoding,e.minFilter=cf,e.magFilter=cf,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,n)}return super.load(e,i,n,r)}};function Bj(){var e=Object.create(null);function t(n,i){var a=n.id,o=n.name,s=n.dependencies;s===void 0&&(s=[]);var c=n.init;c===void 0&&(c=function(){});var l=n.getTransferables;if(l===void 0&&(l=null),!e[a])try{s=s.map(function(n){return n&&n.isWorkerModule&&(t(n,function(e){if(e instanceof Error)throw e}),n=e[n.id].value),n}),c=r(`<`+o+`>.init`,c),l&&=r(`<`+o+`>.getTransferables`,l);var u=null;typeof c==`function`?u=c.apply(void 0,s):console.error(`worker module init function failed to rehydrate`),e[a]={id:a,value:u,getTransferables:l},i(u)}catch(e){e&&e.noLog||console.error(e),i(e)}}function n(t,n){var r,i=t.id,a=t.args;(!e[i]||typeof e[i].value!=`function`)&&n(Error(`Worker module `+i+`: not found or its 'init' did not return a function`));try{var o=(r=e[i]).value.apply(r,a);o&&typeof o.then==`function`?o.then(s,function(e){return n(e instanceof Error?e:Error(``+e))}):s(o)}catch(e){n(e)}function s(t){try{var r=e[i].getTransferables&&e[i].getTransferables(t);(!r||!Array.isArray(r)||!r.length)&&(r=void 0),n(t,r)}catch(e){console.error(e),n(e)}}}function r(e,t){var n=void 0;self.troikaDefine=function(e){return n=e};var r=URL.createObjectURL(new Blob([`/** `+e.replace(/\*/g,``)+` **/ 4558 4559troikaDefine( 4560`+t+` 4561)`],{type:`application/javascript`}));try{importScripts(r)}catch(e){console.error(e)}return URL.revokeObjectURL(r),delete self.troikaDefine,n}self.addEventListener(`message`,function(e){var r=e.data,i=r.messageId,a=r.action,o=r.data;try{a===`registerModule`&&t(o,function(e){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:{isCallable:typeof e==`function`}})}),a===`callModule`&&n(o,function(e,t){e instanceof Error?postMessage({messageId:i,success:!1,error:e.message}):postMessage({messageId:i,success:!0,result:e},t||void 0)})}catch(e){postMessage({messageId:i,success:!1,error:e.stack})}})}function Vj(e){var t=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t._getInitResult().then(function(t){if(typeof t==`function`)return t.apply(void 0,e);throw Error("Worker module function was called but `init` did not return a callable function")})};return t._getInitResult=function(){var n=e.dependencies,r=e.init;n=Array.isArray(n)?n.map(function(e){return e&&(e=e.onMainThread||e,e._getInitResult&&(e=e._getInitResult())),e}):[];var i=Promise.all(n).then(function(e){return r.apply(null,e)});return t._getInitResult=function(){return i},i},t}var Hj=function(){var e=!1;if(typeof window<`u`&&window.document!==void 0)try{new Worker(URL.createObjectURL(new Blob([``],{type:`application/javascript`}))).terminate(),e=!0}catch(e){console.log(`Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: [`+e.message+`]`)}return Hj=function(){return e},e},Uj=0,Wj=0,Gj=!1,Kj=Object.create(null),qj=Object.create(null),Jj=Object.create(null);function Yj(e){if((!e||typeof e.init!=`function`)&&!Gj)throw Error("requires `options.init` function");var t=e.dependencies,n=e.init,r=e.getTransferables,i=e.workerId,a=Vj(e);i??=`#default`;var o=`workerModule`+ ++Uj,s=e.name||o,c=null;t&&=t.map(function(e){return typeof e==`function`&&!e.workerModuleData&&(Gj=!0,e=Yj({workerId:i,name:`<`+s+`> function dependency: `+e.name,init:`function(){return ( 4562`+Zj(e)+` 4563)}`}),Gj=!1),e&&e.workerModuleData&&(e=e.workerModuleData),e});function l(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(!Hj())return a.apply(void 0,e);if(!c){c=$j(i,`registerModule`,l.workerModuleData);var n=function(){c=null,qj[i].delete(n)};(qj[i]||(qj[i]=new Set)).add(n)}return c.then(function(t){if(t.isCallable)return $j(i,`callModule`,{id:o,args:e});throw Error("Worker module function was called but `init` did not return a callable function")})}return l.workerModuleData={isWorkerModule:!0,id:o,name:s,dependencies:t,init:Zj(n),getTransferables:r&&Zj(r)},l.onMainThread=a,l}function Xj(e){qj[e]&&qj[e].forEach(function(e){e()}),Kj[e]&&(Kj[e].terminate(),delete Kj[e])}function Zj(e){var t=e.toString();return!/^function/.test(t)&&/^\w+\s*\(/.test(t)&&(t=`function `+t),t}function Qj(e){var t=Kj[e];if(!t){var n=Zj(Bj);t=Kj[e]=new Worker(URL.createObjectURL(new Blob([`/** Worker Module Bootstrap: `+e.replace(/\*/g,``)+` **/ 4564 4565;(`+n+`)()`],{type:`application/javascript`}))),t.onmessage=function(e){var t=e.data,n=t.messageId,r=Jj[n];if(!r)throw Error(`WorkerModule response with empty or unknown messageId`);delete Jj[n],r(t)}}return t}function $j(e,t,n){return new Promise(function(r,i){var a=++Wj;Jj[a]=function(e){e.success?r(e.result):i(Error(`Error in worker `+t+` call: `+e.error))},Qj(e).postMessage({messageId:a,action:t,data:n})})}function eM(){return function(e){function t(e,t,n,r,i,a,o,s){var c=1-o;s.x=c*c*e+2*c*o*n+o*o*i,s.y=c*c*t+2*c*o*r+o*o*a}function n(e,t,n,r,i,a,o,s,c,l){var u=1-c;l.x=u*u*u*e+3*u*u*c*n+3*u*c*c*i+c*c*c*o,l.y=u*u*u*t+3*u*u*c*r+3*u*c*c*a+c*c*c*s}function r(e,t){for(var n=/([MLQCZ])([^MLQCZ]*)/g,r,i,a,o,s;r=n.exec(e);){var c=r[2].replace(/^\s*|\s*$/g,``).split(/[,\s]+/).map(function(e){return parseFloat(e)});switch(r[1]){case`M`:o=i=c[0],s=a=c[1];break;case`L`:(c[0]!==o||c[1]!==s)&&t(`L`,o,s,o=c[0],s=c[1]);break;
4565case`Q`:t(`Q`,o,s,o=c[2],s=c[3],c[0],c[1]);break;case`C`:t(`C`,o,s,o=c[4],s=c[5],c[0],c[1],c[2],c[3]);break;case`Z`:(o!==i||s!==a)&&t(`L`,o,s,i,a);break}}}function i(e,i,a){a===void 0&&(a=16);var o={x:0,y:0};r(e,function(e,r,s,c,l,u,d,f,p){switch(e){case`L`:i(r,s,c,l);break;case`Q`:for(var m=r,h=s,g=1;g<a;g++)t(r,s,u,d,c,l,g/(a-1),o),i(m,h,o.x,o.y),m=o.x,h=o.y;break;case`C`:for(var _=r,v=s,y=1;y<a;y++)n(r,s,u,d,f,p,c,l,y/(a-1),o),i(_,v,o.x,o.y),_=o.x,v=o.y;break}})}var a=`precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}`,o=`precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}`,s=new WeakMap,c={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function l(e,t){var n=e.getContext?e.getContext(`webgl`,c):e,r=s.get(n);if(!r){var i=typeof WebGL2RenderingContext<`u`&&n instanceof WebGL2RenderingContext,a={},o={},l={},u=-1,d=[];n.canvas.addEventListener(`webglcontextlost`,function(e){m(),e.preventDefault()},!1);function e(e){var t=a[e];if(!t&&(t=a[e]=n.getExtension(e),!t))throw Error(e+` not supported`);return t}function t(e,t){var r=n.createShader(t);return n.shaderSource(r,e),n.compileShader(r),r}function c(r,a,s,c){if(!o[r]){var l={},u={},d=n.createProgram();n.attachShader(d,t(a,n.VERTEX_SHADER)),n.attachShader(d,t(s,n.FRAGMENT_SHADER)),n.linkProgram(d),o[r]={program:d,transaction:function(t){n.useProgram(d),t({setUniform:function(e,t){for(var r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];var a=u[t]||(u[t]=n.getUniformLocation(d,t));n[`uniform`+e].apply(n,[a].concat(r))},setAttribute:function(t,r,a,o,s){var c=l[t];c||=l[t]={buf:n.createBuffer(),loc:n.getAttribLocation(d,t),data:null},n.bindBuffer(n.ARRAY_BUFFER,c.buf),n.vertexAttribPointer(c.loc,r,n.FLOAT,!1,0,0),n.enableVertexAttribArray(c.loc),i?n.vertexAttribDivisor(c.loc,o):e(`ANGLE_instanced_arrays`).vertexAttribDivisorANGLE(c.loc,o),s!==c.data&&(n.bufferData(n.ARRAY_BUFFER,s,a),c.data=s)}})}}}o[r].transaction(c)}function f(e,t){u++;try{n.activeTexture(n.TEXTURE0+u);var r=l[e];r||(r=l[e]=n.createTexture(),n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.bindTexture(n.TEXTURE_2D,r),t(r,u)}finally{u--}}function p(e,t,r){var i=n.createFramebuffer();d.push(i),n.bindFramebuffer(n.FRAMEBUFFER,i),n.activeTexture(n.TEXTURE0+t),n.bindTexture(n.TEXTURE_2D,e),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);try{r(i)}finally{n.deleteFramebuffer(i),n.bindFramebuffer(n.FRAMEBUFFER,d[--d.length-1]||null)}}function m(){a={},o={},l={},u=-1,d.length=0}s.set(n,r={gl:n,isWebGL2:i,getExtension:e,withProgram:c,withTexture:f,withTextureFramebuffer:p,handleContextLoss:m})}t(r)}function u(e,t,n,r,i,s,c,u){c===void 0&&(c=15),u===void 0&&(u=null),l(e,function(e){var l=e.gl,d=e.withProgram,f=e.withTexture;f(`copy`,function(e,f){l.texImage2D(l.TEXTURE_2D,0,l.RGBA,i,s,0,l.RGBA,l.UNSIGNED_BYTE,t),d(`copy`,a,o,function(e){var t=e.setUniform,a=e.setAttribute;a(`aUV`,2,l.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),t(`1i`,`image`,f),l.bindFramebuffer(l.FRAMEBUFFER,u||null),l.disable(l.BLEND),l.colorMask(c&8,c&4,c&2,c&1),l.viewport(n,r,i,s),l.scissor(n,r,i,s),l.drawArrays(l.TRIANGLES,0,3)})})})}function d(e,t,n){var r=e.width,i=e.height;l(e,function(a){var o=a.gl,s=new Uint8Array(r*i*4);o.readPixels(0,0,r,i,o.RGBA,o.UNSIGNED_BYTE,s),e.width=t,e.height=n,u(o,s,0,0,r,i)})}var f=Object.freeze({__proto__:null,withWebGLContext:l,renderImageData:u,resizeWebGLCanvasWithoutClearing:d});function p(e,t,n,r,a,o){o===void 0&&(o=1);var s=new Uint8Array(e*t),c=r[2]-r[0],l=r[3]-r[1],u=[];i(n,function(e,t,n,r){u.push({x1:e,y1:t,x2:n,y2:r,minX:Math.min(e,n),minY:Math.min(t,r),maxX:Math.max(e,n),maxY:Math.max(t,r)})}),u.sort(function(e,t){return e.maxX-t.maxX});for(var d=0;d<e;d++)for(var f=0;f<t;f++){var p=h(r[0]+c*(d+.5)/e,r[1]+l*(f+.5)/t),m=(1-Math.abs(p)/a)**o/2;p<0&&(m=1-m),m=Math.max(0,Math.min(255,Math.round(m*255))),s[f*e+d]=m}return s;function h(e,t){for(var n=1/0,r=1/0,i=u.length;i--;){var a=u[i];if(a.maxX+r<=e)break;if(e+r>a.minX&&t-r<a.maxY&&t+r>a.minY){var o=g(e,t,a.x1,a.y1,a.x2,a.y2);o<n&&(n=o,r=Math.sqrt(n))}}return _(e,t)&&(r=-r),r}function _(e,t){for(var n=0,r=u.length;r--;){var i=u[r];if(i.maxX<=e)break;i.y1>t!=i.y2>t&&e<(i.x2-i.x1)*(t-i.y1)/(i.y2-i.y1)+i.x1&&(n+=i.y1<i.y2?1:-1)}return n!==0}}function m(e,t,n,r,i,a,o,s,c,l){a===void 0&&(a=1),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l=0),h(e,t,n,r,i,a,o,null,s,c,l)}function h(e,t,n,r,i,a,o,s,c,l,d){a===void 0&&(a=1),c===void 0&&(c=0),l===void 0&&(l=0),d===void 0&&(d=0);for(var f=p(e,t,n,r,i,a),m=new Uint8Array(f.length*4),h=0;h<f.length;h++)m[h*4+d]=f[h];u(o,m,c,l,e,t,1<<3-d,s)}function g(e,t,n,r,i,a){var o=i-n,s=a-r,c=o*o+s*s,l=c?Math.max(0,Math.min(1,((e-n)*o+(t-r)*s)/c)):0,u=e-(n+l*o),d=t-(r+l*s);return u*u+d*d}var _=Object.freeze({__proto__:null,generate:p,generateIntoCanvas:m,generateIntoFramebuffer:h}),v=`precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}`,y=`precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);
4565float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}`,b=`precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}`,x=new Float32Array([0,0,2,0,0,2]),S=null,C=!1,w={},T=new WeakMap;function E(e){if(!C&&!A(e))throw Error(`WebGL generation not supported`)}function D(e,t,n,r,i,a,o){if(a===void 0&&(a=1),o===void 0&&(o=null),!o&&(o=S,!o)){var s=typeof OffscreenCanvas==`function`?new OffscreenCanvas(1,1):typeof document<`u`?document.createElement(`canvas`):null;if(!s)throw Error(`OffscreenCanvas or DOM canvas not supported`);o=S=s.getContext(`webgl`,{depth:!1})}E(o);var c=new Uint8Array(e*t*4);l(o,function(o){var s=o.gl,l=o.withTexture,u=o.withTextureFramebuffer;l(`readable`,function(o,l){s.texImage2D(s.TEXTURE_2D,0,s.RGBA,e,t,0,s.RGBA,s.UNSIGNED_BYTE,null),u(o,l,function(o){k(e,t,n,r,i,a,s,o,0,0,0),s.readPixels(0,0,e,t,s.RGBA,s.UNSIGNED_BYTE,c)})})});for(var u=new Uint8Array(e*t),d=0,f=0;d<c.length;d+=4)u[f++]=c[d];return u}function O(e,t,n,r,i,a,o,s,c,l){a===void 0&&(a=1),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l=0),k(e,t,n,r,i,a,o,null,s,c,l)}function k(e,t,n,r,o,s,c,u,d,f,p){s===void 0&&(s=1),d===void 0&&(d=0),f===void 0&&(f=0),p===void 0&&(p=0),E(c);var m=[];i(n,function(e,t,n,r){m.push(e,t,n,r)}),m=new Float32Array(m),l(c,function(n){var i=n.gl,c=n.isWebGL2,l=n.getExtension,h=n.withProgram,g=n.withTexture,_=n.withTextureFramebuffer,S=n.handleContextLoss;if(g(`rawDistances`,function(n,g){(e!==n._lastWidth||t!==n._lastHeight)&&i.texImage2D(i.TEXTURE_2D,0,i.RGBA,n._lastWidth=e,n._lastHeight=t,0,i.RGBA,i.UNSIGNED_BYTE,null),h(`main`,v,y,function(a){var u=a.setAttribute,d=a.setUniform,f=!c&&l(`ANGLE_instanced_arrays`),p=!c&&l(`EXT_blend_minmax`);u(`aUV`,2,i.STATIC_DRAW,0,x),u(`aLineSegment`,4,i.DYNAMIC_DRAW,1,m),d.apply(void 0,[`4f`,`uGlyphBounds`].concat(r)),d(`1f`,`uMaxDistance`,o),d(`1f`,`uExponent`,s),_(n,g,function(n){i.enable(i.BLEND),i.colorMask(!0,!0,!0,!0),i.viewport(0,0,e,t),i.scissor(0,0,e,t),i.blendFunc(i.ONE,i.ONE),i.blendEquationSeparate(i.FUNC_ADD,c?i.MAX:p.MAX_EXT),i.clear(i.COLOR_BUFFER_BIT),c?i.drawArraysInstanced(i.TRIANGLES,0,3,m.length/4):f.drawArraysInstancedANGLE(i.TRIANGLES,0,3,m.length/4)})}),h(`post`,a,b,function(n){n.setAttribute(`aUV`,2,i.STATIC_DRAW,0,x),n.setUniform(`1i`,`tex`,g),i.bindFramebuffer(i.FRAMEBUFFER,u),i.disable(i.BLEND),i.colorMask(p===0,p===1,p===2,p===3),i.viewport(d,f,e,t),i.scissor(d,f,e,t),i.drawArrays(i.TRIANGLES,0,3)})}),i.isContextLost())throw S(),Error(`webgl context lost`)})}function A(e){var t=!e||e===S?w:e.canvas||e,n=T.get(t);if(n===void 0){C=!0;var r=null;try{var i=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],a=D(4,4,`M8,8L16,8L24,24L16,24Z`,[0,0,32,32],24,1,e);n=a&&i.length===a.length&&a.every(function(e,t){return e===i[t]}),n||(r=`bad trial run results`,console.info(i,a))}catch(e){n=!1,r=e.message}r&&console.warn(`WebGL SDF generation not supported:`,r),C=!1,T.set(t,n)}return n}var j=Object.freeze({__proto__:null,generate:D,generateIntoCanvas:O,generateIntoFramebuffer:k,isSupported:A});function ee(e,t,n,r,i,a){i===void 0&&(i=Math.max(r[2]-r[0],r[3]-r[1])/2),a===void 0&&(a=1);try{return D.apply(j,arguments)}catch(e){return console.info(`WebGL SDF generation failed, falling back to JS`,e),p.apply(_,arguments)}}function M(e,t,n,r,i,a,o,s,c,l){i===void 0&&(i=Math.max(r[2]-r[0],r[3]-r[1])/2),a===void 0&&(a=1),s===void 0&&(s=0),c===void 0&&(c=0),l===void 0&&(l=0);try{return O.apply(j,arguments)}catch(e){return console.info(`WebGL SDF generation failed, falling back to JS`,e),m.apply(_,arguments)}}return e.forEachPathCommand=r,e.generate=ee,e.generateIntoCanvas=M,e.javascript=_,e.pathToLineSegments=i,e.webgl=j,e.webglUtils=f,Object.defineProperty(e,`__esModule`,{value:!0}),e}({})}function tM(){return function(e){var t={R:`13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73`,EN:`1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9`,
vendor: 4,313 bytes, line 4565
4565ES:`17,2,6dp+1,f+1,av,16vr,mx+1,4o,2`,ET:`z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj`,AN:`16o+5,2j+9,2+1,35,ed,1ff2+9,87+u`,CS:`18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b`,B:`a,3,f+2,2v,690`,S:`9,2,k`,WS:`c,k,4f4,1vk+a,u,1j,335`,ON:`x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i`,BN:`0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1`,NSM:`lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n`,AL:`16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d`,LRO:`6ct`,RLO:`6cu`,LRE:`6cq`,RLE:`6cr`,PDF:`6cs`,LRI:`6ee`,RLI:`6ef`,FSI:`6eg`,PDI:`6eh`},n={},r={};n.L=1,r[1]=`L`,Object.keys(t).forEach(function(e,t){n[e]=1<<t+1,r[n[e]]=e}),Object.freeze(n);var i=n.LRI|n.RLI|n.FSI,a=n.L|n.R|n.AL,o=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,s=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,c=n.S|n.WS|n.B|i|n.PDI|s,l=null;function u(){if(!l){l=new Map;var e=function(e){if(t.hasOwnProperty(e)){var r=0;t[e].split(`,`).forEach(function(t){var i=t.split(`+`),a=i[0],o=i[1];a=parseInt(a,36),o=o?parseInt(o,36):0,l.set(r+=a,n[e]);for(var s=0;s<o;s++)l.set(++r,n[e])})}};for(var r in t)e(r)}}function d(e){return u(),l.get(e.codePointAt(0))||n.L}function f(e){return r[d(e)]}var p={pairs:`14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1`,canonical:`6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye`};function m(e,t){var n=36,r=0,i=new Map,a=t&&new Map,o;return e.split(`,`).forEach(function e(s){if(s.indexOf(`+`)!==-1)for(var c=+s;c--;)e(o);else{o=s;var l=s.split(`>`),u=l[0],d=l[1];u=String.fromCodePoint(r+=parseInt(u,n)),d=String.fromCodePoint(r+=parseInt(d,n)),i.set(u,d),t&&a.set(d,u)}}),{map:i,reverseMap:a}}var h,g,_;function v(){if(!h){var e=m(p.pairs,!0),t=e.map,n=e.reverseMap;h=t,g=n,_=m(p.canonical,!1).map}}function y(e){return v(),h.get(e)||null}function b(e){return v(),g.get(e)||null}function x(e){return v(),_.get(e)||null}
vendor: 5,745 bytes, line 4565
4565var S=n.L,C=n.R,w=n.EN,T=n.ES,E=n.ET,D=n.AN,O=n.CS,k=n.B,A=n.S,j=n.ON,ee=n.BN,M=n.NSM,te=n.AL,N=n.LRO,P=n.RLO,F=n.LRE,I=n.RLE,ne=n.PDF,re=n.LRI,L=n.RLI,ie=n.FSI,R=n.PDI;function ae(e,t){for(var n=125,r=new Uint32Array(e.length),l=0;l<e.length;l++)r[l]=d(e[l]);var u=new Map;function f(e,t){var n=r[e];r[e]=t,u.set(n,u.get(n)-1),n&o&&u.set(o,u.get(o)-1),u.set(t,(u.get(t)||0)+1),t&o&&u.set(o,(u.get(o)||0)+1)}for(var p=new Uint8Array(e.length),m=new Map,h=[],g=null,_=0;_<e.length;_++)g||h.push(g={start:_,end:e.length-1,level:t===`rtl`?1:t===`ltr`?0:Yt(_,!1)}),r[_]&k&&(g.end=_,g=null);for(var v=I|F|P|N|i|R|ne|k,ae=function(e){return e+(e&1?1:2)},oe=function(e){return e+(e&1?2:1)},se=0;se<h.length;se++){g=h[se];var ce=[{_level:g.level,_override:0,_isolate:0}],z=void 0,le=0,ue=0,de=0;u.clear();for(var fe=g.start;fe<=g.end;fe++){var B=r[fe];if(z=ce[ce.length-1],u.set(B,(u.get(B)||0)+1),B&o&&u.set(o,(u.get(o)||0)+1),B&v)if(B&(I|F)){p[fe]=z._level;var pe=(B===I?oe:ae)(z._level);pe<=n&&!le&&!ue?ce.push({_level:pe,_override:0,_isolate:0}):le||ue++}else if(B&(P|N)){p[fe]=z._level;var me=(B===P?oe:ae)(z._level);me<=n&&!le&&!ue?ce.push({_level:me,_override:B&P?C:S,_isolate:0}):le||ue++}else if(B&i){B&ie&&(B=Yt(fe+1,!0)===1?L:re),p[fe]=z._level,z._override&&f(fe,z._override);var he=(B===L?oe:ae)(z._level);he<=n&&le===0&&ue===0?(de++,ce.push({_level:he,_override:0,_isolate:1,_isolInitIndex:fe})):le++}else if(B&R){if(le>0)le--;else if(de>0){for(ue=0;!ce[ce.length-1]._isolate;)ce.pop();var V=ce[ce.length-1]._isolInitIndex;V!=null&&(m.set(V,fe),m.set(fe,V)),ce.pop(),de--}z=ce[ce.length-1],p[fe]=z._level,z._override&&f(fe,z._override)}else B&ne?(le===0&&(ue>0?ue--:!z._isolate&&ce.length>1&&(ce.pop(),z=ce[ce.length-1])),p[fe]=z._level):B&k&&(p[fe]=g.level);else p[fe]=z._level,z._override&&B!==ee&&f(fe,z._override)}for(var H=[],U=null,ge=g.start;ge<=g.end;ge++){var _e=r[ge];if(!(_e&s)){var ve=p[ge],ye=_e&i,be=_e===R;U&&ve===U._level?(U._end=ge,U._endsWithIsolInit=ye):H.push(U={_start:ge,_end:ge,_level:ve,_startsWithPDI:be,_endsWithIsolInit:ye})}}for(var xe=[],Se=0;Se<H.length;Se++){var Ce=H[Se];if(!Ce._startsWithPDI||Ce._startsWithPDI&&!m.has(Ce._start)){for(var we=[U=Ce],Te=void 0;U&&U._endsWithIsolInit&&(Te=m.get(U._end))!=null;)for(var Ee=Se+1;Ee<H.length;Ee++)if(H[Ee]._start===Te){we.push(U=H[Ee]);break}for(var De=[],Oe=0;Oe<we.length;Oe++)for(var ke=we[Oe],Ae=ke._start;Ae<=ke._end;Ae++)De.push(Ae);for(var je=p[De[0]],Me=g.level,Ne=De[0]-1;Ne>=0;Ne--)if(!(r[Ne]&s)){Me=p[Ne];break}var Pe=De[De.length-1],Fe=p[Pe],Ie=g.level;if(!(r[Pe]&i)){for(var Le=Pe+1;Le<=g.end;Le++)if(!(r[Le]&s)){Ie=p[Le];break}}xe.push({_seqIndices:De,_sosType:Math.max(Me,je)%2?C:S,_eosType:Math.max(Ie,Fe)%2?C:S})}}for(var Re=0;Re<xe.length;Re++){var ze=xe[Re],W=ze._seqIndices,Be=ze._sosType,Ve=ze._eosType,He=p[W[0]]&1?C:S;if(u.get(M))for(var Ue=0;Ue<W.length;Ue++){var We=W[Ue];if(r[We]&M){for(var Ge=Be,Ke=Ue-1;Ke>=0;Ke--)if(!(r[W[Ke]]&s)){Ge=r[W[Ke]];break}f(We,Ge&(i|R)?j:Ge)}}if(u.get(w))for(var qe=0;qe<W.length;qe++){var Je=W[qe];if(r[Je]&w)for(var Ye=qe-1;Ye>=-1;Ye--){var Xe=Ye===-1?Be:r[W[Ye]];if(Xe&a){Xe===te&&f(Je,D);break}}}if(u.get(te))for(var Ze=0;Ze<W.length;Ze++){var Qe=W[Ze];r[Qe]&te&&f(Qe,C)}if(u.get(T)||u.get(O))for(var $e=1;$e<W.length-1;$e++){var et=W[$e];if(r[et]&(T|O)){for(var tt=0,G=0,nt=$e-1;nt>=0&&(tt=r[W[nt]],tt&s);nt--);for(var rt=$e+1;rt<W.length&&(G=r[W[rt]],G&s);rt++);tt===G&&(r[et]===T?tt===w:tt&(w|D))&&f(et,tt)}}if(u.get(w)){for(var it=0;it<W.length;it++)if(r[W[it]]&w){for(var at=it-1;at>=0&&r[W[at]]&(E|s);at--)f(W[at],w);for(it++;it<W.length&&r[W[it]]&(E|s|w);it++)r[W[it]]!==w&&f(W[it],w)}}if(u.get(E)||u.get(T)||u.get(O))for(var ot=0;ot<W.length;ot++){var st=W[ot];if(r[st]&(E|T|O)){f(st,j);for(var ct=ot-1;ct>=0&&r[W[ct]]&s;ct--)f(W[ct],j);for(var lt=ot+1;lt<W.length&&r[W[lt]]&s;lt++)f(W[lt],j)}}if(u.get(w))for(var ut=0,dt=Be;ut<W.length;ut++){var ft=W[ut],pt=r[ft];pt&w?dt===S&&f(ft,S):pt&a&&(dt=pt)}if(u.get(o)){for(var mt=C|w|D,ht=mt|S,gt=[],_t=[],vt=0;vt<W.length;vt++)if(r[W[vt]]&o){var yt=e[W[vt]],bt=void 0;if(y(yt)!==null)if(_t.length<63)_t.push({char:yt,seqIndex:vt});else break;else if((bt=b(yt))!==null)for(var xt=_t.length-1;xt>=0;xt--){var St=_t[xt].char;if(St===bt||St===b(x(yt))||y(x(St))===yt){gt.push([_t[xt].seqIndex,vt]),_t.length=xt;break}}}gt.sort(function(e,t){return e[0]-t[0]});for(var Ct=0;Ct<gt.length;Ct++){for(var wt=gt[Ct],Tt=wt[0],Et=wt[1],Dt=!1,Ot=0,kt=Tt+1;kt<Et;kt++){var At=W[kt];if(r[At]&ht){Dt=!0;var jt=r[At]&mt?C:S;if(jt===He){Ot=jt;break}}}if(Dt&&!Ot){Ot=Be;for(var Mt=Tt-1;Mt>=0;Mt--){var Nt=W[Mt];if(r[Nt]&ht){var Pt=r[Nt]&mt?C:S;Ot=Pt===He?He:Pt;break}}}if(Ot){if(r[W[Tt]]=r[W[Et]]=Ot,Ot!==He){for(var Ft=Tt+1;Ft<W.length;Ft++)if(!(r[W[Ft]]&s)){d(e[W[Ft]])&M&&(r[W[Ft]]=Ot);break}}if(Ot!==He){for(var It=Et+1;It<W.length;It++)if(!(r[W[It]]&s)){d(e[W[It]])&M&&(r[W[It]]=Ot);break}}}}for(var Lt=0;Lt<W.length;Lt++)if(r[W[Lt]]&o){for(var Rt=Lt,zt=Lt,Bt=Be,Vt=Lt-1;Vt>=0;Vt--)if(r[W[Vt]]&s)Rt=Vt;else{Bt=r[W[Vt]]&mt?C:S;break}for(var Ht=Ve,Ut=Lt+1;Ut<W.length;Ut++)if(r[W[Ut]]&(o|s))zt=Ut;else{Ht=r[W[Ut]]&mt?C:S;break}for(var Wt=Rt;Wt<=zt;Wt++)r[W[Wt]]=Bt===Ht?Bt:He;Lt=zt}}}for(var Gt=g.start;Gt<=g.end;Gt++){var Kt=p[Gt],qt=r[Gt];if(Kt&1?qt&(S|w|D)&&p[Gt]++:qt&C?p[Gt]++:qt&(D|w)&&(p[Gt]+=2),qt&s&&(p[Gt]=Gt===0?g.level:p[Gt-1]),Gt===g.end||d(e[Gt])&(A|k))for(var Jt=Gt;Jt>=0&&d(e[Jt])&c;Jt--)p[Jt]=g.level}}return{levels:p,paragraphs:h};function Yt(t,n){for(var a=t;a<e.length;a++){var o=r[a];if(o&(C|te))return 1;if(o&(k|S)||n&&o===R)return 0;if(o&i){var s=Xt(a);a=s===-1?e.length:s}}return 0}function Xt(t){for(var n=1,a=t+1;a<e.length;a++){var o=r[a];if(o&k)break;if(o&R){if(--n===0)return a}else o&i&&n++}return-1}}var oe=`14>1,j>2,t>2,u>2,1a>g,2v3>
45651,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1`,se;function ce(){if(!se){var e=m(oe,!0),t=e.map;e.reverseMap.forEach(function(e,n){t.set(n,e)}),se=t}}function z(e){return ce(),se.get(e)||null}function le(e,t,n,r){var i=e.length;n=Math.max(0,n==null?0:+n),r=Math.min(i-1,r==null?i-1:+r);for(var a=new Map,o=n;o<=r;o++)if(t[o]&1){var s=z(e[o]);s!==null&&a.set(o,s)}return a}function ue(e,t,n,r){var i=e.length;n=Math.max(0,n==null?0:+n),r=Math.min(i-1,r==null?i-1:+r);var a=[];return t.paragraphs.forEach(function(i){var o=Math.max(n,i.start),s=Math.min(r,i.end);if(o<s){for(var l=t.levels.slice(o,s+1),u=s;u>=o&&d(e[u])&c;u--)l[u]=i.level;for(var f=i.level,p=1/0,m=0;m<l.length;m++){var h=l[m];h>f&&(f=h),h<p&&(p=h|1)}for(var g=f;g>=p;g--)for(var _=0;_<l.length;_++)if(l[_]>=g){for(var v=_;_+1<l.length&&l[_+1]>=g;)_++;_>v&&a.push([v+o,_+o])}}}),a}function de(e,t,n,r){var i=fe(e,t,n,r),a=[].concat(e);return i.forEach(function(n,r){a[r]=(t.levels[n]&1?z(e[n]):null)||e[n]}),a.join(``)}function fe(e,t,n,r){for(var i=ue(e,t,n,r),a=[],o=0;o<e.length;o++)a[o]=o;return i.forEach(function(e){for(var t=e[0],n=e[1],r=a.slice(t,n+1),i=r.length;i--;)a[n-i]=r[i]}),a}return e.closingToOpeningBracket=b,e.getBidiCharType=d,e.getBidiCharTypeName=f,e.getCanonicalBracket=x,e.getEmbeddingLevels=ae,e.getMirroredCharacter=z,e.getMirroredCharactersMap=le,e.getReorderSegments=ue,e.getReorderedIndices=fe,e.getReorderedString=de,e.openingToClosingBracket=y,Object.defineProperty(e,`__esModule`,{value:!0}),e}({})}var nM=tM,rM=/\bvoid\s+main\s*\(\s*\)\s*{/g;function iM(e){let t=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(e,t){let n=aT[t];return n?iM(n):e}return e.replace(t,n)}var aM=[];for(let e=0;e<256;e++)aM[e]=(e<16?`0`:``)+e.toString(16);function oM(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(aM[e&255]+aM[e>>8&255]+aM[e>>16&255]+aM[e>>24&255]+`-`+aM[t&255]+aM[t>>8&255]+`-`+aM[t>>16&15|64]+aM[t>>24&255]+`-`+aM[n&63|128]+aM[n>>8&255]+`-`+aM[n>>16&255]+aM[n>>24&255]+aM[r&255]+aM[r>>8&255]+aM[r>>16&255]+aM[r>>24&255]).toUpperCase()}var sM=Object.assign||function(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++){let n=arguments[t];if(n)for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},cM=Date.now(),lM=new WeakMap,uM=new Map,dM=1e10;function fM(e,t){let n=vM(t),r=lM.get(e);if(r||lM.set(e,r=Object.create(null)),r[n])return new r[n];let i=`_onBeforeCompile${n}`,a=function(r,a){e.onBeforeCompile.call(this,r,a);let o=this.customProgramCacheKey()+`|`+r.vertexShader+`|`+r.fragmentShader,s=uM[o];s||=uM[o]=pM(this,r,t,n),r.vertexShader=s.vertexShader,r.fragmentShader=s.fragmentShader,sM(r.uniforms,this.uniforms),t.timeUniform&&(r.uniforms[t.timeUniform]={get value(){return Date.now()-cM}}),this[i]&&this[i](r)},o=function(){return s(t.chained?e:e.clone())},s=function(r){let i=Object.create(r,c);return Object.defineProperty(i,`baseMaterial`,{value:e}),Object.defineProperty(i,`id`,{value:dM++}),i.uuid=oM(),i.uniforms=sM({},r.uniforms,t.uniforms),i.defines=sM({},r.defines,t.defines),i.defines[`TROIKA_DERIVED_MATERIAL_${n}`]=``,i.extensions=sM({},r.extensions,t.extensions),i._listeners=void 0,i},c={constructor:{value:o},isDerivedMaterial:{value:!0},type:{get:()=>e.type,set:t=>{e.type=t}},isDerivedFrom:{writable:!0,configurable:!0,value:function(e){let t=this.baseMaterial;return e===t||t.isDerivedMaterial&&t.isDerivedFrom(e)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return e.customProgramCacheKey()+`|`+n}},onBeforeCompile:{get(){return a},set(e){this[i]=e}},copy:{writable:!0,configurable:!0,value:function(t){return e.copy.call(this,t),!e.isShaderMaterial&&!e.isDerivedMaterial&&(sM(this.extensions,t.extensions),sM(this.defines,t.defines),sM(this.uniforms,N_.clone(t.uniforms)
4565)),this}},clone:{writable:!0,configurable:!0,value:function(){return s(new e.constructor).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let n=this._depthMaterial;return n||(n=this._depthMaterial=fM(e.isDerivedMaterial?e.getDepthMaterial():new Jx({depthPacking:jp}),t),n.defines.IS_DEPTH_MATERIAL=``,n.uniforms=this.uniforms),n}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let n=this._distanceMaterial;return n||(n=this._distanceMaterial=fM(e.isDerivedMaterial?e.getDistanceMaterial():new Yx,t),n.defines.IS_DISTANCE_MATERIAL=``,n.uniforms=this.uniforms),n}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:t,_distanceMaterial:n}=this;t&&t.dispose(),n&&n.dispose(),e.dispose.call(this)}}};return r[n]=o,new o}function pM(e,{vertexShader:t,fragmentShader:n},r,i){let{vertexDefs:a,vertexMainIntro:o,vertexMainOutro:s,vertexTransform:c,fragmentDefs:l,fragmentMainIntro:u,fragmentMainOutro:d,fragmentColorTransform:f,customRewriter:p,timeUniform:m}=r;if(a||=``,o||=``,s||=``,l||=``,u||=``,d||=``,(c||p)&&(t=iM(t)),(f||p)&&(n=n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,` 4566//!BEGIN_POST_CHUNK $1 4567$& 4568//!END_POST_CHUNK 4569`),n=iM(n)),p){let e=p({vertexShader:t,fragmentShader:n});t=e.vertexShader,n=e.fragmentShader}if(f){let e=[];n=n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,t=>(e.push(t),``)),d=`${f}\n${e.join(` 4570`)}\n${d}`}if(m){let e=`\nuniform float ${m};\n`;a=e+a,l=e+l}return c&&(t=`vec3 troika_position_${i}; 4571vec3 troika_normal_${i}; 4572vec2 troika_uv_${i}; 4573${t} 4574`,a=`${a} 4575void troikaVertexTransform${i}(inout vec3 position, inout vec3 normal, inout vec2 uv) { 4576 ${c} 4577} 4578`,o=` 4579troika_position_${i} = vec3(position); 4580troika_normal_${i} = vec3(normal); 4581troika_uv_${i} = vec2(uv); 4582troikaVertexTransform${i}(troika_position_${i}, troika_normal_${i}, troika_uv_${i}); 4583${o} 4584`,t=t.replace(/\b(position|normal|uv)\b/g,(e,t,n,r)=>/\battribute\s+vec[23]\s+$/.test(r.substr(0,n))?t:`troika_${t}_${i}`),e.map&&e.map.channel>0||(t=t.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),t=mM(t,i,a,o,s),n=mM(n,i,l,u,d),{vertexShader:t,fragmentShader:n}}function mM(e,t,n,r,i){return(r||i||n)&&(e=e.replace(rM,` 4585${n} 4586void troikaOrigMain${t}() {`),e+=` 4587void main() { 4588 ${r} 4589 troikaOrigMain${t}(); 4590 ${i} 4591}`),e}function hM(e,t){return e===`uniforms`?void 0:typeof t==`function`?t.toString():t}var gM=0,_M=new Map;function vM(e){let t=JSON.stringify(e,hM),n=_M.get(t);return n??_M.set(t,n=++gM),n}function yM(){return typeof window>`u`&&(self.window=self),function(e){var t={parse:function(e){var n=t._bin,r=new Uint8Array(e);if(n.readASCII(r,0,4)==`ttcf`){var i=4;n.readUshort(r,i),i+=2,n.readUshort(r,i),i+=2;var a=n.readUint(r,i);i+=4;for(var o=[],s=0;s<a;s++){var c=n.readUint(r,i);i+=4,o.push(t._readFont(r,c))}return o}return[t._readFont(r,0)]},_readFont:function(e,n){var r=t._bin,i=n;r.readFixed(e,n),n+=4;var a=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2;for(var o=[`cmap`,`head`,`hhea`,`maxp`,`hmtx`,`name`,`OS/2`,`post`,`loca`,`glyf`,`kern`,`CFF `,`GDEF`,`GPOS`,`GSUB`,`SVG `],s={_data:e,_offset:i},c={},l=0;l<a;l++){var u=r.readASCII(e,n,4);n+=4,r.readUint(e,n),n+=4;var d=r.readUint(e,n);n+=4;var f=r.readUint(e,n);n+=4,c[u]={offset:d,length:f}}for(l=0;l<o.length;l++){var p=o[l];c[p]&&(s[p.trim()]=t[p.trim()].parse(e,c[p].offset,c[p].length,s))}return s},_tabOffset:function(e,n,r){for(var i=t._bin,a=i.readUshort(e,r+4),o=r+12,s=0;s<a;s++){var c=i.readASCII(e,o,4);o+=4,i.readUint(e,o),o+=4;var l=i.readUint(e,o);if(o+=4,i.readUint(e,o),o+=4,c==n)return l}return 0}};t._bin={readFixed:function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<8|e[t+3])/65540},readF2dot14:function(e,n){return t._bin.readShort(e,n)/16384},readInt:function(e,n){return t._bin._view(e).getInt32(n)},readInt8:function(e,n){return t._bin._view(e).getInt8(n)},readShort:function(e,n){return t._bin._view(e).getInt16(n)},readUshort:function(e,n){return t._bin._view(e).getUint16(n)},readUshorts:function(e,n,r){for(var i=[],a=0;a<r;a++)i.push(t._bin.readUshort(e,n+2*a));return i},readUint:function(e,n){return t._bin._view(e).getUint32(n)},readUint64:function(e,n){return 4294967296*t._bin.readUint(e,n)+t._bin.readUint(e,n+4)},readASCII:function(e,t,n){for(var r=``,i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},readUnicode:function(e,t,n){for(var r=``,i=0;i<n;i++){var a=e[t++]<<8|e[t++];r+=String.fromCharCode(a)}return r},_tdec:typeof window<`u`&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(e,n,r){var i=t._bin._tdec;
4591return i&&n==0&&r==e.length?i.decode(e):t._bin.readASCII(e,n,r)},readBytes:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e[t+i]);return r},readASCIIArray:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(String.fromCharCode(e[t+i]));return r},_view:function(e){return e._dataView||=e.buffer?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(new Uint8Array(e).buffer)}},t._lctf={},t._lctf.parse=function(e,n,r,i,a){var o=t._bin,s={},c=n;o.readFixed(e,n),n+=4;var l=o.readUshort(e,n);n+=2;var u=o.readUshort(e,n);n+=2;var d=o.readUshort(e,n);return n+=2,s.scriptList=t._lctf.readScriptList(e,c+l),s.featureList=t._lctf.readFeatureList(e,c+u),s.lookupList=t._lctf.readLookupList(e,c+d,a),s},t._lctf.readLookupList=function(e,n,r){var i=t._bin,a=n,o=[],s=i.readUshort(e,n);n+=2;for(var c=0;c<s;c++){var l=i.readUshort(e,n);n+=2;var u=t._lctf.readLookupTable(e,a+l,r);o.push(u)}return o},t._lctf.readLookupTable=function(e,n,r){var i=t._bin,a=n,o={tabs:[]};o.ltype=i.readUshort(e,n),n+=2,o.flag=i.readUshort(e,n),n+=2;var s=i.readUshort(e,n);n+=2;for(var c=o.ltype,l=0;l<s;l++){var u=i.readUshort(e,n);n+=2;var d=r(e,c,a+u,o);o.tabs.push(d)}return o},t._lctf.numOfOnes=function(e){for(var t=0,n=0;n<32;n++)e>>>n&1&&t++;return t},t._lctf.readClassDef=function(e,n){var r=t._bin,i=[],a=r.readUshort(e,n);if(n+=2,a==1){var o=r.readUshort(e,n);n+=2;var s=r.readUshort(e,n);n+=2;for(var c=0;c<s;c++)i.push(o+c),i.push(o+c),i.push(r.readUshort(e,n)),n+=2}if(a==2){var l=r.readUshort(e,n);for(n+=2,c=0;c<l;c++)i.push(r.readUshort(e,n)),n+=2,i.push(r.readUshort(e,n)),n+=2,i.push(r.readUshort(e,n)),n+=2}return i},t._lctf.getInterval=function(e,t){for(var n=0;n<e.length;n+=3){var r=e[n],i=e[n+1];if(e[n+2],r<=t&&t<=i)return n}return-1},t._lctf.readCoverage=function(e,n){var r=t._bin,i={};i.fmt=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);return n+=2,i.fmt==1&&(i.tab=r.readUshorts(e,n,a)),i.fmt==2&&(i.tab=r.readUshorts(e,n,3*a)),i},t._lctf.coverageIndex=function(e,n){var r=e.tab;if(e.fmt==1)return r.indexOf(n);if(e.fmt==2){var i=t._lctf.getInterval(r,n);if(i!=-1)return r[i+2]+(n-r[i])}return-1},t._lctf.readFeatureList=function(e,n){var r=t._bin,i=n,a=[],o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readASCII(e,n,4);n+=4;var l=r.readUshort(e,n);n+=2;var u=t._lctf.readFeatureTable(e,i+l);u.tag=c.trim(),a.push(u)}return a},t._lctf.readFeatureTable=function(e,n){var r=t._bin,i=n,a={},o=r.readUshort(e,n);n+=2,o>0&&(a.featureParams=i+o);var s=r.readUshort(e,n);n+=2,a.tab=[];for(var c=0;c<s;c++)a.tab.push(r.readUshort(e,n+2*c));return a},t._lctf.readScriptList=function(e,n){var r=t._bin,i=n,a={},o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readASCII(e,n,4);n+=4;var l=r.readUshort(e,n);n+=2,a[c.trim()]=t._lctf.readScriptTable(e,i+l)}return a},t._lctf.readScriptTable=function(e,n){var r=t._bin,i=n,a={},o=r.readUshort(e,n);n+=2,o>0&&(a.default=t._lctf.readLangSysTable(e,i+o));var s=r.readUshort(e,n);n+=2;for(var c=0;c<s;c++){var l=r.readASCII(e,n,4);n+=4;var u=r.readUshort(e,n);n+=2,a[l.trim()]=t._lctf.readLangSysTable(e,i+u)}return a},t._lctf.readLangSysTable=function(e,n){var r=t._bin,i={};r.readUshort(e,n),n+=2,i.reqFeature=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);return n+=2,i.features=r.readUshorts(e,n,a),i},t.CFF={},t.CFF.parse=function(e,n,r){var i=t._bin;(e=new Uint8Array(e.buffer,n,r))[n=0],e[++n],e[++n],e[++n],n++;var a=[];n=t.CFF.readIndex(e,n,a);for(var o=[],s=0;s<a.length-1;s++)o.push(i.readASCII(e,n+a[s],a[s+1]-a[s]));n+=a[a.length-1];var c=[];n=t.CFF.readIndex(e,n,c);var l=[];for(s=0;s<c.length-1;s++)l.push(t.CFF.readDict(e,n+c[s],n+c[s+1]));n+=c[c.length-1];var u=l[0],d=[];n=t.CFF.readIndex(e,n,d);var f=[];for(s=0;s<d.length-1;s++)f.push(i.readASCII(e,n+d[s],d[s+1]-d[s]));if(n+=d[d.length-1],t.CFF.readSubrs(e,n,u),u.CharStrings){n=u.CharStrings,d=[],n=t.CFF.readIndex(e,n,d);var p=[];for(s=0;s<d.length-1;s++)p.push(i.readBytes(e,n+d[s],d[s+1]-d[s]));u.CharStrings=p}if(u.ROS){n=u.FDArray;var m=[];for(n=t.CFF.readIndex(e,n,m),u.FDArray=[],s=0;s<m.length-1;s++){var h=t.CFF.readDict(e,n+m[s],n+m[s+1]);t.CFF._readFDict(e,h,f),u.FDArray.push(h)}n+=m[m.length-1],n=u.FDSelect,u.FDSelect=[];var g=e[n];if(n++,g!=3)throw g;var _=i.readUshort(e,n);for(n+=2,s=0;s<_+1;s++)u.FDSelect.push(i.readUshort(e,n),e[n+2]),n+=3}return u.Encoding&&=t.CFF.readEncoding(e,u.Encoding,u.CharStrings.length),u.charset&&=t.CFF.readCharset(e,u.charset,u.CharStrings.length),t.CFF._readFDict(e,u,f),u},t.CFF._readFDict=function(e,n,r){var i;for(var a in n.Private&&(i=n.Private[1],n.Private=t.CFF.readDict(e,i,i+n.Private[0]),n.Private.Subrs&&t.CFF.readSubrs(e,i+n.Private.Subrs,n.Private)),n)[`FamilyName`,`FontName`,`FullName`,`Notice`,`version`,`Copyright`].indexOf(a)!=-1&&(n[a]=r[n[a]-426+35])},t.CFF.readSubrs=function(e,n,r){var i=t._bin,a=[];n=t.CFF.readIndex(e,n,a);var o,s=a.length;o=s<1240?107:s<33900?1131:32768,r.Bias=o,r.Subrs=[];for(var c=0;c<a.length-1;c++)r.Subrs.push(i.readBytes(e,n+a[c],a[c+1]-a[c]))},t.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],t.CFF.glyphByUnicode=function(e,t){for(var n=0;n<e.charset.length;n++)if(e.charset[n]==t)return n;return-1},t.CFF.glyphBySE=function(e,n){return n<0||n>
4591255?-1:t.CFF.glyphByUnicode(e,t.CFF.tableSE[n])},t.CFF.readEncoding=function(e,n,r){t._bin;var i=[`.notdef`],a=e[n];if(n++,a!=0)throw`error: unknown encoding format: `+a;var o=e[n];n++;for(var s=0;s<o;s++)i.push(e[n+s]);return i},t.CFF.readCharset=function(e,n,r){var i=t._bin,a=[`.notdef`],o=e[n];if(n++,o==0)for(var s=0;s<r;s++){var c=i.readUshort(e,n);n+=2,a.push(c)}else{if(o!=1&&o!=2)throw`error: format: `+o;for(;a.length<r;){c=i.readUshort(e,n),n+=2;var l=0;for(o==1?(l=e[n],n++):(l=i.readUshort(e,n),n+=2),s=0;s<=l;s++)a.push(c),c++}}return a},t.CFF.readIndex=function(e,n,r){var i=t._bin,a=i.readUshort(e,n)+1,o=e[n+=2];if(n++,o==1)for(var s=0;s<a;s++)r.push(e[n+s]);else if(o==2)for(s=0;s<a;s++)r.push(i.readUshort(e,n+2*s));else if(o==3)for(s=0;s<a;s++)r.push(16777215&i.readUint(e,n+3*s-1));else if(a!=1)throw`unsupported offset size: `+o+`, count: `+a;return(n+=a*o)-1},t.CFF.getCharString=function(e,n,r){var i=t._bin,a=e[n],o=e[n+1];e[n+2],e[n+3],e[n+4];var s=1,c=null,l=null;a<=20&&(c=a,s=1),a==12&&(c=100*a+o,s=2),21<=a&&a<=27&&(c=a,s=1),a==28&&(l=i.readShort(e,n+1),s=3),29<=a&&a<=31&&(c=a,s=1),32<=a&&a<=246&&(l=a-139,s=1),247<=a&&a<=250&&(l=256*(a-247)+o+108,s=2),251<=a&&a<=254&&(l=256*-(a-251)-o-108,s=2),a==255&&(l=i.readInt(e,n+1)/65535,s=5),r.val=l??`o`+c,r.size=s},t.CFF.readCharString=function(e,n,r){for(var i=n+r,a=t._bin,o=[];n<i;){var s=e[n],c=e[n+1];e[n+2],e[n+3],e[n+4];var l=1,u=null,d=null;s<=20&&(u=s,l=1),s==12&&(u=100*s+c,l=2),s!=19&&s!=20||(u=s,l=2),21<=s&&s<=27&&(u=s,l=1),s==28&&(d=a.readShort(e,n+1),l=3),29<=s&&s<=31&&(u=s,l=1),32<=s&&s<=246&&(d=s-139,l=1),247<=s&&s<=250&&(d=256*(s-247)+c+108,l=2),251<=s&&s<=254&&(d=256*-(s-251)-c-108,l=2),s==255&&(d=a.readInt(e,n+1)/65535,l=5),o.push(d??`o`+u),n+=l}return o},t.CFF.readDict=function(e,n,r){for(var i=t._bin,a={},o=[];n<r;){var s=e[n],c=e[n+1];e[n+2],e[n+3],e[n+4];var l=1,u=null,d=null;if(s==28&&(d=i.readShort(e,n+1),l=3),s==29&&(d=i.readInt(e,n+1),l=5),32<=s&&s<=246&&(d=s-139,l=1),247<=s&&s<=250&&(d=256*(s-247)+c+108,l=2),251<=s&&s<=254&&(d=256*-(s-251)-c-108,l=2),s==255)throw d=i.readInt(e,n+1)/65535,l=5,`unknown number`;if(s==30){var f=[];for(l=1;;){var p=e[n+l];l++;var m=p>>4,h=15&p;if(m!=15&&f.push(m),h!=15&&f.push(h),h==15)break}for(var g=``,_=[0,1,2,3,4,5,6,7,8,9,`.`,`e`,`e-`,`reserved`,`-`,`endOfNumber`],v=0;v<f.length;v++)g+=_[f[v]];d=parseFloat(g)}s<=21&&(u=[`version`,`Notice`,`FullName`,`FamilyName`,`Weight`,`FontBBox`,`BlueValues`,`OtherBlues`,`FamilyBlues`,`FamilyOtherBlues`,`StdHW`,`StdVW`,`escape`,`UniqueID`,`XUID`,`charset`,`Encoding`,`CharStrings`,`Private`,`Subrs`,`defaultWidthX`,`nominalWidthX`][s],l=1,s==12&&(u=[`Copyright`,`isFixedPitch`,`ItalicAngle`,`UnderlinePosition`,`UnderlineThickness`,`PaintType`,`CharstringType`,`FontMatrix`,`StrokeWidth`,`BlueScale`,`BlueShift`,`BlueFuzz`,`StemSnapH`,`StemSnapV`,`ForceBold`,0,0,`LanguageGroup`,`ExpansionFactor`,`initialRandomSeed`,`SyntheticBase`,`PostScript`,`BaseFontName`,`BaseFontBlend`,0,0,0,0,0,0,`ROS`,`CIDFontVersion`,`CIDFontRevision`,`CIDFontType`,`CIDCount`,`UIDBase`,`FDArray`,`FDSelect`,`FontName`][c],l=2)),u==null?o.push(d):(a[u]=o.length==1?o[0]:o,o=[]),n+=l}return a},t.cmap={},t.cmap.parse=function(e,n,r){e=new Uint8Array(e.buffer,n,r),n=0;var i=t._bin,a={};i.readUshort(e,n),n+=2;var o=i.readUshort(e,n);n+=2;var s=[];a.tables=[];for(var c=0;c<o;c++){var l=i.readUshort(e,n);n+=2;var u=i.readUshort(e,n);n+=2;var d=i.readUint(e,n);n+=4;var f=`p`+l+`e`+u,p=s.indexOf(d);if(p==-1){var m;p=a.tables.length,s.push(d);var h=i.readUshort(e,d);h==0?m=t.cmap.parse0(e,d):h==4?m=t.cmap.parse4(e,d):h==6?m=t.cmap.parse6(e,d):h==12?m=t.cmap.parse12(e,d):console.debug(`unknown format: `+h,l,u,d),a.tables.push(m)}if(a[f]!=null)throw`multiple tables for one platform+encoding`;a[f]=p}return a},t.cmap.parse0=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2,i.map=[];for(var o=0;o<a-6;o++)i.map.push(e[n+o]);return i},t.cmap.parse4=function(e,n){var r=t._bin,i=n,a={};a.format=r.readUshort(e,n),n+=2;var o=r.readUshort(e,n);n+=2,r.readUshort(e,n),n+=2;var s=r.readUshort(e,n);n+=2;var c=s/2;a.searchRange=r.readUshort(e,n),n+=2,a.entrySelector=r.readUshort(e,n),n+=2,a.rangeShift=r.readUshort(e,n),n+=2,a.endCount=r.readUshorts(e,n,c),n+=2*c,n+=2,a.startCount=r.readUshorts(e,n,c),n+=2*c,a.idDelta=[];for(var l=0;l<c;l++)a.idDelta.push(r.readShort(e,n)),n+=2;for(a.idRangeOffset=r.readUshorts(e,n,c),n+=2*c,a.glyphIdArray=[];n<i+o;)a.glyphIdArray.push(r.readUshort(e,n)),n+=2;return a},t.cmap.parse6=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,r.readUshort(e,n),n+=2,i.firstCode=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);n+=2,i.glyphIdArray=[];for(var o=0;o<a;o++)i.glyphIdArray.push(r.readUshort(e,n)),n+=2;return i},t.cmap.parse12=function(e,n){var r=t._bin,i={};i.format=r.readUshort(e,n),n+=2,n+=2,r.readUint(e,n),n+=4,r.readUint(e,n),n+=4;var a=r.readUint(e,n);n+=4,i.groups=[];for(var o=0;o<a;o++){var s=n+12*o,c=r.readUint(e,s+0),l=r.readUint(e,s+4),u=r.readUint(e,s+8);i.groups.push([c,l,u])}return i},t.glyf={},t.glyf.parse=function(e,t,n,r){for(var i=[],a=0;a<r.maxp.numGlyphs;a++)i.push(null);return i},t.glyf._parseGlyf=function(e,n){var r=t._bin,i=e._data,a=t._tabOffset(i,`glyf`,e._offset)+e.loca[n];if(e.loca[n]==e.loca[n+1])return null;var o={};if(o.noc=r.readShort(i,a),a+=2,o.xMin=r.readShort(i,a),a+=2,o.yMin=r.readShort(i,a),a+=2,o.xMax=r.readShort(i,a),a+=2,o.yMax=r.readShort(i,a),a+=2,o.xMin>=o.xMax||o.yMin>=o.yMax)return null;if(o.noc>0){o.endPts=[];for(var s=0;s<o.noc;s++)o.endPts.push(r.readUshort(i,a)),a+=2;var c=r.readUshort(i,a);if(a+=2,i.length-a<c)return null;o.instructions=r.readBytes(i,a,c),a+=c;var l=o.endPts[o.noc-1]+1;for(o.flags=[],s=0;s<l;s++){var u=i[a];if(a++,o.flags.push(u),8&u){var d=i[a];a++;for(var f=0;f<d;f++)o.flags.push(u),s++}}for(o.xs=[],s=0;s<l;s++){var p=(2&o.flags[s])!=0,m=(16&o.flags[s])!=0;p?(o.xs.push(m?i[a]:-i[a]),a++):m?o.xs.push(0):(o.xs.push(r.readShort(i,a)),a+=2)}for(o.ys=[],s=0;s<l;s++)p=(4&o.flags[s])!=0,m=(32&o.flags[s])!=0,p?(o.ys.push(m?i[a]:-i[a]),a++):m?o.ys.push(0):(o.ys.push(r.readShort(i,a)),a+=2);var h=0,g=0;for(s=0;s<l;s++)h+=o.xs[s],g+=o.ys[s],o.xs[s]=h,o.ys[s]=g}else{var _;o.parts=[];do{_=r.readUshort(i,a),a+=2;var v={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(o.parts.push(v),v.glyphIndex=r.readUshort(i,a),a+=2,1&_){var y=r.readShort(i,a);a+=2;var b=r.readShort(i,a);a+=2}else y=r.readInt8(i,a),a++,b=r.readInt8(i,a),a++;2&_?(v.m.tx=y,v.m.ty=b):(v.p1=y,v.p2=b),8&_?(v.m.a=v.m.d=r.readF2dot14(i,a),a+=2):64&_?(v.m.a=r.readF2dot14(i,a),a+=2,v.m.d=r.readF2dot14(i,a),a+=2):128&_&&(v.m.a=r.readF2dot14(i,a),a+=2,v.m.b=r.readF2dot14(i,a),a+=2,v.m.c=r.readF2dot14(i,a),a+=2,v.m.d=r.readF2dot14(i,a),a+=2)}while(32&_);if(256&_){var x=r.readUshort(i,a);for(a+=2,o.instr=[],s=0;s<x;s++)o.instr.push(i[a]),a++}}return o},t.GDEF={},t.GDEF.parse=function(e,n,r,i){var a=n;n+=4;var o=t._bin.readUshort(e,n);return{glyphClassDef:o===0?null:t._lctf.readClassDef(e,a+o)}},t.GPOS={},t.GPOS.parse=function(e,n,r,i){return t._lctf.parse(e,n,r,i,t.GPOS.subt)},t.GPOS.subt=function(e,n,r,i){var a=t._bin,o=r,s={};if(s.fmt=a.readUshort(e,r),r+=2,n==1||n==2||n==3||n==7||n==8&&s.fmt<=2){var c=a.readUshort(e,r);r+=2,s.coverage=t._lctf.readCoverage(e,c+o)}if(n==1&&s.fmt==1){var l=a.readUshort(e,r);r+=2,l!=0&&(s.pos=t.GPOS.readValueRecord(e,r,l))}else if(n==2&&s.fmt>=1&&s.fmt<=2){l=a.readUshort(e,r),r+=2;var u=a.readUshort(e,r);r+=2;var d=t._lctf.numOfOnes(l),f=t._lctf.numOfOnes(u);if(s.fmt==1){s.pairsets=[];var p=a.readUshort(e,r);r+=2;
4591for(var m=0;m<p;m++){var h=o+a.readUshort(e,r);r+=2;var g=a.readUshort(e,h);h+=2;for(var _=[],v=0;v<g;v++){var y=a.readUshort(e,h);h+=2,l!=0&&(T=t.GPOS.readValueRecord(e,h,l),h+=2*d),u!=0&&(E=t.GPOS.readValueRecord(e,h,u),h+=2*f),_.push({gid2:y,val1:T,val2:E})}s.pairsets.push(_)}}if(s.fmt==2){var b=a.readUshort(e,r);r+=2;var x=a.readUshort(e,r);r+=2;var S=a.readUshort(e,r);r+=2;var C=a.readUshort(e,r);for(r+=2,s.classDef1=t._lctf.readClassDef(e,o+b),s.classDef2=t._lctf.readClassDef(e,o+x),s.matrix=[],m=0;m<S;m++){var w=[];for(v=0;v<C;v++){var T=null,E=null;l!=0&&(T=t.GPOS.readValueRecord(e,r,l),r+=2*d),u!=0&&(E=t.GPOS.readValueRecord(e,r,u),r+=2*f),w.push({val1:T,val2:E})}s.matrix.push(w)}}}else if(n==4&&s.fmt==1)s.markCoverage=t._lctf.readCoverage(e,a.readUshort(e,r)+o),s.baseCoverage=t._lctf.readCoverage(e,a.readUshort(e,r+2)+o),s.markClassCount=a.readUshort(e,r+4),s.markArray=t.GPOS.readMarkArray(e,a.readUshort(e,r+6)+o),s.baseArray=t.GPOS.readBaseArray(e,a.readUshort(e,r+8)+o,s.markClassCount);else if(n==6&&s.fmt==1)s.mark1Coverage=t._lctf.readCoverage(e,a.readUshort(e,r)+o),s.mark2Coverage=t._lctf.readCoverage(e,a.readUshort(e,r+2)+o),s.markClassCount=a.readUshort(e,r+4),s.mark1Array=t.GPOS.readMarkArray(e,a.readUshort(e,r+6)+o),s.mark2Array=t.GPOS.readBaseArray(e,a.readUshort(e,r+8)+o,s.markClassCount);else{if(n==9&&s.fmt==1){var D=a.readUshort(e,r);r+=2;var O=a.readUint(e,r);if(r+=4,i.ltype==9)i.ltype=D;else if(i.ltype!=D)throw`invalid extension substitution`;return t.GPOS.subt(e,i.ltype,o+O)}console.debug(`unsupported GPOS table LookupType`,n,`format`,s.fmt)}return s},t.GPOS.readValueRecord=function(e,n,r){var i=t._bin,a=[];return a.push(1&r?i.readShort(e,n):0),n+=1&r?2:0,a.push(2&r?i.readShort(e,n):0),n+=2&r?2:0,a.push(4&r?i.readShort(e,n):0),n+=4&r?2:0,a.push(8&r?i.readShort(e,n):0),n+=8&r?2:0,a},t.GPOS.readBaseArray=function(e,n,r){var i=t._bin,a=[],o=n,s=i.readUshort(e,n);n+=2;for(var c=0;c<s;c++){for(var l=[],u=0;u<r;u++)l.push(t.GPOS.readAnchorRecord(e,o+i.readUshort(e,n))),n+=2;a.push(l)}return a},t.GPOS.readMarkArray=function(e,n){var r=t._bin,i=[],a=n,o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=t.GPOS.readAnchorRecord(e,r.readUshort(e,n+2)+a);c.markClass=r.readUshort(e,n),i.push(c),n+=4}return i},t.GPOS.readAnchorRecord=function(e,n){var r=t._bin,i={};return i.fmt=r.readUshort(e,n),i.x=r.readShort(e,n+2),i.y=r.readShort(e,n+4),i},t.GSUB={},t.GSUB.parse=function(e,n,r,i){return t._lctf.parse(e,n,r,i,t.GSUB.subt)},t.GSUB.subt=function(e,n,r,i){var a=t._bin,o=r,s={};if(s.fmt=a.readUshort(e,r),r+=2,n!=1&&n!=2&&n!=4&&n!=5&&n!=6)return null;if(n==1||n==2||n==4||n==5&&s.fmt<=2||n==6&&s.fmt<=2){var c=a.readUshort(e,r);r+=2,s.coverage=t._lctf.readCoverage(e,o+c)}if(n==1&&s.fmt>=1&&s.fmt<=2){if(s.fmt==1)s.delta=a.readShort(e,r),r+=2;else if(s.fmt==2){var l=a.readUshort(e,r);r+=2,s.newg=a.readUshorts(e,r,l),r+=2*s.newg.length}}else if(n==2&&s.fmt==1){l=a.readUshort(e,r),r+=2,s.seqs=[];for(var u=0;u<l;u++){var d=a.readUshort(e,r)+o;r+=2;var f=a.readUshort(e,d);s.seqs.push(a.readUshorts(e,d+2,f))}}else if(n==4)for(s.vals=[],l=a.readUshort(e,r),r+=2,u=0;u<l;u++){var p=a.readUshort(e,r);r+=2,s.vals.push(t.GSUB.readLigatureSet(e,o+p))}else if(n==5&&s.fmt==2){if(s.fmt==2){var m=a.readUshort(e,r);r+=2,s.cDef=t._lctf.readClassDef(e,o+m),s.scset=[];var h=a.readUshort(e,r);for(r+=2,u=0;u<h;u++){var g=a.readUshort(e,r);r+=2,s.scset.push(g==0?null:t.GSUB.readSubClassSet(e,o+g))}}}else if(n==6&&s.fmt==3){if(s.fmt==3){for(u=0;u<3;u++){l=a.readUshort(e,r),r+=2;for(var _=[],v=0;v<l;v++)_.push(t._lctf.readCoverage(e,o+a.readUshort(e,r+2*v)));r+=2*l,u==0&&(s.backCvg=_),u==1&&(s.inptCvg=_),u==2&&(s.ahedCvg=_)}l=a.readUshort(e,r),r+=2,s.lookupRec=t.GSUB.readSubstLookupRecords(e,r,l)}}else{if(n==7&&s.fmt==1){var y=a.readUshort(e,r);r+=2;var b=a.readUint(e,r);if(r+=4,i.ltype==9)i.ltype=y;else if(i.ltype!=y)throw`invalid extension substitution`;return t.GSUB.subt(e,i.ltype,o+b)}console.debug(`unsupported GSUB table LookupType`,n,`format`,s.fmt)}return s},t.GSUB.readSubClassSet=function(e,n){var r=t._bin.readUshort,i=n,a=[],o=r(e,n);n+=2;for(var s=0;s<o;s++){var c=r(e,n);n+=2,a.push(t.GSUB.readSubClassRule(e,i+c))}return a},t.GSUB.readSubClassRule=function(e,n){var r=t._bin.readUshort,i={}
4591,a=r(e,n),o=r(e,n+=2);n+=2,i.input=[];for(var s=0;s<a-1;s++)i.input.push(r(e,n)),n+=2;return i.substLookupRecords=t.GSUB.readSubstLookupRecords(e,n,o),i},t.GSUB.readSubstLookupRecords=function(e,n,r){for(var i=t._bin.readUshort,a=[],o=0;o<r;o++)a.push(i(e,n),i(e,n+2)),n+=4;return a},t.GSUB.readChainSubClassSet=function(e,n){var r=t._bin,i=n,a=[],o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readUshort(e,n);n+=2,a.push(t.GSUB.readChainSubClassRule(e,i+c))}return a},t.GSUB.readChainSubClassRule=function(e,n){for(var r=t._bin,i={},a=[`backtrack`,`input`,`lookahead`],o=0;o<a.length;o++){var s=r.readUshort(e,n);n+=2,o==1&&s--,i[a[o]]=r.readUshorts(e,n,s),n+=2*i[a[o]].length}return s=r.readUshort(e,n),n+=2,i.subst=r.readUshorts(e,n,2*s),n+=2*i.subst.length,i},t.GSUB.readLigatureSet=function(e,n){var r=t._bin,i=n,a=[],o=r.readUshort(e,n);n+=2;for(var s=0;s<o;s++){var c=r.readUshort(e,n);n+=2,a.push(t.GSUB.readLigature(e,i+c))}return a},t.GSUB.readLigature=function(e,n){var r=t._bin,i={chain:[]};i.nglyph=r.readUshort(e,n),n+=2;var a=r.readUshort(e,n);n+=2;for(var o=0;o<a-1;o++)i.chain.push(r.readUshort(e,n)),n+=2;return i},t.head={},t.head.parse=function(e,n,r){var i=t._bin,a={};return i.readFixed(e,n),n+=4,a.fontRevision=i.readFixed(e,n),n+=4,i.readUint(e,n),n+=4,i.readUint(e,n),n+=4,a.flags=i.readUshort(e,n),n+=2,a.unitsPerEm=i.readUshort(e,n),n+=2,a.created=i.readUint64(e,n),n+=8,a.modified=i.readUint64(e,n),n+=8,a.xMin=i.readShort(e,n),n+=2,a.yMin=i.readShort(e,n),n+=2,a.xMax=i.readShort(e,n),n+=2,a.yMax=i.readShort(e,n),n+=2,a.macStyle=i.readUshort(e,n),n+=2,a.lowestRecPPEM=i.readUshort(e,n),n+=2,a.fontDirectionHint=i.readShort(e,n),n+=2,a.indexToLocFormat=i.readShort(e,n),n+=2,a.glyphDataFormat=i.readShort(e,n),n+=2,a},t.hhea={},t.hhea.parse=function(e,n,r){var i=t._bin,a={};return i.readFixed(e,n),n+=4,a.ascender=i.readShort(e,n),n+=2,a.descender=i.readShort(e,n),n+=2,a.lineGap=i.readShort(e,n),n+=2,a.advanceWidthMax=i.readUshort(e,n),n+=2,a.minLeftSideBearing=i.readShort(e,n),n+=2,a.minRightSideBearing=i.readShort(e,n),n+=2,a.xMaxExtent=i.readShort(e,n),n+=2,a.caretSlopeRise=i.readShort(e,n),n+=2,a.caretSlopeRun=i.readShort(e,n),n+=2,a.caretOffset=i.readShort(e,n),n+=2,n+=8,a.metricDataFormat=i.readShort(e,n),n+=2,a.numberOfHMetrics=i.readUshort(e,n),n+=2,a},t.hmtx={},t.hmtx.parse=function(e,n,r,i){for(var a=t._bin,o={aWidth:[],lsBearing:[]},s=0,c=0,l=0;l<i.maxp.numGlyphs;l++)l<i.hhea.numberOfHMetrics&&(s=a.readUshort(e,n),n+=2,c=a.readShort(e,n),n+=2),o.aWidth.push(s),o.lsBearing.push(c);return o},t.kern={},t.kern.parse=function(e,n,r,i){var a=t._bin,o=a.readUshort(e,n);if(n+=2,o==1)return t.kern.parseV1(e,n-2,r,i);var s=a.readUshort(e,n);n+=2;for(var c={glyph1:[],rval:[]},l=0;l<s;l++){n+=2,r=a.readUshort(e,n),n+=2;var u=a.readUshort(e,n);n+=2;var d=u>>>8;if((d&=15)!=0)throw`unknown kern table format: `+d;n=t.kern.readFormat0(e,n,c)}return c},t.kern.parseV1=function(e,n,r,i){var a=t._bin;a.readFixed(e,n),n+=4;var o=a.readUint(e,n);n+=4;for(var s={glyph1:[],rval:[]},c=0;c<o;c++){a.readUint(e,n),n+=4;var l=a.readUshort(e,n);n+=2,a.readUshort(e,n),n+=2;var u=l>>>8;if((u&=15)!=0)throw`unknown kern table format: `+u;n=t.kern.readFormat0(e,n,s)}return s},t.kern.readFormat0=function(e,n,r){var i=t._bin,a=-1,o=i.readUshort(e,n);n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2,i.readUshort(e,n),n+=2;for(var s=0;s<o;s++){var c=i.readUshort(e,n);n+=2;var l=i.readUshort(e,n);n+=2;var u=i.readShort(e,n);n+=2,c!=a&&(r.glyph1.push(c),r.rval.push({glyph2:[],vals:[]}));var d=r.rval[r.rval.length-1];d.glyph2.push(l),d.vals.push(u),a=c}return n},t.loca={},t.loca.parse=function(e,n,r,i){var a=t._bin,o=[],s=i.head.indexToLocFormat,c=i.maxp.numGlyphs+1;if(s==0)for(var l=0;l<c;l++)o.push(a.readUshort(e,n+(l<<1))<<1);if(s==1)for(l=0;l<c;l++)o.push(a.readUint(e,n+(l<<2)));return o},t.maxp={},t.maxp.parse=function(e,n,r){var i=t._bin,a={},o=i.readUint(e,n);return n+=4,a.numGlyphs=i.readUshort(e,n),n+=2,o==65536&&(a.maxPoints=i.readUshort(e,n),n+=2,a.maxContours=i.readUshort(e,n),n+=2,a.maxCompositePoints=i.readUshort(e,n),n+=2,a.maxCompositeContours=i.readUshort(e,n),n+=2,a.maxZones=i.readUshort(e,n),n+=2,a.maxTwilightPoints=i.readUshort(e,n),n+=2,a.maxStorage=i.readUshort(e,n),n+=2,a.maxFunctionDefs=i.readUshort(e,n),n+=2,a.maxInstructionDefs=i.readUshort(e,n),n+=2,a.maxStackElements=i.readUshort(e,n),n+=2,a.maxSizeOfInstru
4591ctions=i.readUshort(e,n),n+=2,a.maxComponentElements=i.readUshort(e,n),n+=2,a.maxComponentDepth=i.readUshort(e,n),n+=2),a},t.name={},t.name.parse=function(e,n,r){var i=t._bin,a={};i.readUshort(e,n),n+=2;var o=i.readUshort(e,n);n+=2,i.readUshort(e,n);for(var s,c=[`copyright`,`fontFamily`,`fontSubfamily`,`ID`,`fullName`,`version`,`postScriptName`,`trademark`,`manufacturer`,`designer`,`description`,`urlVendor`,`urlDesigner`,`licence`,`licenceURL`,`---`,`typoFamilyName`,`typoSubfamilyName`,`compatibleFull`,`sampleText`,`postScriptCID`,`wwsFamilyName`,`wwsSubfamilyName`,`lightPalette`,`darkPalette`],l=n+=2,u=0;u<o;u++){var d=i.readUshort(e,n);n+=2;var f=i.readUshort(e,n);n+=2;var p=i.readUshort(e,n);n+=2;var m=i.readUshort(e,n);n+=2;var h=i.readUshort(e,n);n+=2;var g=i.readUshort(e,n);n+=2;var _,v=c[m],y=l+12*o+g;if(d==0)_=i.readUnicode(e,y,h/2);else if(d==3&&f==0)_=i.readUnicode(e,y,h/2);else if(f==0)_=i.readASCII(e,y,h);else if(f==1)_=i.readUnicode(e,y,h/2);else if(f==3)_=i.readUnicode(e,y,h/2);else{if(d!=1)throw`unknown encoding `+f+`, platformID: `+d;_=i.readASCII(e,y,h),console.debug(`reading unknown MAC encoding `+f+` as ASCII`)}var b=`p`+d+`,`+p.toString(16);a[b]??(a[b]={}),a[b][v===void 0?m:v]=_,a[b]._lang=p}for(var x in a)if(a[x].postScriptName!=null&&a[x]._lang==1033)return a[x];for(var x in a)if(a[x].postScriptName!=null&&a[x]._lang==0)return a[x];for(var x in a)if(a[x].postScriptName!=null&&a[x]._lang==3084)return a[x];for(var x in a)if(a[x].postScriptName!=null)return a[x];for(var x in a){s=x;break}return console.debug(`returning name table with languageID `+a[s]._lang),a[s]},t[`OS/2`]={},t[`OS/2`].parse=function(e,n,r){var i=t._bin.readUshort(e,n);n+=2;var a={};if(i==0)t[`OS/2`].version0(e,n,a);else if(i==1)t[`OS/2`].version1(e,n,a);else if(i==2||i==3||i==4)t[`OS/2`].version2(e,n,a);else{if(i!=5)throw`unknown OS/2 table version: `+i;t[`OS/2`].version5(e,n,a)}return a},t[`OS/2`].version0=function(e,n,r){var i=t._bin;return r.xAvgCharWidth=i.readShort(e,n),n+=2,r.usWeightClass=i.readUshort(e,n),n+=2,r.usWidthClass=i.readUshort(e,n),n+=2,r.fsType=i.readUshort(e,n),n+=2,r.ySubscriptXSize=i.readShort(e,n),n+=2,r.ySubscriptYSize=i.readShort(e,n),n+=2,r.ySubscriptXOffset=i.readShort(e,n),n+=2,r.ySubscriptYOffset=i.readShort(e,n),n+=2,r.ySuperscriptXSize=i.readShort(e,n),n+=2,r.ySuperscriptYSize=i.readShort(e,n),n+=2,r.ySuperscriptXOffset=i.readShort(e,n),n+=2,r.ySuperscriptYOffset=i.readShort(e,n),n+=2,r.yStrikeoutSize=i.readShort(e,n),n+=2,r.yStrikeoutPosition=i.readShort(e,n),n+=2,r.sFamilyClass=i.readShort(e,n),n+=2,r.panose=i.readBytes(e,n,10),n+=10,r.ulUnicodeRange1=i.readUint(e,n),n+=4,r.ulUnicodeRange2=i.readUint(e,n),n+=4,r.ulUnicodeRange3=i.readUint(e,n),n+=4,r.ulUnicodeRange4=i.readUint(e,n),n+=4,r.achVendID=[i.readInt8(e,n),i.readInt8(e,n+1),i.readInt8(e,n+2),i.readInt8(e,n+3)],n+=4,r.fsSelection=i.readUshort(e,n),n+=2,r.usFirstCharIndex=i.readUshort(e,n),n+=2,r.usLastCharIndex=i.readUshort(e,n),n+=2,r.sTypoAscender=i.readShort(e,n),n+=2,r.sTypoDescender=i.readShort(e,n),n+=2,r.sTypoLineGap=i.readShort(e,n),n+=2,r.usWinAscent=i.readUshort(e,n),n+=2,r.usWinDescent=i.readUshort(e,n),n+=2},t[`OS/2`].version1=function(e,n,r){var i=t._bin;return n=t[`OS/2`].version0(e,n,r),r.ulCodePageRange1=i.readUint(e,n),n+=4,r.ulCodePageRange2=i.readUint(e,n),n+=4},t[`OS/2`].version2=function(e,n,r){var i=t._bin;return n=t[`OS/2`].version1(e,n,r),r.sxHeight=i.readShort(e,n),n+=2,r.sCapHeight=i.readShort(e,n),n+=2,r.usDefault=i.readUshort(e,n),n+=2,r.usBreak=i.readUshort(e,n),n+=2,r.usMaxContext=i.readUshort(e,n),n+=2},t[`OS/2`].version5=function(e,n,r){var i=t._bin;return n=t[`OS/2`].version2(e,n,r),r.usLowerOpticalPointSize=i.readUshort(e,n),n+=2,r.usUpperOpticalPointSize=i.readUshort(e,n),n+=2},t.post={},t.post.parse=function(e,n,r){var i=t._bin,a={};return a.version=i.readFixed(e,n),n+=4,a.italicAngle=i.readFixed(e,n),n+=4,a.underlinePosition=i.readShort(e,n),n+=2,a.underlineThickness=i.readShort(e,n),n+=2,a},t??={},t.U??={},t.U.codeToGlyph=function(e,t){var n=e.cmap,r=-1;if(n.p0e4==null?n.p3e1==null?n.p1e0==null?n.p0e3!=null&&(r=n.p0e3):r=n.p1e0:r=n.p3e1:r=n.p0e4,r==-1)throw`
4591no familiar platform and encoding!`;var i=n.tables[r];if(i.format==0)return t>=i.map.length?0:i.map[t];if(i.format==4){for(var a=-1,o=0;o<i.endCount.length;o++)if(t<=i.endCount[o]){a=o;break}return a==-1||i.startCount[a]>t?0:65535&(i.idRangeOffset[a]==0?t+i.idDelta[a]:i.glyphIdArray[t-i.startCount[a]+(i.idRangeOffset[a]>>1)-(i.idRangeOffset.length-a)])}if(i.format==12){if(t>i.groups[i.groups.length-1][1])return 0;for(o=0;o<i.groups.length;o++){var s=i.groups[o];if(s[0]<=t&&t<=s[1])return s[2]+(t-s[0])}return 0}throw`unknown cmap table format `+i.format},t.U.glyphToPath=function(e,n){var r={cmds:[],crds:[]};if(e.SVG&&e.SVG.entries[n]){var i=e.SVG.entries[n];return i==null?r:(typeof i==`string`&&(i=t.SVG.toPath(i),e.SVG.entries[n]=i),i)}if(e.CFF){var a={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:e.CFF.Private?e.CFF.Private.defaultWidthX:0,open:!1},o=e.CFF,s=e.CFF.Private;if(o.ROS){for(var c=0;o.FDSelect[c+2]<=n;)c+=2;s=o.FDArray[o.FDSelect[c+1]].Private}t.U._drawCFF(e.CFF.CharStrings[n],a,o,s,r)}else e.glyf&&t.U._drawGlyf(n,e,r);return r},t.U._drawGlyf=function(e,n,r){var i=n.glyf[e];i??=n.glyf[e]=t.glyf._parseGlyf(n,e),i!=null&&(i.noc>-1?t.U._simpleGlyph(i,r):t.U._compoGlyph(i,n,r))},t.U._simpleGlyph=function(e,n){for(var r=0;r<e.noc;r++){for(var i=r==0?0:e.endPts[r-1]+1,a=e.endPts[r],o=i;o<=a;o++){var s=o==i?a:o-1,c=o==a?i:o+1,l=1&e.flags[o],u=1&e.flags[s],d=1&e.flags[c],f=e.xs[o],p=e.ys[o];if(o==i)if(l){if(!u){t.U.P.moveTo(n,f,p);continue}t.U.P.moveTo(n,e.xs[s],e.ys[s])}else u?t.U.P.moveTo(n,e.xs[s],e.ys[s]):t.U.P.moveTo(n,(e.xs[s]+f)/2,(e.ys[s]+p)/2);l?u&&t.U.P.lineTo(n,f,p):d?t.U.P.qcurveTo(n,f,p,e.xs[c],e.ys[c]):t.U.P.qcurveTo(n,f,p,(f+e.xs[c])/2,(p+e.ys[c])/2)}t.U.P.closePath(n)}},t.U._compoGlyph=function(e,n,r){for(var i=0;i<e.parts.length;i++){var a={cmds:[],crds:[]},o=e.parts[i];t.U._drawGlyf(o.glyphIndex,n,a);for(var s=o.m,c=0;c<a.crds.length;c+=2){var l=a.crds[c],u=a.crds[c+1];r.crds.push(l*s.a+u*s.b+s.tx),r.crds.push(l*s.c+u*s.d+s.ty)}for(c=0;c<a.cmds.length;c++)r.cmds.push(a.cmds[c])}},t.U._getGlyphClass=function(e,n){var r=t._lctf.getInterval(n,e);return r==-1?0:n[r+2]},t.U._applySubs=function(e,n,r,i){for(var a=e.length-n-1,o=0;o<r.tabs.length;o++)if(r.tabs[o]!=null){var s,c=r.tabs[o];if(!c.coverage||(s=t._lctf.coverageIndex(c.coverage,e[n]))!=-1){if(r.ltype==1)e[n],c.fmt==1?e[n]=e[n]+c.delta:e[n]=c.newg[s];else if(r.ltype==4)for(var l=c.vals[s],u=0;u<l.length;u++){var d=l[u],f=d.chain.length;if(!(f>a)){for(var p=!0,m=0,h=0;h<f;h++){for(;e[n+m+(1+h)]==-1;)m++;d.chain[h]!=e[n+m+(1+h)]&&(p=!1)}if(p){for(e[n]=d.nglyph,h=0;h<f+m;h++)e[n+h+1]=-1;break}}}else if(r.ltype==5&&c.fmt==2)for(var g=t._lctf.getInterval(c.cDef,e[n]),_=c.cDef[g+2],v=c.scset[_],y=0;y<v.length;y++){var b=v[y],x=b.input;if(!(x.length>a)){for(p=!0,h=0;h<x.length;h++){var S=t._lctf.getInterval(c.cDef,e[n+1+h]);if(g==-1&&c.cDef[S+2]!=x[h]){p=!1;break}}if(p){var C=b.substLookupRecords;for(u=0;u<C.length;u+=2)C[u],C[u+1]}}}else if(r.ltype==6&&c.fmt==3){if(!t.U._glsCovered(e,c.backCvg,n-c.backCvg.length)||!t.U._glsCovered(e,c.inptCvg,n)||!t.U._glsCovered(e,c.ahedCvg,n+c.inptCvg.length))continue;var w=c.lookupRec;for(y=0;y<w.length;y+=2){g=w[y];var T=i[w[y+1]];t.U._applySubs(e,n+g,T,i)}}}}},t.U._glsCovered=function(e,n,r){for(var i=0;i<n.length;i++)if(t._lctf.coverageIndex(n[i],e[r+i])==-1)return!1;return!0},t.U.glyphsToPath=function(e,n,r){for(var i={cmds:[],crds:[]},a=0,o=0;o<n.length;o++){var s=n[o];if(s!=-1){for(var c=o<n.length-1&&n[o+1]!=-1?n[o+1]:0,l=t.U.glyphToPath(e,s),u=0;u<l.crds.length;u+=2)i.crds.push(l.crds[u]+a),i.crds.push(l.crds[u+1]);for(r&&i.cmds.push(r),u=0;u<l.cmds.length;u++)i.cmds.push(l.cmds[u]);r&&i.cmds.push(`X`),a+=e.hmtx.aWidth[s],o<n.length-1&&(a+=t.U.getPairAdjustment(e,s,c))}}return i},t.U.P={},t.U.P.moveTo=function(e,t,n){e.cmds.push(`M`),e.crds.push(t,n)},t.U.P.lineTo=function(e,t,n){e.cmds.push(`L`),e.crds.push(t,n)},t.U.P.curveTo=function(e,t,n,r,i,a,o){e.cmds.push(`C`),e.crds.push(t,n,r,i,a,o)},t.U.P.qcurveTo=function(e,t,n,r,i){e.cmds.push(`Q`),e.crds.push(t,n,r,i)},t.U.P.closePath=function(e){e.cmds.push(`Z`)},t.U._drawCFF=function(e,n,r,i,a){for(var o=n.stack,s=n.nStems,c=n.haveWidth,l=n.width,u=n.open,d=0,f=n.x,p=n.y,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w={val:0,size:0};d<e.length;){t.CFF.getCharString(e,d,w);var T=w.val;if(d+=w.size,T==`o1`||T==`o18`)o.length%2!=0&&!c&&(l=o.shift()+i.nominalWidthX),s+=o.length>>1,o.length=0,c=!0;else if(T==`o3`||T==`o23`)o.length%2!=0&&!c&&(l=o.shift()+i.nominalWidthX),s+=o.length>>1,o.length=0,c=!0;else if(T==`o4`)o.length>1&&!c&&(l=o.shift()+i.nominalWidthX,c=!0),u&&t.U.P.closePath(a),p+=o.pop(),t.U.P.moveTo(a,f,p),u=!0;else if(T==`o5`)for(;o.length>0;)f+=o.shift(),p+=o.shift(),t.U.P.lineTo(a,f,p);else if(T==`o6`||T==`o7`)for(var E=o.length,D=T==`o6`,O=0;O<E;O++){var k=o.shift();D?f+=k:p+=k,D=!D,t.U.P.lineTo(a,f,p)}else if(T==`o8`||T==`o24`){E=o.length;for(var A=0;A+6<=E;)m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),f=g+o.shift(),p=_+o.shift(),t.U.P.curveTo(a,m,h,g,_,f,p),A+=6;T==`o24`&&(f+=o.shift(),p+=o.shift(),t.U.P.lineTo(a,f,p))}else{if(T==`o11`)break;if(T==`o1234`||T==`o1235`||T==`o1236`||T==`o1237`)T==`o1234`&&(h=p,g=(m=f+o.shift())+o.shift(),C=_=h+o.shift(),y=_,x=p,f=(b=(v=(S=g
4591+o.shift())+o.shift())+o.shift())+o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p)),T==`o1235`&&(m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),S=g+o.shift(),C=_+o.shift(),v=S+o.shift(),y=C+o.shift(),b=v+o.shift(),x=y+o.shift(),f=b+o.shift(),p=x+o.shift(),o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p)),T==`o1236`&&(m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),C=_=h+o.shift(),y=_,b=(v=(S=g+o.shift())+o.shift())+o.shift(),x=y+o.shift(),f=b+o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p)),T==`o1237`&&(m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),S=g+o.shift(),C=_+o.shift(),v=S+o.shift(),y=C+o.shift(),b=v+o.shift(),x=y+o.shift(),Math.abs(b-f)>Math.abs(x-p)?f=b+o.shift():p=x+o.shift(),t.U.P.curveTo(a,m,h,g,_,S,C),t.U.P.curveTo(a,v,y,b,x,f,p));else if(T==`o14`){if(o.length>0&&!c&&(l=o.shift()+r.nominalWidthX,c=!0),o.length==4){var j=o.shift(),ee=o.shift(),M=o.shift(),te=o.shift(),N=t.CFF.glyphBySE(r,M),P=t.CFF.glyphBySE(r,te);t.U._drawCFF(r.CharStrings[N],n,r,i,a),n.x=j,n.y=ee,t.U._drawCFF(r.CharStrings[P],n,r,i,a)}u&&=(t.U.P.closePath(a),!1)}else if(T==`o19`||T==`o20`)o.length%2!=0&&!c&&(l=o.shift()+i.nominalWidthX),s+=o.length>>1,o.length=0,c=!0,d+=s+7>>3;else if(T==`o21`)o.length>2&&!c&&(l=o.shift()+i.nominalWidthX,c=!0),p+=o.pop(),f+=o.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,f,p),u=!0;else if(T==`o22`)o.length>1&&!c&&(l=o.shift()+i.nominalWidthX,c=!0),f+=o.pop(),u&&t.U.P.closePath(a),t.U.P.moveTo(a,f,p),u=!0;else if(T==`o25`){for(;o.length>6;)f+=o.shift(),p+=o.shift(),t.U.P.lineTo(a,f,p);m=f+o.shift(),h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),f=g+o.shift(),p=_+o.shift(),t.U.P.curveTo(a,m,h,g,_,f,p)}else if(T==`o26`)for(o.length%2&&(f+=o.shift());o.length>0;)m=f,h=p+o.shift(),f=g=m+o.shift(),p=(_=h+o.shift())+o.shift(),t.U.P.curveTo(a,m,h,g,_,f,p);else if(T==`o27`)for(o.length%2&&(p+=o.shift());o.length>0;)h=p,g=(m=f+o.shift())+o.shift(),_=h+o.shift(),f=g+o.shift(),p=_,t.U.P.curveTo(a,m,h,g,_,f,p);else if(T==`o10`||T==`o29`){var F=T==`o10`?i:r;if(o.length==0)console.debug(`error: empty stack`);else{var I=o.pop(),ne=F.Subrs[I+F.Bias];n.x=f,n.y=p,n.nStems=s,n.haveWidth=c,n.width=l,n.open=u,t.U._drawCFF(ne,n,r,i,a),f=n.x,p=n.y,s=n.nStems,c=n.haveWidth,l=n.width,u=n.open}}else if(T==`o30`||T==`o31`){var re=o.length,L=(A=0,T==`o31`);for(A+=re-(E=-3&re);A<E;)L?(h=p,g=(m=f+o.shift())+o.shift(),p=(_=h+o.shift())+o.shift(),E-A==5?(f=g+o.shift(),A++):f=g,L=!1):(m=f,h=p+o.shift(),g=m+o.shift(),_=h+o.shift(),f=g+o.shift(),E-A==5?(p=_+o.shift(),A++):p=_,L=!0),t.U.P.curveTo(a,m,h,g,_,f,p),A+=4}else{if((T+``).charAt(0)==`o`)throw console.debug(`Unknown operation: `+T,e),T;o.push(T)}}}n.x=f,n.y=p,n.nStems=s,n.haveWidth=c,n.width=l,n.open=u};var n=t,r={Typr:n};return e.Typr=n,e.default=r,Object.defineProperty(e,`__esModule`,{value:!0}),e}({}).Typr}function bM(){return function(e){var t=Uint8Array,n=Uint16Array,r=Uint32Array,i=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(e,t){for(var i=new n(31),a=0;a<31;++a)i[a]=t+=1<<e[a-1];var o=new r(i[30]);for(a=1;a<30;++a)for(var s=i[a];s<i[a+1];++s)o[s]=s-i[a]<<5|a;return[i,o]},c=s(i,2),l=c[0],u=c[1];l[28]=258,u[258]=28;for(var d=s(a,0)[0],f=new n(32768),p=0;p<32768;++p){var m=(43690&p)>>>1|(21845&p)<<1;m=(61680&(m=(52428&m)>>>2|(13107&m)<<2))>>>4|(3855&m)<<4,f[p]=((65280&m)>>>8|(255&m)<<8)>>>1}var h=function(e,t,r){for(var i=e.length,a=0,o=new n(t);a<i;++a)++o[e[a]-1];var s,c=new n(t);for(a=0;a<t;++a)c[a]=c[a-1]+o[a-1]<<1;if(r){s=new n(1<<t);var l=15-t;for(a=0;a<i;++a)if(e[a])for(var u=a<<4|e[a],d=t-e[a],p=c[e[a]-1]++<<d,m=p|(1<<d)-1;p<=m;++p)s[f[p]>>>l]=u}else for(s=new n(i),a=0;a<i;++a)e[a]&&(s[a]=f[c[e[a]-1]++]>>>15-e[a]);return s},g=new t(288);for(p=0;p<144;++p)g[p]=8;for(p=144;p<256;++p)g[p]=9;for(p=256;p<280;++p)g[p]=7;for(p=280;p<288;++p)g[p]=8;var _=new t(32);for(p=0;p<32;++p)_[p]=5;var v=h(g,9,1),y=h(_,5,1),b=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},x=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},S=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},C=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],w=function(e,t,n){var r=Error(t||C[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,w),!n)throw r;return r},T=function(e,s,c){var u=e.length;if(!u||c&&!c.l&&u<5)return s||new t(0);var f=!s||c,p=!c||c.i;c||={}
4591,s||=new t(3*u);var m,g=function(e){var n=s.length;if(e>n){var r=new t(Math.max(2*n,e));r.set(s),s=r}},_=c.f||0,C=c.p||0,T=c.b||0,E=c.l,D=c.d,O=c.m,k=c.n,A=8*u;do{if(!E){c.f=_=x(e,C,1);var j=x(e,C+1,3);if(C+=3,!j){var ee=e[(R=((m=C)/8|0)+(7&m&&1)+4)-4]|e[R-3]<<8,M=R+ee;if(M>u){p&&w(0);break}f&&g(T+ee),s.set(e.subarray(R,M),T),c.b=T+=ee,c.p=C=8*M;continue}if(j==1)E=v,D=y,O=9,k=5;else if(j==2){var te=x(e,C,31)+257,N=x(e,C+10,15)+4,P=te+x(e,C+5,31)+1;C+=14;for(var F=new t(P),I=new t(19),ne=0;ne<N;++ne)I[o[ne]]=x(e,C+3*ne,7);C+=3*N;var re=b(I),L=(1<<re)-1,ie=h(I,re,1);for(ne=0;ne<P;){var R,ae=ie[x(e,C,L)];if(C+=15&ae,(R=ae>>>4)<16)F[ne++]=R;else{var oe=0,se=0;for(R==16?(se=3+x(e,C,3),C+=2,oe=F[ne-1]):R==17?(se=3+x(e,C,7),C+=3):R==18&&(se=11+x(e,C,127),C+=7);se--;)F[ne++]=oe}}var ce=F.subarray(0,te),z=F.subarray(te);O=b(ce),k=b(z),E=h(ce,O,1),D=h(z,k,1)}else w(1);if(C>A){p&&w(0);break}}f&&g(T+131072);for(var le=(1<<O)-1,ue=(1<<k)-1,de=C;;de=C){var fe=(oe=E[S(e,C)&le])>>>4;if((C+=15&oe)>A){p&&w(0);break}if(oe||w(2),fe<256)s[T++]=fe;else{if(fe==256){de=C,E=null;break}var B=fe-254;if(fe>264){var pe=i[ne=fe-257];B=x(e,C,(1<<pe)-1)+l[ne],C+=pe}var me=D[S(e,C)&ue],he=me>>>4;if(me||w(3),C+=15&me,z=d[he],he>3&&(pe=a[he],z+=S(e,C)&(1<<pe)-1,C+=pe),C>A){p&&w(0);break}f&&g(T+131072);for(var V=T+B;T<V;T+=4)s[T]=s[T-z],s[T+1]=s[T+1-z],s[T+2]=s[T+2-z],s[T+3]=s[T+3-z];T=V}}c.l=E,c.p=de,c.b=T,E&&(_=1,c.m=O,c.d=D,c.n=k)}while(!_);return T==s.length?s:function(e,i,a){(i==null||i<0)&&(i=0),(a==null||a>e.length)&&(a=e.length);var o=new(e instanceof n?n:e instanceof r?r:t)(a-i);return o.set(e.subarray(i,a)),o}(s,0,T)},E=new t(0),D=typeof TextDecoder<`u`&&new TextDecoder;try{D.decode(E,{stream:!0})}catch{}return e.convert_streams=function(e){var t=new DataView(e),n=0;function r(){var e=t.getUint16(n);return n+=2,e}function i(){var e=t.getUint32(n);return n+=4,e}function a(e){_.setUint16(v,e),v+=2}function o(e){_.setUint32(v,e),v+=4}for(var s={signature:i(),flavor:i(),length:i(),numTables:r(),reserved:r(),totalSfntSize:i(),majorVersion:r(),minorVersion:r(),metaOffset:i(),metaLength:i(),metaOrigLength:i(),privOffset:i(),privLength:i()},c=0;2**c<=s.numTables;)c++;c--;for(var l=16*2**c,u=16*s.numTables-l,d=12,f=[],p=0;p<s.numTables;p++)f.push({tag:i(),offset:i(),compLength:i(),origLength:i(),origChecksum:i()}),d+=16;var m,h=new Uint8Array(12+16*f.length+f.reduce((function(e,t){return e+t.origLength+4}),0)),g=h.buffer,_=new DataView(g),v=0;return o(s.flavor),a(s.numTables),a(l),a(c),a(u),f.forEach((function(e){o(e.tag),o(e.origChecksum),o(d),o(e.origLength),e.outOffset=d,(d+=e.origLength)%4!=0&&(d+=4-d%4)})),f.forEach((function(t){var n,r=e.slice(t.offset,t.offset+t.compLength);if(t.compLength!=t.origLength){var i=new Uint8Array(t.origLength);n=new Uint8Array(r,2),T(n,i)}else i=new Uint8Array(r);h.set(i,t.outOffset);var a=0;(d=t.outOffset+t.origLength)%4!=0&&(a=4-d%4),h.set(new Uint8Array(a).buffer,t.outOffset+t.origLength),m=d+a})),g.slice(0,m)},Object.defineProperty(e,`__esModule`,{value:!0}),e}({}).convert_streams}function xM(e,t){let n={M:2,L:2,Q:4,C:6,Z:0},r={C:`18g,ca,368,1kz`,D:`17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v`,R:`17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6`,L:`x9u,jff,a,fd,jv`,T:`4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n`},i;function a(e){if(!i){let e={R:2,L:1,D:4,C:16,U:32,T:8};for(let t in i=new Map,r){let n=0;r[t].split(`,`).forEach(r=>{let[a,o]=r.split(`+`);a=parseInt(a,36),o=o?parseInt(o,36):0,i.set(n+=a,e[t]);for(let r=o;r--;)i.set(++n,e[t])})}}return i.get(e)||32}let o=[null,`isol`,`init`,`fina`,`medi`];function s(e){let t=new Uint8Array(e.length),n=32,r=1,i=-1;for(let o=0;o<e.length;o++){let s=e.codePointAt(o),c=a(s)|0,l=1;c&8||(n&21?c&22?(l=3,(r===1||r===3)&&t[i]++):c&33&&(r===2||r===4)&&t[i]--:n&34&&(r===2||r===4)&&t[i]--,r=t[o]=l,n=c,i=o,s>65535&&o++)}return t}function c(t,n){let r=[];for(let i=0;i<n.length;i++){let a=n.codePointAt(i);a>65535&&i++,r.push(e.U.codeToGlyph(t,a))}let i=t.GSUB;if(i){let{lookupList:t,featureList:a}=i,c,l=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,u=[];a.forEach(i=>
4591{if(l.test(i.tag))for(let a=0;a<i.tab.length;a++){if(u[i.tab[a]])continue;u[i.tab[a]]=!0;let l=t[i.tab[a]],d=/^(isol|init|fina|medi)$/.test(i.tag);d&&!c&&(c=s(n));for(let n=0;n<r.length;n++)(!c||!d||o[c[n]]===i.tag)&&e.U._applySubs(r,n,l,t)}})}return r}function l(t,n){let r=new Int16Array(n.length*3),i=0;for(;i<n.length;i++){let c=n[i];if(c===-1)continue;r[i*3+2]=t.hmtx.aWidth[c];let l=t.GPOS;if(l){let d=l.lookupList;for(let l=0;l<d.length;l++){let f=d[l];for(let l=0;l<f.tabs.length;l++){let d=f.tabs[l];if(f.ltype===1){if(e._lctf.coverageIndex(d.coverage,c)!==-1&&d.pos){s(d.pos,i);break}}else if(f.ltype===2){let t=null,r=a();if(r!==-1){let a=e._lctf.coverageIndex(d.coverage,n[r]);if(a!==-1){if(d.fmt===1){let e=d.pairsets[a];for(let n=0;n<e.length;n++)e[n].gid2===c&&(t=e[n])}else if(d.fmt===2){let i=e.U._getGlyphClass(n[r],d.classDef1),a=e.U._getGlyphClass(c,d.classDef2);t=d.matrix[i][a]}if(t){t.val1&&s(t.val1,r),t.val2&&s(t.val2,i);break}}}}else if(f.ltype===4){let t=e._lctf.coverageIndex(d.markCoverage,c);if(t!==-1){let s=a(o),c=s===-1?-1:e._lctf.coverageIndex(d.baseCoverage,n[s]);if(c!==-1){let e=d.markArray[t],n=d.baseArray[c][e.markClass];r[i*3]=n.x-e.x+r[s*3]-r[s*3+2],r[i*3+1]=n.y-e.y+r[s*3+1];break}}}else if(f.ltype===6){let o=e._lctf.coverageIndex(d.mark1Coverage,c);if(o!==-1){let s=a();if(s!==-1){let a=n[s];if(u(t,a)===3){let t=e._lctf.coverageIndex(d.mark2Coverage,a);if(t!==-1){let e=d.mark1Array[o],n=d.mark2Array[t][e.markClass];r[i*3]=n.x-e.x+r[s*3]-r[s*3+2],r[i*3+1]=n.y-e.y+r[s*3+1];break}}}}}}}}else if(t.kern&&!t.cff){let e=a();if(e!==-1){let i=t.kern.glyph1.indexOf(n[e]);if(i!==-1){let n=t.kern.rval[i].glyph2.indexOf(c);n!==-1&&(r[e*3+2]+=t.kern.rval[i].vals[n])}}}}return r;function a(e){for(let t=i-1;t>=0;t--)if(n[t]!==-1&&(!e||e(n[t])))return t;return-1}function o(e){return u(t,e)===1}function s(e,t){for(let n=0;n<3;n++)r[t*3+n]+=e[n]||0}}function u(t,n){let r=t.GDEF&&t.GDEF.glyphClassDef;return r?e.U._getGlyphClass(n,r):0}function d(...e){for(let t=0;t<e.length;t++)if(typeof e[t]==`number`)return e[t]}function f(t){let r=Object.create(null),i=t[`OS/2`],a=t.hhea,o=t.head.unitsPerEm,s=d(i&&i.sTypoAscender,a&&a.ascender,o),u={unitsPerEm:o,ascender:s,descender:d(i&&i.sTypoDescender,a&&a.descender,0),capHeight:d(i&&i.sCapHeight,s),xHeight:d(i&&i.sxHeight,s),lineGap:d(i&&i.sTypoLineGap,a&&a.lineGap),supportsCodePoint(n){return e.U.codeToGlyph(t,n)>0},forEachGlyph(i,a,o,s){let d=0,f=1/u.unitsPerEm*a,p=c(t,i),m=0,h=l(t,p);return p.forEach((c,l)=>{if(c!==-1){let i=r[c];if(!i){let{cmds:a,crds:o}=e.U.glyphToPath(t,c),s=``,l=0;for(let e=0,t=a.length;e<t;e++){let t=n[a[e]];s+=a[e];for(let e=1;e<=t;e++)s+=(e>1?`,`:``)+o[l++]}let u,d,f,p;if(o.length){u=d=1/0,f=p=-1/0;for(let e=0,t=o.length;e<t;e+=2){let t=o[e],n=o[e+1];t<u&&(u=t),n<d&&(d=n),t>f&&(f=t),n>p&&(p=n)}}else u=f=d=p=0;i=r[c]={index:c,advanceWidth:t.hmtx.aWidth[c],xMin:u,yMin:d,xMax:f,yMax:p,path:s}}s.call(null,i,d+h[l*3]*f,h[l*3+1]*f,m),d+=h[l*3+2]*f,o&&(d+=o*a)}m+=i.codePointAt(m)>65535?2:1}),d}};return u}return function(n){let r=new Uint8Array(n,0,4),i=e._bin.readASCII(r,0,4);if(i===`wOFF`)n=t(n);else if(i===`wOF2`)throw Error(`woff2 fonts not supported`);return f(e.parse(n)[0])}}var SM=Yj({name:`Typr Font Parser`,dependencies:[yM,bM,xM],init(e,t,n){return n(e(),t())}});function CM(){return function(e){var t=function(){this.buckets=new Map};t.prototype.add=function(e){var t=e>>5;this.buckets.set(t,(this.buckets.get(t)||0)|1<<(31&e))},t.prototype.has=function(e){var t=this.buckets.get(e>>5);return t!==void 0&&(t&1<<(31&e))!=0},t.prototype.serialize=function(){var e=[];return this.buckets.forEach((function(t,n){e.push((+n).toString(36)+`:`+t.toString(36))})),e.join(`,`)},t.prototype.deserialize=function(e){var t=this;this.buckets.clear(),e.split(`,`).forEach((function(e){var n=e.split(`:`);t.buckets.set(parseInt(n[0],36),parseInt(n[1],36))}))};var n=2**8,r=n-1,i=~r;function a(e){var t=function(e){return e&i}(e).toString(16),r=function(e){return(e&i)+n-1}(e).toString(16);return`codepoint-index/plane`+(e>>16)+`/`+t+`-`+r+`.json`}function o(e,t){var n=e&r,i=t.codePointAt(n/6|0);return((i=(i||48)-48)&1<<n%6)!=0}function s(e,t){var n;(n=e,n.replace(/U\+/gi,``).replace(/^,+|,+$/g,``).split(/,+/).map((function(e){return e.split(`-`).map((function(e){return parseInt(e.trim(),16)}))}
4591))).forEach((function(e){var n=e[0],r=e[1];r===void 0&&(r=n),t(n,r)}))}function c(e,t){s(e,(function(e,n){for(var r=e;r<=n;r++)t(r)}))}var l={},u={},d=new WeakMap,f=`https://cdn.jsdelivr.net/gh/lojjic/[email protected]/packages/data`;function p(e){var n=d.get(e);return n||(n=new t,c(e.ranges,(function(e){return n.add(e)})),d.set(e,n)),n}var m,h=new Map;function g(e,t,n){return e[t]?t:e[n]?n:function(e){for(var t in e)return t}(e)}function _(e,t){var n=t;if(!e.includes(n)){n=1/0;for(var r=0;r<e.length;r++)Math.abs(e[r]-t)<Math.abs(n-t)&&(n=e[r])}return n}function v(e){return m||(m=new Set,c(`9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000`,(function(e){m.add(e)}))),m.has(e)}return e.CodePointSet=t,e.clearCache=function(){l={},u={}},e.getFontsForString=function(e,t){t===void 0&&(t={});var n,r=t.lang;r===void 0&&(r=/\p{Script=Hangul}/u.test(n=e)?`ko`:/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(n)?`ja`:`en`);var i=t.category;i===void 0&&(i=`sans-serif`);var s=t.style;s===void 0&&(s=`normal`);var c=t.weight;c===void 0&&(c=400);var d=(t.dataUrl||f).replace(/\/$/g,``),m=new Map,y=new Uint8Array(e.length),b={},x={},S=Array(e.length),C=new Map,w=!1;function T(e){var t=h.get(e);return t||(t=fetch(d+`/`+e).then((function(e){if(!e.ok)throw Error(e.statusText);return e.json().then((function(e){if(!Array.isArray(e)||e[0]!==1)throw Error(`Incorrect schema version; need 1, got `+e[0]);return e[1]}))})).catch((function(t){if(d!==f)return w||=(console.error(`unicode-font-resolver: Failed loading from dataUrl "`+d+`", trying default CDN. `+t.message),!0),d=f,h.delete(e),T(e);throw t})),h.set(e,t)),t}for(var E=function(t){var n=e.codePointAt(t),r=a(n);S[t]=r,l[r]||C.has(r)||C.set(r,T(r).then((function(e){l[r]=e}))),n>65535&&(t++,D=t)},D=0;D<e.length;D++)E(D);return Promise.all(C.values()).then((function(){C.clear();for(var t=function(t){var i=e.codePointAt(t),a=null,s=l[S[t]],c=void 0;for(var d in s){var f=x[d];if(f===void 0&&(f=x[d]=new RegExp(d).test(r||`en`)),f){for(var p in c=d,s[d])if(o(i,s[d][p])){a=p;break}break}}if(!a){t:for(var m in s)if(m!==c){for(var h in s[m])if(o(i,s[m][h])){a=h;break t}}}a||=(console.debug(`No font coverage for U+`+i.toString(16)),`latin`),S[t]=a,u[a]||C.has(a)||C.set(a,T(`font-meta/`+a+`.json`).then((function(e){u[a]=e}))),i>65535&&(t++,n=t)},n=0;n<e.length;n++)t(n);return Promise.all(C.values())})).then((function(){for(var t=null,n=0;n<e.length;n++){var r=e.codePointAt(n);if(t&&(v(r)||p(t).has(r)))y[n]=y[n-1];else{t=u[S[n]];var a=b[t.id];if(!a){var o=t.typeforms,l=g(o,i,`sans-serif`),f=g(o[l],s,`normal`),h=_(o[l]?.[f],c);a=b[t.id]=d+`/font-files/`+t.id+`/`+l+`.`+f+`.`+h+`.woff`}var x=m.get(a);x??(x=m.size,m.set(a,x)),y[n]=x}r>65535&&(n++,y[n]=y[n-1])}return{fontUrls:Array.from(m.keys()),chars:y}}))},Object.defineProperty(e,`__esModule`,{value:!0}),e}({})}function wM(e,t){let n=Object.create(null),r=Object.create(null);function i(t,n){let r=e=>{console.error(`Failure loading font ${t}`,e)};try{let i=new XMLHttpRequest;i.open(`get`,t,!0),i.responseType=`arraybuffer`,i.onload=function(){if(i.status>=400)r(Error(i.statusText));else if(i.status>0)try{let r=e(i.response);r.src=t,n(r)}catch(e){r(e)}},i.onerror=r,i.send()}catch(e){r(e)}}function a(e,t){let a=n[e];a?t(a):r[e]?r[e].push(t):(r[e]=[t],i(e,t=>{t.src=e,n[e]=t,r[e].forEach(e=>e(t)),delete r[e]}))}return function(e,r,{lang:i,fonts:o=[],style:s=`normal`,weight:c=`normal`,unicodeFontsURL:l}={}){let u=new Uint8Array(e.length),d=[];e.length||h();let f=new Map,p=[];if(s!==`italic`&&(s=`normal`),typeof c!=`number`&&(c=c===`bold`?700:400),o&&!Array.isArray(o)&&(o=[o]),o=o.slice().filter(e=>!e.lang||e.lang.test(i)).reverse(),o.length){let t=0;(function r(i=0){for(let s=i,c=e.length;s<c;s++){let i=e.codePointAt(s);if(t===1&&d[u[s-1]].supportsCodePoint(i)||s>0&&/\s/.test(e[s]))u[s]=u[s-1],t===2&&(p[p.length-1][1]=s);else for(let e=u[s],c=o.length;e<=c;e++)if(e===c){let e=t===2?p[p.length-1]:p[p.length]=[s,s];e[1]=s,t=2}else{u[s]=e;let{src:c,unicodeRange:l}=o[e];if(!l||g(i,l)){let e=n[c];if(!e){a(c,()=>{r(s)});return}if(e.supportsCodePoint(i)){let n=f.get(e);typeof n!=`number`&&(n=d.length,d.push(e),f.set(e,n)),u[s]=n,t=1;break}}}i>65535&&s+1<c&&(u[s+1]=u[s],s++,t===2&&(p[p.length-1][1]=s))}m()})()}else p.push([0,e.length-1]),m();function m(){if(p.length){let n=p.map(t=>e.substring(t[0],t[1]+1)).join(` 4592`);t.getFontsForString(n,{lang:i||void 0,style:s,weight:c,dataUrl:l}).then(({fontUrls:e,chars:t})=>{let n=d.length,r=0;
4592p.forEach(e=>{for(let i=0,a=e[1]-e[0];i<=a;i++)u[e[0]+i]=t[r++]+n;r++});let i=0;e.forEach((t,r)=>{a(t,t=>{d[r+n]=t,++i===e.length&&h()})})})}else h()}function h(){r({chars:u,fonts:d})}function g(e,t){for(let n=0;n<t.length;n++){let[r,i=r]=t[n];if(r<=e&&e<=i)return!0}return!1}}}var TM=Yj({name:`FontResolver`,dependencies:[wM,SM,CM],init(e,t,n){return e(t,n())}});function EM(e,t){let n=1/0,r=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,i=`[^\\S\\u00A0]`,a=RegExp(`${i}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function o({text:t,lang:n,fonts:r,style:i,weight:a,preResolvedFonts:o,unicodeFontsURL:s},c){let l=({chars:e,fonts:t})=>{let n,r,i=[];for(let a=0;a<e.length;a++)e[a]===r?n.end=a:(r=e[a],i.push(n={start:a,end:a,fontObj:t[e[a]]}));c(i)};o?l(o):e(t,l,{lang:n,fonts:r,style:i,weight:a,unicodeFontsURL:s})}function s({text:e=``,font:s,lang:c,sdfGlyphSize:p=64,fontSize:m=400,fontWeight:h=1,fontStyle:g=`normal`,letterSpacing:_=0,lineHeight:v=`normal`,maxWidth:y=n,direction:b,textAlign:x=`left`,textIndent:S=0,whiteSpace:C=`normal`,overflowWrap:w=`normal`,anchorX:T=0,anchorY:E=0,metricsOnly:D=!1,unicodeFontsURL:O,preResolvedFonts:k=null,includeCaretPositions:A=!1,chunkedBoundsSize:j=8192,colorRanges:ee=null},M){let te=d(),N={fontLoad:0,typesetting:0};e.indexOf(`\r`)>-1&&(console.info(`Typesetter: got text with \\r chars; normalizing to \\n`),e=e.replace(/\r\n/g,` 4593`).replace(/\r/g,` 4594`)),m=+m,_=+_,y=+y,v||=`normal`,S=+S,o({text:e,lang:c,style:g,weight:h,fonts:typeof s==`string`?[{src:s}]:s,unicodeFontsURL:O,preResolvedFonts:k},o=>{N.fontLoad=d()-te;let s=isFinite(y),c=null,p=null,h=null,g=null,O=null,k=null,P=null,F=null,I=0,ne=0,re=C!==`nowrap`,L=new Map,ie=d(),R=S,ae=0,oe=new f,se=[oe];o.forEach(t=>{let{fontObj:n}=t,{ascender:o,descender:c,unitsPerEm:l,lineGap:u,capHeight:d,xHeight:p}=n,h=L.get(n);if(!h){let e=m/l,t=v===`normal`?(o-c+u)*e:v*m,r=(t-(o-c)*e)/2,i=Math.min(t,(o-c)*e),a=(o+c)/2*e+i/2;h={index:L.size,src:n.src,fontObj:n,fontSizeMult:e,unitsPerEm:l,ascender:o*e,descender:c*e,capHeight:d*e,xHeight:p*e,lineHeight:t,baseline:-r-o*e,caretTop:a,caretBottom:a-i},L.set(n,h)}let{fontSizeMult:g}=h,b=e.slice(t.start,t.end+1),x,C;n.forEachGlyph(b,m,_,(n,o,c,l)=>{o+=ae,l+=t.start,x=o,C=n;let u=e.charAt(l),d=n.advanceWidth*g,p=oe.count,v;if(`isEmpty`in n||(n.isWhitespace=!!u&&new RegExp(i).test(u),n.canBreakAfter=!!u&&a.test(u),n.isEmpty=n.xMin===n.xMax||n.yMin===n.yMax||r.test(u)),!n.isWhitespace&&!n.isEmpty&&ne++,re&&s&&!n.isWhitespace&&o+d+R>y&&p){if(oe.glyphAt(p-1).glyphObj.canBreakAfter)v=new f,R=-o;else for(let e=p;e--;)if(e===0&&w===`break-word`){v=new f,R=-o;break}else if(oe.glyphAt(e).glyphObj.canBreakAfter){v=oe.splitAt(e+1);let t=v.glyphAt(0).x;R-=t;for(let e=v.count;e--;)v.glyphAt(e).x-=t;break}v&&(oe.isSoftWrapped=!0,oe=v,se.push(oe),I=y)}let b=oe.glyphAt(oe.count);b.glyphObj=n,b.x=o+R,b.y=c,b.width=d,b.charIndex=l,b.fontData=h,u===` 4595`&&(oe=new f,se.push(oe),R=-(o+d+_*m)+S)}),ae=x+C.advanceWidth*g+_*m});let ce=0;se.forEach(e=>{let t=!0;for(let n=e.count;n--;){let r=e.glyphAt(n);t&&!r.glyphObj.isWhitespace&&(e.width=r.x+r.width,e.width>I&&(I=e.width),t=!1);let{lineHeight:i,capHeight:a,xHeight:o,baseline:s}=r.fontData;i>e.lineHeight&&(e.lineHeight=i);let c=s-e.baseline;c<0&&(e.baseline+=c,e.cap+=c,e.ex+=c),e.cap=Math.max(e.cap,e.baseline+a),e.ex=Math.max(e.ex,e.baseline+o)}e.baseline-=ce,e.cap-=ce,e.ex-=ce,ce+=e.lineHeight});let z=0,le=0;if(T&&(typeof T==`number`?z=-T:typeof T==`string`&&(z=-I*(T===`left`?0:T===`center`?.5:T===`right`?1:l(T)))),E&&(typeof E==`number`?le=-E:typeof E==`string`&&(le=E===`top`?0:E===`top-baseline`?-se[0].baseline:E===`top-cap`?-se[0].cap:E===`top-ex`?-se[0].ex:E===`middle`?ce/2:E===`bottom`?ce:E===`bottom-baseline`?-se[se.length-1].baseline:l(E)*ce)),!D){let r=t.getEmbeddingLevels(e,b);c=new Uint16Array(ne),p=new Uint8Array(ne),h=new Float32Array(ne*2),g={},P=[n,n,-n,-n],F=[],A&&(k=new Float32Array(e.length*4)),ee&&(O=new Uint8Array(ne*3));let i=0,a=-1,o=-1,s,l;if(se.forEach((d,f)=>{let{count:m,width:_}=d;if(m>0){let f=0;for(let e=m;e--&&d.glyphAt(e).glyphObj.isWhitespace;)f++;let v=0,y=0;if(x===`center`)v=(I-_)/2;else if(x===`right`)v=I-_;else if(x===`justify`&&d.isSoftWrapped){let e=0;for(let t=m-f;t--;)d.glyphAt(t).glyphObj.isWhitespace&&e++;y=(I-_)/e}if(y||v){let e=0;for(let t=0;t<m;t++){let n=d.glyphAt(t),r=n.glyphObj;n.x+=v+e,y!==0&&r.isWhitespace&&t<m-f&&(e+=y,n.width+=y)}}let b=t.getReorderSegments(e,r,d.glyphAt(0).charIndex,d.glyphAt(d.count-1).charIndex);for(let e=0;e<b.length;e++){let[t,n]=b[e],r=1/0,i=-1/0;for(let e=0;e<m;e++)if(d.glyphAt(e).charIndex>=t){let t=e,a=e;for(;a<m;
4595a++){let e=d.glyphAt(a);if(e.charIndex>n)break;a<m-f&&(r=Math.min(r,e.x),i=Math.max(i,e.x+e.width))}for(let e=t;e<a;e++){let t=d.glyphAt(e);t.x=i-(t.x+t.width-r)}break}}let S,C=e=>S=e;for(let f=0;f<m;f++){let m=d.glyphAt(f);S=m.glyphObj;let _=S.index,v=r.levels[m.charIndex]&1;if(v){let n=t.getMirroredCharacter(e[m.charIndex]);n&&m.fontData.fontObj.forEachGlyph(n,0,0,C)}if(A){let{charIndex:e,fontData:t}=m,n=m.x+z,r=m.x+m.width+z;k[e*4]=v?r:n,k[e*4+1]=v?n:r,k[e*4+2]=d.baseline+t.caretBottom+le,k[e*4+3]=d.baseline+t.caretTop+le;let i=e-a;i>1&&u(k,a,i),a=e}if(ee){let{charIndex:e}=m;for(;e>o;)o++,ee.hasOwnProperty(o)&&(l=ee[o])}if(!S.isWhitespace&&!S.isEmpty){let e=i++,{fontSizeMult:t,src:r,index:a}=m.fontData,o=g[r]||(g[r]={});o[_]||(o[_]={path:S.path,pathBounds:[S.xMin,S.yMin,S.xMax,S.yMax]});let u=m.x+z,f=m.y+d.baseline+le;h[e*2]=u,h[e*2+1]=f;let v=u+S.xMin*t,y=f+S.yMin*t,b=u+S.xMax*t,x=f+S.yMax*t;v<P[0]&&(P[0]=v),y<P[1]&&(P[1]=y),b>P[2]&&(P[2]=b),x>P[3]&&(P[3]=x),e%j===0&&(s={start:e,end:e,rect:[n,n,-n,-n]},F.push(s)),s.end++;let C=s.rect;if(v<C[0]&&(C[0]=v),y<C[1]&&(C[1]=y),b>C[2]&&(C[2]=b),x>C[3]&&(C[3]=x),c[e]=_,p[e]=a,ee){let t=e*3;O[t]=l>>16&255,O[t+1]=l>>8&255,O[t+2]=l&255}}}}}),k){let t=e.length-a;t>1&&u(k,a,t)}}let ue=[];L.forEach(({index:e,src:t,unitsPerEm:n,ascender:r,descender:i,lineHeight:a,capHeight:o,xHeight:s})=>{ue[e]={src:t,unitsPerEm:n,ascender:r,descender:i,lineHeight:a,capHeight:o,xHeight:s}}),N.typesetting=d()-ie,M({glyphIds:c,glyphFontIndices:p,glyphPositions:h,glyphData:g,fontData:ue,caretPositions:k,glyphColors:O,chunkedBounds:F,fontSize:m,topBaseline:le+se[0].baseline,blockBounds:[z,le-ce,z+I,le],visibleBounds:P,timings:N})})}function c(e,t){s({...e,metricsOnly:!0},e=>{let[n,r,i,a]=e.blockBounds;t({width:i-n,height:a-r})})}function l(e){let t=e.match(/^([\d.]+)%$/),n=t?parseFloat(t[1]):NaN;return isNaN(n)?0:n/100}function u(e,t,n){let r=e[t*4],i=e[t*4+1],a=e[t*4+2],o=e[t*4+3],s=(i-r)/n;for(let i=0;i<n;i++){let n=(t+i)*4;e[n]=r+s*i,e[n+1]=r+s*(i+1),e[n+2]=a,e[n+3]=o}}function d(){return(self.performance||Date).now()}function f(){this.data=[]}let p=[`glyphObj`,`x`,`y`,`width`,`charIndex`,`fontData`];return f.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/p.length)},glyphAt(e){let t=f.flyweight;return t.data=this.data,t.index=e,t},splitAt(e){let t=new f;return t.data=this.data.splice(e*p.length),t}},f.flyweight=p.reduce((e,t,n,r)=>(Object.defineProperty(e,t,{get(){return this.data[this.index*p.length+n]},set(e){this.data[this.index*p.length+n]=e}}),e),{data:null,index:0}),{typeset:s,measure:c}}var DM=()=>(self.performance||Date).now(),OM=eM(),kM;function AM(e,t,n,r,i,a,o,s,c,l,u=!0){return u?FM(e,t,n,r,i,a,o,s,c,l).then(null,u=>(kM||=(console.warn(`WebGL SDF generation failed, falling back to JS`,u),!0),BM(e,t,n,r,i,a,o,s,c,l))):BM(e,t,n,r,i,a,o,s,c,l)}var jM=[],MM=5,NM=0;function PM(){let e=DM();for(;jM.length&&DM()-e<MM;)jM.shift()();NM=jM.length?setTimeout(PM,0):0}var FM=(...e)=>new Promise((t,n)=>{jM.push(()=>{let r=DM();try{OM.webgl.generateIntoCanvas(...e),t({timing:DM()-r})}catch(e){n(e)}}),NM||=setTimeout(PM,0)}),IM=4,LM=2e3,RM={},zM=0;function BM(e,t,n,r,i,a,o,s,c,l){let u=`TroikaTextSDFGenerator_JS_`+ zM++%IM,d=RM[u];return d||=RM[u]={workerModule:Yj({name:u,workerId:u,dependencies:[eM,DM],init(e,t){let n=e().javascript.generate;return function(...e){let r=t();return{textureData:n(...e),timing:t()-r}}},getTransferables(e){return[e.textureData.buffer]}}),requests:0,idleTimer:null},d.requests++,clearTimeout(d.idleTimer),d.workerModule(e,t,n,r,i,a).then(({textureData:n,timing:r})=>{let i=DM(),a=new Uint8Array(n.length*4);for(let e=0;e<n.length;e++)a[e*4+l]=n[e];return OM.webglUtils.renderImageData(o,a,s,c,e,t,1<<3-l),r+=DM()-i,--d.requests===0&&(d.idleTimer=setTimeout(()=>{Xj(u)},LM)),{timing:r}})}function VM(e){e._warm||=(OM.webgl.isSupported(e),!0)}var HM=OM.webglUtils.resizeWebGLCanvasWithoutClearing,UM={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},WM=new Z;function GM(){return(self.performance||Date).now()}var KM=Object.create(null);function qM(e,t){e=ZM({},e);let n=GM(),{defaultFontURL:r}=UM,i=[];if(r&&i.push({label:`default`,src:$M(r)}),e.font&&i.push({label:`user`,src:$M(e.font)}),e.font=i,e.text=``+e.text,e.sdfGlyphSize=e.sdfGlyphSize||UM.sdfGlyphSize,e.unicodeFontsURL=e.unicodeFontsURL||U
4595M.unicodeFontsURL,e.colorRanges!=null){let t={};for(let n in e.colorRanges)if(e.colorRanges.hasOwnProperty(n)){let r=e.colorRanges[n];typeof r!=`number`&&(r=WM.set(r).getHex()),t[n]=r}e.colorRanges=t}Object.freeze(e);let{textureWidth:a,sdfExponent:o}=UM,{sdfGlyphSize:s}=e,c=a/s*4,l=KM[s];if(!l){let e=document.createElement(`canvas`);e.width=a,e.height=s*256/c,l=KM[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:e,sdfTexture:new fh(e,void 0,void 0,void 0,cf,cf),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,YM(l)}let{sdfTexture:u,sdfCanvas:d}=l;(UM.useWorker?tN:nN)(e).then(r=>{let{glyphIds:i,glyphFontIndices:f,fontData:p,glyphPositions:m,fontSize:h,timings:g}=r,_=[],v=new Float32Array(i.length*4),y=0,b=0,x=GM(),S=p.map(e=>{let t=l.glyphsByFont.get(e.src);return t||l.glyphsByFont.set(e.src,t=new Map),t});i.forEach((e,t)=>{let n=f[t],{src:a,unitsPerEm:o}=p[n],c=S[n].get(e);if(!c){let{path:t,pathBounds:i}=r.glyphData[a][e],o=Math.max(i[2]-i[0],i[3]-i[1])/s*(UM.sdfMargin*s+.5),u=l.glyphCount++,d=[i[0]-o,i[1]-o,i[2]+o,i[3]+o];S[n].set(e,c={path:t,atlasIndex:u,sdfViewBox:d}),_.push(c)}let{sdfViewBox:u}=c,d=m[b++],g=m[b++],x=h/o;v[y++]=d+u[0]*x,v[y++]=g+u[1]*x,v[y++]=d+u[2]*x,v[y++]=g+u[3]*x,i[t]=c.atlasIndex}),g.quads=(g.quads||0)+(GM()-x);let C=GM();g.sdf={};let w=d.height,T=Math.ceil(l.glyphCount/c),E=2**Math.ceil(Math.log2(T*s));E>w&&(console.info(`Increasing SDF texture size ${w}->${E}`),HM(d,a,E),u.dispose()),Promise.all(_.map(t=>JM(t,l,e.gpuAccelerateSDF).then(({timing:e})=>{g.sdf[t.atlasIndex]=e}))).then(()=>{_.length&&!l.contextLost&&(eN(l),u.needsUpdate=!0),g.sdfTotal=GM()-C,g.total=GM()-n,t(Object.freeze({parameters:e,sdfTexture:u,sdfGlyphSize:s,sdfExponent:o,glyphBounds:v,glyphAtlasIndices:i,glyphColors:r.glyphColors,caretPositions:r.caretPositions,chunkedBounds:r.chunkedBounds,ascender:r.ascender,descender:r.descender,lineHeight:r.lineHeight,capHeight:r.capHeight,xHeight:r.xHeight,topBaseline:r.topBaseline,blockBounds:r.blockBounds,visibleBounds:r.visibleBounds,timings:r.timings}))})}),Promise.resolve().then(()=>{l.contextLost||VM(d)})}function JM({path:e,atlasIndex:t,sdfViewBox:n},{sdfGlyphSize:r,sdfCanvas:i,contextLost:a},o){if(a)return Promise.resolve({timing:-1});let{textureWidth:s,sdfExponent:c}=UM,l=Math.max(n[2]-n[0],n[3]-n[1]),u=Math.floor(t/4);return AM(r,r,e,n,l,c,i,u%(s/r)*r,Math.floor(u/(s/r))*r,t%4,o)}function YM(e){let t=e.sdfCanvas;t.addEventListener(`webglcontextlost`,t=>{console.log(`Context Lost`,t),t.preventDefault(),e.contextLost=!0}),t.addEventListener(`webglcontextrestored`,t=>{console.log(`Context Restored`,t),e.contextLost=!1;let n=[];e.glyphsByFont.forEach(t=>{t.forEach(t=>{n.push(JM(t,e,!0))})}),Promise.all(n).then(()=>{eN(e),e.sdfTexture.needsUpdate=!0})})}function XM({font:e,characters:t,sdfGlyphSize:n},r){qM({font:e,sdfGlyphSize:n,text:Array.isArray(t)?t.join(` 4596`):``+t},r)}function ZM(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var QM;function $M(e){return QM||=typeof document>`u`?{}:document.createElement(`a`),QM.href=e,QM.href}function eN(e){if(typeof createImageBitmap!=`function`){console.info(`Safari<15: applying SDF canvas workaround`);let{sdfCanvas:t,sdfTexture:n}=e,{width:r,height:i}=t,a=e.sdfCanvas.getContext(`webgl`),o=n.image.data;(!o||o.length!==r*i*4)&&(o=new Uint8Array(r*i*4),n.image={width:r,height:i,data:o},n.flipY=!1,n.isDataTexture=!0),a.readPixels(0,0,r,i,a.RGBA,a.UNSIGNED_BYTE,o)}}var tN=Yj({name:`Typesetter`,dependencies:[Yj({name:`Typesetter`,dependencies:[EM,TM,nM],init(e,t,n){return e(t,n())}})],init(e){return function(t){return new Promise(n=>{e.typeset(t,n)})}},getTransferables(e){let t=[];for(let n in e)e[n]&&e[n].buffer&&t.push(e[n].buffer);return t}}),nN=tN.onMainThread,rN={};function iN(e){let t=rN[e];return t||=rN[e]=new Ox(1,1,e,e).translate(.5,.5,0),t}var aN=`aTroikaGlyphBounds`,oN=`aTroikaGlyphIndex`,sN=`aTroikaGlyphColor`,cN=class extends $S{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new Rh,this.boundingBox=new bh}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!=`number`||e<1)&&(e=1);let t=iN(e);
4596[`position`,`normal`,`uv`].forEach(e=>{this.attributes[e]=t.attributes[e].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,r,i){this.updateAttributeData(aN,e,4),this.updateAttributeData(oN,t,1),this.updateAttributeData(sN,i,3),this._blockBounds=n,this._chunkedBounds=r,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){let e=this._blockBounds;if(e){let{curveRadius:t,boundingBox:n}=this;if(t){let{PI:r,floor:i,min:a,max:o,sin:s,cos:c}=Math,l=r/2,u=r*2,d=Math.abs(t),f=e[0]/d,p=e[2]/d,m=i((f+l)/u)===i((p+l)/u)?a(s(f)*d,s(p)*d):-d,h=i((f-l)/u)===i((p-l)/u)?o(s(f)*d,s(p)*d):d,g=i((f+r)/u)===i((p+r)/u)?o(d-c(f)*d,d-c(p)*d):d*2;n.min.set(m,e[1],t<0?-g:0),n.max.set(h,e[3],t<0?0:g)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(oN).count,n=this._chunkedBounds;if(n)for(let r=n.length;r--;){t=n[r].end;let i=n[r].rect;if(i[1]<e.w&&i[3]>e.y&&i[0]<e.z&&i[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,n){let r=this.getAttribute(e);t?r&&r.array.length===t.length?(r.array.set(t),r.needsUpdate=!0):(this.setAttribute(e,new Iv(t,n)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}},lN=` 4597uniform vec2 uTroikaSDFTextureSize; 4598uniform float uTroikaSDFGlyphSize; 4599uniform vec4 uTroikaTotalBounds; 4600uniform vec4 uTroikaClipRect; 4601uniform mat3 uTroikaOrient; 4602uniform bool uTroikaUseGlyphColors; 4603uniform float uTroikaEdgeOffset; 4604uniform float uTroikaBlurRadius; 4605uniform vec2 uTroikaPositionOffset; 4606uniform float uTroikaCurveRadius; 4607attribute vec4 aTroikaGlyphBounds; 4608attribute float aTroikaGlyphIndex; 4609attribute vec3 aTroikaGlyphColor; 4610varying vec2 vTroikaGlyphUV; 4611varying vec4 vTroikaTextureUVBounds; 4612varying float vTroikaTextureChannel; 4613varying vec3 vTroikaGlyphColor; 4614varying vec2 vTroikaGlyphDimensions; 4615`,uN=` 4616vec4 bounds = aTroikaGlyphBounds; 4617bounds.xz += uTroikaPositionOffset.x; 4618bounds.yw -= uTroikaPositionOffset.y; 4619 4620vec4 outlineBounds = vec4( 4621 bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius, 4622 bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius 4623); 4624vec4 clippedBounds = vec4( 4625 clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw), 4626 clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw) 4627); 4628 4629vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy); 4630 4631position.xy = mix(bounds.xy, bounds.zw, clippedXY); 4632 4633uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy); 4634 4635float rad = uTroikaCurveRadius; 4636if (rad != 0.0) { 4637 float angle = position.x / rad; 4638 position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad); 4639 normal.xz = vec2(sin(angle), cos(angle)); 4640} 4641 4642position = uTroikaOrient * position; 4643normal = uTroikaOrient * normal; 4644 4645vTroikaGlyphUV = clippedXY.xy; 4646vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]); 4647 4648 4649float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize; 4650vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize; 4651vec2 txStartUV = txUvPerSquare * vec2( 4652 mod(floor(aTroikaGlyphIndex / 4.0), txCols), 4653 floor(floor(aTroikaGlyphIndex / 4.0) / txCols) 4654); 4655vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare); 4656vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0); 4657`,dN=` 4658uniform sampler2D uTroikaSDFTexture; 4659uniform vec2 uTroikaSDFTextureSize; 4660uniform float uTroikaSDFGlyphSize; 4661uniform float uTroikaSDFExponent; 4662uniform float uTroikaEdgeOffset; 4663uniform float uTroikaFillOpacity; 4664uniform float uTroikaBlurRadius; 4665uniform vec3 uTroikaStrokeColor; 4666uniform float uTroikaStrokeWidth; 4667uniform float uTroikaStrokeOpacity; 4668uniform bool uTroikaSDFDebug; 4669varying vec2 vTroikaGlyphUV; 4670varying vec4 vTroikaTextureUVBounds; 4671varying float vTroikaTextureChannel; 4672varying vec2 vTroikaGlyphDimensions; 4673 4674float troikaSdfValueToSignedDistance(float alpha) { 4675 // Inverse of exponential encoding in webgl-sdf-generator 4676 4677 float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y); 4678 float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension; 4679 float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0); 4680 return signedDist; 4681} 4682 4683float troikaGlyphUvToSdfValue(vec2 glyphUV) { 4684 vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV); 4685 vec4 rgba = texture2D(uTroikaSDFTexture, textureUV); 4686 float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1 4687 return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a; 4688} 4689 4690float troikaGlyphUvToDistance(vec2 uv) { 4691 return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv)); 4692} 4693 4694float troikaGetAADist() { 4695 4696 #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300 4697 return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5; 4698 #else 4699 return vTroikaGlyphDimensions.x / 64.0; 4700 #endif 4701} 4702 4703float troikaGetFragDistValue() { 4704 vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize); 4705 float distance = troikaGlyphUvToDistance(clampedGlyphUV); 4706 4707 // Extrapolate distance when outside bounds: 4708 distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 4709 length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions); 4710 4711 4712 4713 return distance; 4714} 4715 4716float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) { 4717 #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL) 4718 float alpha = step(-distanceOffset, -distance); 4719 #else 4720 4721 float alpha = smoothstep( 4722 distanceOffset + aaDist, 4723 distanceOffset - aaDist, 4724 distance 4725 ); 4726 #endif 4727 4728 return alpha; 4729} 4730`,fN=` 4731float aaDist = troikaGetAADist(); 4732float fragDistance = troikaGetFragDistValue(); 4733float edgeAlpha = uTroikaSDFDebug ? 4734 troikaGlyphUvToSdfValue(vTroikaGlyphUV) : 4735 troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius)); 4736 4737#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL) 4738vec4 fillRGBA = gl_FragColor; 4739fillRGBA.a *= uTroikaFillOpacity; 4740vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity); 4741if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb; 4742gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep( 4743 -uTroikaStrokeWidth - aaDist, 4744 -uTroikaStrokeWidth + aaDist, 4745 fragDistance 4746));
4747gl_FragColor.a *= edgeAlpha; 4748#endif 4749 4750if (edgeAlpha == 0.0) { 4751 discard; 4752} 4753`;function pN(e){let t=fM(e,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Y},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new ph(0,0,0,0)},uTroikaClipRect:{value:new ph(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Y},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Z},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Zm},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:lN,vertexTransform:uN,fragmentDefs:dN,fragmentColorTransform:fN,customRewriter({vertexShader:e,fragmentShader:t}){let n=/\buniform\s+vec3\s+diffuse\b/;return n.test(t)&&(t=t.replace(n,`varying vec3 vTroikaGlyphColor`).replace(/\bdiffuse\b/g,`vTroikaGlyphColor`),n.test(e)||(e=e.replace(rM,`uniform vec3 diffuse; 4754$& 4755vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; 4756`))),{vertexShader:e,fragmentShader:t}}});return t.transparent=!0,t.forceSinglePass=!0,Object.defineProperties(t,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),t}var mN=new Hg({color:16777215,side:2,transparent:!0}),hN=8421504,gN=new qh,_N=new X,vN=new X,yN=[],bN=new X,xN=`+x+y`;function SN(e){return Array.isArray(e)?e[0]:e}var CN=()=>{let e=new T_(new Ox(1,1),mN);return CN=()=>e,e},wN=()=>{let e=new T_(new Ox(1,1,32,1),mN);return wN=()=>e,e},TN={type:`syncstart`},EN={type:`synccomplete`},DN=[`font`,`fontSize`,`fontStyle`,`fontWeight`,`lang`,`letterSpacing`,`lineHeight`,`maxWidth`,`overflowWrap`,`text`,`direction`,`textAlign`,`textIndent`,`whiteSpace`,`anchorX`,`anchorY`,`colorRanges`,`sdfGlyphSize`],ON=DN.concat(`material`,`color`,`depthOffset`,`clipRect`,`curveRadius`,`orientation`,`glyphGeometryDetail`),kN=class extends T_{constructor(){let e=new cN;super(e,null),this.text=``,this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction=`auto`,this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight=`normal`,this.fontStyle=`normal`,this.lang=null,this.letterSpacing=0,this.lineHeight=`normal`,this.maxWidth=1/0,this.overflowWrap=`normal`,this.textAlign=`left`,this.textIndent=0,this.whiteSpace=`normal`,this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=hN,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=xN,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||=[]).push(e):(this._isSyncing=!0,this.dispatchEvent(TN),qM({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||`normal`,fontStyle:this.fontStyle||`normal`,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||`normal`,maxWidth:this.maxWidth,direction:this.direction||`auto`,textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(e=>e&&e())})),this.dispatchEvent(EN),e&&e()})))}onBeforeRender(e,t,n,r,i,a){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return pN(e)}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=mN.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener(`dispose`,function n(){t.removeEventListener(`dispose`,n),e.dispose()})),this.hasOutline()){let t=e._outlineMtl;return t||(t=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),t.isTextOutlineMaterial=!0,t.depthWrite=!1,t.map=null,e.addEventListener(`dispose`,function n(){e.removeEventListener(`dispose`,n),t.dis
4756pose()})),[t,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return SN(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return SN(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){let t=e.isTextOutlineMaterial,n=e.uniforms,r=this.textRenderInfo;if(r){let{sdfTexture:e,blockBounds:i}=r;n.uTroikaSDFTexture.value=e,n.uTroikaSDFTextureSize.value.set(e.image.width,e.image.height),n.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,n.uTroikaSDFExponent.value=r.sdfExponent,n.uTroikaTotalBounds.value.fromArray(i),n.uTroikaUseGlyphColors.value=!t&&!!r.glyphColors;let a=0,o=0,s=0,c,l,u,d=0,f=0;if(t){let{outlineWidth:e,outlineOffsetX:t,outlineOffsetY:n,outlineBlur:r,outlineOpacity:i}=this;a=this._parsePercent(e)||0,o=Math.max(0,this._parsePercent(r)||0),c=i,d=this._parsePercent(t)||0,f=this._parsePercent(n)||0}else s=Math.max(0,this._parsePercent(this.strokeWidth)||0),s&&(u=this.strokeColor,n.uTroikaStrokeColor.value.set(u??hN),l=this.strokeOpacity,l??=1),c=this.fillOpacity;n.uTroikaEdgeOffset.value=a,n.uTroikaPositionOffset.value.set(d,f),n.uTroikaBlurRadius.value=o,n.uTroikaStrokeWidth.value=s,n.uTroikaStrokeOpacity.value=l,n.uTroikaFillOpacity.value=c??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let p=this.clipRect;if(p&&Array.isArray(p)&&p.length===4)n.uTroikaClipRect.value.fromArray(p);else{let e=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(i[0]-e,i[1]-e,i[2]+e,i[3]+e)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let i=t?this.outlineColor||0:this.color;if(i==null)delete e.color;else{let t=e.hasOwnProperty(`color`)?e.color:e.color=new Z;(i!==t._input||typeof i==`object`)&&t.set(t._input=i)}let a=this.orientation||xN;if(a!==e._orientation){let t=n.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,``);let r=a!==xN&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(r){let[,e,n,i,a]=r;_N.set(0,0,0)[n]=e===`-`?1:-1,vN.set(0,0,0)[a]=i===`-`?-1:1,gN.lookAt(bN,_N.cross(vN),vN),t.setFromMatrix4(gN)}else t.identity();e._orientation=a}}_parsePercent(e){if(typeof e==`string`){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new Y){t.copy(e);let n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new Y){return _N.copy(e),this.localPositionToTextCoords(this.worldToLocal(_N),t)}raycast(e,t){let{textRenderInfo:n,curveRadius:r}=this;if(n){let i=n.blockBounds,a=r?wN():CN(),o=a.geometry,{position:s,uv:c}=o.attributes;for(let e=0;e<c.count;e++){let t=i[0]+c.getX(e)*(i[2]-i[0]),n=i[1]+c.getY(e)*(i[3]-i[1]),a=0;r&&(a=r-Math.cos(t/r)*r,t=Math.sin(t/r)*r),s.setXYZ(e,t,n,a)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,yN.length=0,a.raycast(e,yN);for(let e=0;e<yN.length;e++)yN[e].object=this,t.push(yN[e])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,ON.forEach(t=>{this[t]=e[t]}),this}clone(){return new this.constructor().copy(this)}};DN.forEach(e=>{let t=`_private_`+e;Object.defineProperty(kN.prototype,e,{get(){return this[t]},set(e){e!==this[t]&&(this[t]=e,this._needsSync=!0)}})}),new bh,new Z;var AN=S.forwardRef(({sdfGlyphSize:e=64,anchorX:t=`center`,anchorY:n=`middle`,font:r,fontSize:i=1,children:a,characters:o,onSync:s,...c},l)=>{let u=Bk(({invalidate:e})=>e),[d]=S.useState(()=>new kN),[f,p]=S.useMemo(()=>{let e=[],t=``;return S.Children.forEach(a,n=>
4756{typeof n==`string`||typeof n==`number`?t+=n:e.push(n)}),[e,t]},[a]);return FO(()=>new Promise(e=>XM({font:r,characters:o},e)),[`troika-text`,r,o]),S.useLayoutEffect(()=>void d.sync(()=>{u(),s&&s(d)})),S.useEffect(()=>()=>d.dispose(),[d]),S.createElement(`primitive`,ej({object:d,ref:l,font:r,text:p,anchorX:t,anchorY:n,fontSize:i,sdfGlyphSize:e},c),f)});function jN(e,t,n,r){var i;return i=class extends I_{constructor(i){for(let r in super({vertexShader:t,fragmentShader:n,...i}),e)this.uniforms[r]=new qC(e[r]),Object.defineProperty(this,r,{get(){return this.uniforms[r].value},set(e){this.uniforms[r].value=e}});this.uniforms=N_.clone(this.uniforms),r?.(this)}},i.key=qm.generateUUID(),i}var MN=(()=>parseInt(`182`.replace(/\D+/g,``)))();function NN(e,t,n){let r=Bk(e=>e.size),i=Bk(e=>e.viewport),a=typeof e==`number`?e:r.width*i.dpr,o=typeof t==`number`?t:r.height*i.dpr,s=(typeof e==`number`?n:e)||{},{samples:c=0,depth:l,...u}=s,d=l??s.depthBuffer,f=S.useMemo(()=>{let e=new hh(a,o,{minFilter:cf,magFilter:cf,type:bf,...u});return d&&(e.depthTexture=new Yy(a,o,yf)),e.samples=c,e},[]);return S.useLayoutEffect(()=>{f.setSize(a,o),c&&(f.samples=c)},[c,f,a,o]),S.useEffect(()=>()=>f.dispose(),[]),f}var PN=e=>typeof e==`function`,FN=S.forwardRef(({envMap:e,resolution:t=256,frames:n=1/0,makeDefault:r,children:i,...a},o)=>{let s=Bk(({set:e})=>e),c=Bk(({camera:e})=>e),l=Bk(({size:e})=>e),u=S.useRef(null);S.useImperativeHandle(o,()=>u.current,[]);let d=S.useRef(null),f=NN(t);S.useLayoutEffect(()=>{a.manual||(u.current.aspect=l.width/l.height)},[l,a]),S.useLayoutEffect(()=>{u.current.updateProjectionMatrix()});let p=0,m=null,h=PN(i);return Vk(t=>{h&&(n===1/0||p<n)&&(d.current.visible=!1,t.gl.setRenderTarget(f),m=t.scene.background,e&&(t.scene.background=e),t.gl.render(t.scene,u.current),t.scene.background=m,t.gl.setRenderTarget(null),d.current.visible=!0,p++)}),S.useLayoutEffect(()=>{if(r){let e=c;return s(()=>({camera:u.current})),()=>s(()=>({camera:e}))}},[u,r,s]),S.createElement(S.Fragment,null,S.createElement(`perspectiveCamera`,ej({ref:u},a),!h&&i),S.createElement(`group`,{ref:d},h&&i(f.texture)))}),IN=S.forwardRef(function({children:e,object:t,disable:n,disableX:r,disableY:i,disableZ:a,left:o,right:s,top:c,bottom:l,front:u,back:d,onCentered:f,precise:p=!0,cacheKey:m=0,...h},g){let _=S.useRef(null),v=S.useRef(null),y=S.useRef(null),[b]=S.useState(()=>new bh),[x]=S.useState(()=>new X),[C]=S.useState(()=>new Rh);return S.useLayoutEffect(()=>{v.current.matrixWorld.identity(),b.setFromObject(t??y.current,p);let e=b.max.x-b.min.x,m=b.max.y-b.min.y,h=b.max.z-b.min.z;b.getCenter(x),b.getBoundingSphere(C);let g=c?m/2:l?-m/2:0,S=o?-e/2:s?e/2:0,w=u?h/2:d?-h/2:0;v.current.position.set(n||r?0:-x.x+S,n||i?0:-x.y+g,n||a?0:-x.z+w),f?.({parent:_.current.parent,container:_.current,width:e,height:m,depth:h,boundingBox:b,boundingSphere:C,center:x,verticalAlignment:g,horizontalAlignment:S,depthAlignment:w})},[m,f,c,o,u,n,r,i,a,t,p,s,l,d,b,x,C]),S.useImperativeHandle(g,()=>_.current,[]),S.createElement(`group`,ej({ref:_},h),S.createElement(`group`,{ref:v},S.createElement(`group`,{ref:y},e)))}),LN=`#define GLSLIFY 1 4757vec3 mod289(vec3 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 mod289(vec4 x){return x-floor(x*(1.0/289.0))*289.0;}vec4 permute(vec4 x){return mod289(((x*34.0)+1.0)*x);}vec4 taylorInvSqrt(vec4 r){return 1.79284291400159-0.85373472095314*r;}float snoise(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;
4757vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}`,RN=class extends Ux{constructor(e={}){super(e),this.setValues(e),this._time={value:0},this._distort={value:.4},this._radius={value:1}}onBeforeCompile(e){e.uniforms.time=this._time,e.uniforms.radius=this._radius,e.uniforms.distort=this._distort,e.vertexShader=` 4758 uniform float time; 4759 uniform float radius; 4760 uniform float distort; 4761 ${LN} 4762 ${e.vertexShader} 4763 `,e.vertexShader=e.vertexShader.replace(`#include <begin_vertex>`,` 4764 float updateTime = time / 50.0; 4765 float noise = snoise(vec3(position / 2.0 + updateTime * 5.0)); 4766 vec3 transformed = vec3(position * (noise * pow(distort, 2.0) + radius)); 4767 `)}get time(){return this._time.value}set time(e){this._time.value=e}get distort(){return this._distort.value}set distort(e){this._distort.value=e}get radius(){return this._radius.value}set radius(e){this._radius.value=e}},zN=S.forwardRef(({speed:e=1,...t},n)=>{let[r]=S.useState(()=>new RN);return Vk(t=>r&&(r.time=t.clock.elapsedTime*e)),S.createElement(`primitive`,ej({object:r,ref:n,attach:`material`},t))}),BN=jN({},`void main() { }`,`void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }`),VN=1e-5;function HN(e,t,n){let r=new Rb,i=n-VN;return r.absarc(VN,VN,VN,-Math.PI/2,-Math.PI,!0),r.absarc(VN,t-i*2,VN,Math.PI,Math.PI/2,!0),r.absarc(e-i*2,t-i*2,VN,Math.PI/2,0,!0),r.absarc(e-i*2,VN,VN,0,-Math.PI/2,!0),r}var UN=S.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:i=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:s=.4,children:c,...l},u){return S.createElement(`mesh`,ej({ref:u},l),S.createElement(WN,{args:[e,t,n],radius:r,steps:i,smoothness:a,bevelSegments:o,creaseAngle:s}),c)}),WN=S.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:i=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:s=.4,...c},l){let u=S.useMemo(()=>HN(e,t,r),[e,t,r]),d=S.useMemo(()=>({depth:n-r*2,bevelEnabled:!0,bevelSegments:o*2,steps:i,bevelSize:r-VN,bevelThickness:r,curveSegments:a}),[n,r,a,o,i]),f=S.useRef(null);return S.useLayoutEffect(()=>{f.current&&(f.current.center(),nj(f.current,s))},[u,d,s]),S.useImperativeHandle(l,()=>f.current),S.createElement(`extrudeGeometry`,ej({ref:f,args:[u,d]},c))}),GN=function(e){return e[e.NONE=0]=`NONE`,e[e.START=1]=`START`,e[e.ACTIVE=2]=`ACTIVE`,e}(GN||{}),KN=e=>e&&e.isOrthographicCamera,qN=e=>e&&e.isBox3,JN=e=>1-Math.exp(-5*e)+.007*e,YN=S.createContext(null);function XN({children:e,maxDuration:t=1,margin:n=1.2,observe:r,fit:i,clip:a,interpolateFunc:o=JN,onFit:s}){let c=S.useRef(null),{camera:l,size:u,invalidate:d}=Bk(),f=Bk(e=>e.controls),p=S.useRef(s);p.current=s;let m=S.useRef({camPos:new X,camRot:new Jm,camZoom:1}),h=S.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),g=S.useRef(GN.NONE),_=S.useRef(0),[v]=S.useState(()=>new bh),y=S.useMemo(()=>{function e(){let e=v.getSize(new X),t=v.getCenter(new X),r=Math.max(e.x,e.y,e.z),i=KN(l)?r*4:r/(2*Math.atan(Math.PI*l.fov/360)),a=KN(l)?r*4:i/l.aspect;return{box:v,size:e,center:t,distance:n*Math.max(i,a)}}return{getSize:e,refresh(e){if(qN(e))v.copy(e);else{let t=e||c.current;if(!t)return this;t.updateWorldMatrix(!0,!0),v.setFromObject(t)}if(v.isEmpty()){let e=l.position.length()||10;v.setFromCenterAndSize(new X,new X(e,e,e))}return m.current.camPos.copy(l.position),m.current.camRot.copy(l.quaternion),KN(l)&&(m.current.camZoom=l.zoom),h.current.camPos=void 0,h.current.camRot=void 0,h.current.camZoom=void 0,h.current.camUp=void 0,h.current.target=void 0,this},reset(){let{center:t,distance:n}=e(),r=l.position.clone().sub(t).normalize();h.current.camPos=t.clone().addScaledVector(r,n),h.current.target=t.clone();let i=new qh().lookAt(h.current.camPos,h.current.target,l.up);return h.current.camRot=new Jm().setFromRotationMatrix(i),g.current=GN.START,_.current=0,this},moveTo(e){return h.current.camPos=Array.isArray(e)?new X(...e):e.clone(),g.current=GN.START,_.current=0,this},lookAt({target:e,up:t}){h.current.target=Array.isArray(e)?new X(...e):e.clone(),t?h.current.camUp=Array.isArray(t)?new X(...t):t.clone():h.current.camUp=l.up.
4767clone();let n=new qh().lookAt(h.current.camPos||l.position,h.current.target,h.current.camUp);return h.current.camRot=new Jm().setFromRotationMatrix(n),g.current=GN.START,_.current=0,this},to({position:e,target:t}){return this.moveTo(e).lookAt({target:t})},fit(){if(!KN(l))return this.reset();let e=0,t=0,r=[new X(v.min.x,v.min.y,v.min.z),new X(v.min.x,v.max.y,v.min.z),new X(v.min.x,v.min.y,v.max.z),new X(v.min.x,v.max.y,v.max.z),new X(v.max.x,v.max.y,v.max.z),new X(v.max.x,v.max.y,v.min.z),new X(v.max.x,v.min.y,v.max.z),new X(v.max.x,v.min.y,v.min.z)],i=h.current.camPos||l.position,a=h.current.target||f?.target,o=h.current.camUp||l.up,s=a?new qh().lookAt(i,a,o).setPosition(i).invert():l.matrixWorldInverse;for(let n of r)n.applyMatrix4(s),e=Math.max(e,Math.abs(n.y)),t=Math.max(t,Math.abs(n.x));e*=2,t*=2;let c=(l.top-l.bottom)/e,u=(l.right-l.left)/t;return h.current.camZoom=Math.min(c,u)/n,g.current=GN.START,_.current=0,p.current&&p.current(this.getSize()),this},clip(){let{distance:t}=e();return l.near=t/100,l.far=t*100,l.updateProjectionMatrix(),f&&(f.maxDistance=t*10,f.update()),d(),this}}},[v,l,f,n,d]);S.useLayoutEffect(()=>{if(f){let e=()=>{if(f&&h.current.target&&g.current!==GN.NONE){let e=new X().setFromMatrixColumn(l.matrix,2),t=m.current.camPos.distanceTo(f.target),n=(h.current.camPos||m.current.camPos).distanceTo(h.current.target),r=(1-_.current)*t+_.current*n;f.target.copy(l.position).addScaledVector(e,-r),f.update()}g.current=GN.NONE};return f.addEventListener(`start`,e),()=>f.removeEventListener(`start`,e)}},[f]);let b=S.useRef(0);return S.useLayoutEffect(()=>{(r||b.current++===0)&&(y.refresh(),i&&y.reset().fit(),a&&y.clip())},[u,a,i,r,l,f]),Vk((e,n)=>{if(g.current===GN.START)g.current=GN.ACTIVE,d();else if(g.current===GN.ACTIVE){if(_.current+=n/t,_.current>=1)h.current.camPos&&l.position.copy(h.current.camPos),h.current.camRot&&l.quaternion.copy(h.current.camRot),h.current.camUp&&l.up.copy(h.current.camUp),h.current.camZoom&&KN(l)&&(l.zoom=h.current.camZoom),l.updateMatrixWorld(),l.updateProjectionMatrix(),f&&h.current.target&&(f.target.copy(h.current.target),f.update()),g.current=GN.NONE;else{let e=o(_.current);h.current.camPos&&l.position.lerpVectors(m.current.camPos,h.current.camPos,e),h.current.camRot&&l.quaternion.slerpQuaternions(m.current.camRot,h.current.camRot,e),h.current.camUp&&l.up.set(0,1,0).applyQuaternion(l.quaternion),h.current.camZoom&&KN(l)&&(l.zoom=(1-e)*m.current.camZoom+e*h.current.camZoom),l.updateMatrixWorld(),l.updateProjectionMatrix()}d()}}),S.createElement(`group`,{ref:c},S.createElement(YN.Provider,{value:y},e))}function ZN(){return S.useContext(YN)}var QN=S.forwardRef(({children:e,enabled:t=!0,speed:n=1,rotationIntensity:r=1,floatIntensity:i=1,floatingRange:a=[-.1,.1],autoInvalidate:o=!1,...s},c)=>{let l=S.useRef(null);S.useImperativeHandle(c,()=>l.current,[]);let u=S.useRef(Math.random()*1e4);return Vk(e=>{if(!t||n===0)return;o&&e.invalidate();let s=u.current+e.clock.elapsedTime;l.current.rotation.x=Math.cos(s/4*n)/8*r,l.current.rotation.y=Math.sin(s/4*n)/8*r,l.current.rotation.z=Math.sin(s/4*n)/20*r;let c=Math.sin(s/4*n)/10;c=qm.mapLinear(c,-.1,.1,a?.[0]??-.1,a?.[1]??.1),l.current.position.y=c*i,l.current.updateMatrix()}),S.createElement(`group`,s,S.createElement(`group`,{ref:l,matrixAutoUpdate:!1},e))}),$N=(e,t,n)=>{let r;switch(e){case pf:r=new Uint8ClampedArray(t*n*4);break;case bf:r=new Uint16Array(t*n*4);break;case vf:r=new Uint32Array(t*n*4);break;case mf:r=new Int8Array(t*n*4);break;case hf:r=new Int16Array(t*n*4);break;case _f:r=new Int32Array(t*n*4);break;case yf:r=new Float32Array(t*n*4);break;default:throw Error(`Unsupported data type`)}return r},eP,tP=(e,t,n,r)=>{if(eP!==void 0)return eP;let i=new hh(1,1,r);t.setRenderTarget(i);let a=new T_(new Ox,new Hg({color:16777215}));t.render(a,n),t.setRenderTarget(null);let o=$N(e,i.width,i.height);return t.readRenderTargetPixels(i,0,0,i.width,i.height,o),i.dispose(),a.geometry.dispose(),a.material.dispose(),eP=o[0]!==0,eP},nP=class e{_renderer;_rendererIsDisposable=!1;_material;_scene;_camera;_quad;_renderTarget;_width;_height;_type;_colorSpace;_supportsReadPixels=!0;constructor(t){this._width=t.width,this._height=t.height,this._type=t.type,this._colorSpace
vendor: 8,573 bytes, line 4767
4767=t.colorSpace;let n={format:Of,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:t.renderTargetOptions?.anisotropy===void 0?1:t.renderTargetOptions?.anisotropy,generateMipmaps:t.renderTargetOptions?.generateMipmaps===void 0?!1:t.renderTargetOptions?.generateMipmaps,magFilter:t.renderTargetOptions?.magFilter===void 0?cf:t.renderTargetOptions?.magFilter,minFilter:t.renderTargetOptions?.minFilter===void 0?cf:t.renderTargetOptions?.minFilter,samples:t.renderTargetOptions?.samples===void 0?void 0:t.renderTargetOptions?.samples,wrapS:t.renderTargetOptions?.wrapS===void 0?ef:t.renderTargetOptions?.wrapS,wrapT:t.renderTargetOptions?.wrapT===void 0?ef:t.renderTargetOptions?.wrapT};if(this._material=t.material,t.renderer?this._renderer=t.renderer:(this._renderer=e.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Q_,this._camera=new WS,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!tP(this._type,this._renderer,this._camera,n)){let e;switch(this._type){case bf:e=this._renderer.extensions.has(`EXT_color_buffer_float`)?yf:void 0;break}e===void 0?(this._supportsReadPixels=!1,console.warn(`This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown`)):(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${yf}`),this._type=e)}this._quad=new T_(new Ox,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new hh(this.width,this.height,n),this._renderTarget.texture.mapping=t.renderTargetOptions?.mapping===void 0?300:t.renderTargetOptions?.mapping}static instantiateRenderer(){let e=new yO;return e.setSize(128,128),e}render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)};toArray(){if(!this._supportsReadPixels)throw Error(`Can't read pixels in this browser`);let e=$N(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){let t=new Mv(this.toArray(),this.width,this.height,Of,this._type,e?.mapping||300,e?.wrapS||1001,e?.wrapT||1001,e?.magFilter||1006,e?.minFilter||1006,e?.anisotropy||1,Fp);return t.generateMipmaps=e?.generateMipmaps===void 0?!1:e?.generateMipmaps,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof I_&&Object.values(this.material.uniforms).forEach(e=>{e.value instanceof fh&&e.value.dispose()}),Object.values(this.material).forEach(e=>{e instanceof fh&&e.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}},rP=class extends Error{},iP=class extends Error{},aP=(e,t,n)=>{let r=RegExp(`${t}="([^"]*)"`,`i`).exec(e);if(r)return r[1];let i=RegExp(`<${t}[^>]*>([\\s\\S]*?)</${t}>`,`i`).exec(e);if(i){let e=i[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return e&&e.length===3?e.map(e=>e.replace(/<\/?rdf:li>/g,``)):i[1].trim()}if(n!==void 0)return n;throw Error(`Can't find ${t} in gainmap metadata`)},oP=e=>{let t;t=typeof TextDecoder<`u`?new TextDecoder().decode(e):e.toString();let n=t.indexOf(`<x:xmpmeta`);for(;n!==-1;){let e=t.indexOf(`x:xmpmeta>`,n),r=t.slice(n,e+10);try{let e=aP(r,`hdrgm:GainMapMin`,`0`),t=aP(r,`hdrgm:GainMapMax`),n=aP(r,`hdrgm:Gamma`,`1`),i=aP(r,`hdrgm:OffsetSDR`,`0.015625`),a=aP(r,`hdrgm:OffsetHDR`,`0.015625`),o=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(r),s=o?o[1]:`0`,c=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(r);if(!c)throw Error(`Incomplete gainmap metadata`);let l=c[1];return{gainMapMin:Array.isArray(e)?e.map(e=>parseFloat(e)):[parseFloat(e),parseFloat(e),parseFloat(e)],gainMapMax:Array.isArray(t)?t.map(e=>parseFloat(e)):[parseFloat(t),parseFloat(t),parseFloat(t)],gamma:Array.isArray(n)?n.map(e=>parseFloat(e)):[parseFloat(n),parseFloat(n),parseFloat(n)],offsetSdr:Array.isArray(i)?i.map(e=>parseFloat(e)):[parseFloat(i),parseFloat(i),parseFloat(i)],offsetHdr:Array.isArray(a)?a.map(e=>parseFloat(e)):[parseFloat(a),parseFloat(a),parseFloat(a)],hdrCapacityMin:parseFloat(s),hdrCapacityMax:parseFloat(l)}}catch{}n=t.indexOf(`<x:xmpmeta`,e)}},sP=class{options;constructor(e){this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((t,n)=>{let r=this.options.debug,i=new DataView(e.buffer);if(i.getUint16(0)!==65496){n(Error(`Not a valid jpeg`));return}let a=i.byteLength,o=2,s=0,c;for(;o<a;){if(++s>250){n(Error(`Found no marker after ${s} loops ðµ`));return}if(i.getUint8(o)!==255){n(Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${i.getUint8(o).toString(16)}`));return}if(c=i.getUint8(o+1),r&&console.log(`Marker: ${c.toString(16)}`),c===226){r&&console.log(`Found APP2 marker (0xffe2)`);let e=o+4;if(i.getUint32(e)===1297106432){let r=e+4,a;if(i.getUint16(r)===18761)a=!1;else if(i.getUint16(r)===19789)a=!0;else{n(Error(`No valid endianness marker found in TIFF header`));return}if(i.getUint16(r+2,!a)!==42){n(Error(`Not valid TIFF data! (no 0x002A marker)`));return}let o=i.getUint32(r+4,!a);if(o<8){n(Error(`Not valid TIFF data! (First offset less than 8)`));return}let s=r+o,c=i.getUint16(s,!a),l=s+2,u=0;for(let e=l;e<l+12*c;e+=12)i.getUint16(e,!a)===45057&&(u=i.getUint32(e+8,!a));let d=s+2+c*12+4,f=[];for(let e=d;e<d+u*16;e+=16){let t={MPType:i.getUint32(e,!a),size:i.getUint32(e+4,!a),dataOffset:i.getUint32(e+8,!a),dependantImages:i.getUint32(e+12,!a),start:-1,end:-1,isFII:!1};t.dataOffset?(t.start=r+t.dataOffset,t.isFII=!1):(t.start=0,t.isFII=!0),t.end=t.start+t.size,f.push(t)}if(this.options.extractNonFII&&f.length){let e=new Blob([i]),n=[];for(let t of f){if(t.isFII&&!this.options.extractFII)continue;let r=e.slice(t.start,t.end+1,`image/jpeg`);n.push(r)}t(n)}}}o+=2+i.getUint16(o+2)}})}},cP=async e=>{let t=oP(e);if(!t)throw new iP(`Gain map XMP metadata not found`);let n=await new sP({extractFII:!0,extractNonFII:!0}).extract(e);if(n.length!==2)throw new rP(`Gain map recovery image not found`);return{sdr:new Uint8Array(await n[0].arrayBuffer()),gainMap:new Uint8Array(await n[1].arrayBuffer()),metadata:t}},lP=e=>new Promise((t,n)=>{let r=document.createElement(`img`);r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=URL.createObjectURL(e)}),uP=class extends CS{_renderer;_renderTargetOptions;_internalLoadingManager;_config;constructor(e,t){super(t),this._config=e,e.renderer&&(this._renderer=e.renderer),this._internalLoadingManager=new xS}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn(`WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.`);let e=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new fh,sdr:new fh});return this._config.createQuadRenderer({width:16,height:16,type:bf,colorSpace:Fp,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(e,t,n){let r=t?new Blob([t],{type:`image/jpeg`}):void 0,i=new Blob([e],{type:`image/jpeg`}),a,o,s=!1;if(typeof createImageBitmap>`u`){let e=await Promise.all([r?lP(r):Promise.resolve(void 0),lP(i)]);o=e[0],a=e[1],s=n===`flipY`}else{let e=await Promise.all([r?createImageBitmap(r,{imageOrientation:n||`flipY`}):Promise.resolve(void 0),createImageBitmap(i,{imageOrientation:n||`flipY`})]);o=e[0],a=e[1]}return{sdrImage:a,gainMapImage:o,needsFlip:s}}
4767createTextures(e,t,n){let r=new fh(t||new ImageData(2,2),300,ef,ef,cf,ff,Of,pf,1,Fp);r.flipY=n,r.needsUpdate=!0;let i=new fh(e,300,ef,ef,cf,ff,Of,pf,1,Pp);return i.flipY=n,i.needsUpdate=!0,{gainMap:r,sdr:i}}updateQuadRenderer(e,t,n,r,i){e.width=t.width,e.height=t.height,e.material.gainMap=n,e.material.sdr=r,e.material.gainMapMin=i.gainMapMin,e.material.gainMapMax=i.gainMapMax,e.material.offsetHdr=i.offsetHdr,e.material.offsetSdr=i.offsetSdr,e.material.gamma=i.gamma,e.material.hdrCapacityMin=i.hdrCapacityMin,e.material.hdrCapacityMax=i.hdrCapacityMax,e.material.maxDisplayBoost=2**i.hdrCapacityMax,e.material.needsUpdate=!0}},dP=` 4768varying vec2 vUv; 4769 4770void main() { 4771 vUv = uv; 4772 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 4773} 4774`,fP=` 4775// min half float value 4776#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 ) 4777// max half float value 4778#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 ) 4779 4780uniform sampler2D sdr; 4781uniform sampler2D gainMap; 4782uniform vec3 gamma; 4783uniform vec3 offsetHdr; 4784uniform vec3 offsetSdr; 4785uniform vec3 gainMapMin; 4786uniform vec3 gainMapMax; 4787uniform float weightFactor; 4788 4789varying vec2 vUv; 4790 4791void main() { 4792 vec3 rgb = texture2D( sdr, vUv ).rgb; 4793 vec3 recovery = texture2D( gainMap, vUv ).rgb; 4794 vec3 logRecovery = pow( recovery, gamma ); 4795 vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery; 4796 vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr; 4797 vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); 4798 gl_FragColor = vec4( clampedHdrColor , 1.0 ); 4799} 4800`,pP=class extends I_{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:n,gainMapMin:r,gainMapMax:i,maxDisplayBoost:a,hdrCapacityMin:o,hdrCapacityMax:s,sdr:c,gainMap:l}){super({name:`GainMapDecoderMaterial`,vertexShader:dP,fragmentShader:fP,uniforms:{sdr:{value:c},gainMap:{value:l},gamma:{value:new X(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new X().fromArray(t)},offsetSdr:{value:new X().fromArray(n)},gainMapMin:{value:new X().fromArray(r)},gainMapMax:{value:new X().fromArray(i)},weightFactor:{value:(Math.log2(a)-o)/(s-o)}},blending:0,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=a,this._hdrCapacityMin=o,this._hdrCapacityMax=s,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){let e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){let t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){let e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}},mP=class extends uP{constructor(e,t){super({renderer:e,createMaterial:e=>new pP(e),createQuadRenderer:e=>new nP(e)},t)}async render(e,t,n,r){let{sdrImage:i,gainMapImage:a,needsFlip:o}=await this.processImages(n,r,`flipY`),{gainMap:s,sdr:c}=this.createTextures(i,a,o);this.updateQuadRenderer(e,i,s,c,t),e.render()}},hP=class extends mP{load([e,t,n],r,i,a){let o=this.prepareQuadRenderer(),s,c,l,u=async()=>
4800{if(s&&c&&l){try{await this.render(o,l,s,c)}catch(r){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(n),typeof a==`function`&&a(r),o.disposeOnDemandRenderer();return}typeof r==`function`&&r(o),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(n),o.disposeOnDemandRenderer()}},d=!0,f=0,p=0,m=!0,h=0,g=0,_=!0,v=0,y=0,b=()=>{if(typeof i==`function`){let e=f+h+v,t=p+g+y,n=d&&m&&_;i(new ProgressEvent(`progress`,{lengthComputable:n,loaded:t,total:e}))}};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(n);let x=new ES(this._internalLoadingManager);x.setResponseType(`arraybuffer`),x.setRequestHeader(this.requestHeader),x.setPath(this.path),x.setWithCredentials(this.withCredentials),x.load(e,async e=>{if(typeof e==`string`)throw Error(`Invalid sdr buffer`);s=e,await u()},e=>{d=e.lengthComputable,p=e.loaded,f=e.total,b()},t=>{this.manager.itemError(e),typeof a==`function`&&a(t)});let S=new ES(this._internalLoadingManager);S.setResponseType(`arraybuffer`),S.setRequestHeader(this.requestHeader),S.setPath(this.path),S.setWithCredentials(this.withCredentials),S.load(t,async e=>{if(typeof e==`string`)throw Error(`Invalid gainmap buffer`);c=e,await u()},e=>{m=e.lengthComputable,g=e.loaded,h=e.total,b()},e=>{this.manager.itemError(t),typeof a==`function`&&a(e)});let C=new ES(this._internalLoadingManager);return C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(n,async e=>{if(typeof e!=`string`)throw Error(`Invalid metadata string`);l=JSON.parse(e),await u()},e=>{_=e.lengthComputable,y=e.loaded,v=e.total,b()},e=>{this.manager.itemError(n),typeof a==`function`&&a(e)}),o}},gP=class extends mP{load(e,t,n,r){let i=this.prepareQuadRenderer(),a=new ES(this._internalLoadingManager);return a.setResponseType(`arraybuffer`),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(this.withCredentials),this.manager.itemStart(e),a.load(e,async n=>{if(typeof n==`string`)throw Error(`Invalid buffer, received [string], was expecting [ArrayBuffer]`);let a=new Uint8Array(n),o,s,c;try{let e=await cP(a);o=e.sdr,s=e.gainMap,c=e.metadata}catch(t){if(t instanceof iP||t instanceof rP)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),c={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},o=a;else throw t}try{await this.render(i,c,o.buffer,s?.buffer)}catch(t){this.manager.itemError(e),typeof r==`function`&&r(t),i.disposeOnDemandRenderer();return}typeof t==`function`&&t(i),this.manager.itemEnd(e),i.disposeOnDemandRenderer()},n,t=>{this.manager.itemError(e),typeof r==`function`&&r(t)}),i}},_P={apartment:`lebombo_1k.hdr`,city:`potsdamer_platz_1k.hdr`,dawn:`kiara_1_dawn_1k.hdr`,forest:`forest_slope_1k.hdr`,lobby:`st_fagans_interior_1k.hdr`,night:`dikhololo_night_1k.hdr`,park:`rooitou_park_1k.hdr`,studio:`studio_small_03_1k.hdr`,sunset:`venice_sunset_1k.hdr`,warehouse:`empty_warehouse_01_1k.hdr`},vP=`https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/`,yP=e=>Array.isArray(e),bP=[`/px.png`,`/nx.png`,`/py.png`,`/ny.png`,`/pz.png`,`/nz.png`];function xP({files:e=bP,path:t=``,preset:n=void 0,colorSpace:r=void 0,extensions:i}={}){n&&(wP(n),e=_P[n],t=vP);let a=yP(e),{extension:o,isCubemap:s}=TP(e),c=EP(o);if(!c)throw Error(`useEnvironment: Unrecognized file extension: `+e);let l=Bk(e=>e.gl);(0,S.useLayoutEffect)(()=>{if(o!==`webp`&&o!==`jpg`&&o!==`jpeg`)return;function t(){Gk.clear(c,a?[e]:e)}l.domElement.addEventListener(`webglcontextlost`,t,{once:!0})},[e,l.domElement]);let u=Gk(c,a?[e]:e,e=>{(o===`webp`||o===`jpg`||o===`jpeg`)&&e.setRenderer(l),e.setPath==null||e.setPath(t),i&&i(e)}),d=a?u[0]:u;return(o===`jpg`||o===`jpeg`||o===`webp`)&&(d=d.renderTarget?.texture),d.mapping=s?301:303,d.colorSpace=r??(s?`srgb`:`srgb-linear`),d}var SP={files:bP,path:``,preset:void 0,extensions:void 0};xP.preload=e=>{let t={...SP,...e},{files:n,path:r=``}=t,{preset:i,extensions:a}=t;i&&(wP(i),n=_P[i],r=vP);let{extension:o}=TP(n);if(o===`webp`||o===`jpg`||o===`jpeg`)throw Error(`useEnvironment: Preloading gainmaps is not supported`);let s=EP(o);if(!s)throw Error(`useEnvironment: Unrecognized file extension: `+n);Gk.preload(s,yP(n)?[n]:n,e=>{e.setPath==null||e.setPath(r),a&&a(e)})};
4800var CP={files:bP,preset:void 0};xP.clear=e=>{let t={...CP,...e},{files:n}=t,{preset:r}=t;r&&(wP(r),n=_P[r]);let{extension:i}=TP(n),a=EP(i);if(!a)throw Error(`useEnvironment: Unrecognized file extension: `+n);Gk.clear(a,yP(n)?[n]:n)};function wP(e){if(!(e in _P))throw Error(`Preset must be one of: `+Object.keys(_P).join(`, `))}function TP(e){var t;let n=yP(e)&&e.length===6,r=yP(e)&&e.length===3&&e.some(e=>e.endsWith(`json`)),i=yP(e)?e[0]:e;return{extension:n?`cube`:r?`webp`:i.startsWith(`data:application/exr`)?`exr`:i.startsWith(`data:application/hdr`)?`hdr`:i.startsWith(`data:image/jpeg`)?`jpg`:(t=i.split(`.`).pop())==null||(t=t.split(`?`))==null||(t=t.shift())==null?void 0:t.toLowerCase(),isCubemap:n,isGainmap:r}}function EP(e){return e===`cube`?jS:e===`hdr`?Lj:e===`exr`?zj:e===`jpg`||e===`jpeg`?gP:e===`webp`?hP:null}var DP=e=>e.current&&e.current.isScene,OP=e=>DP(e)?e.current:e;function kP(e,t,n,r,i={}){var a,o;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};let s=OP(t||n),c=s.background,l=s.environment,u={backgroundBlurriness:s.backgroundBlurriness,backgroundIntensity:s.backgroundIntensity,backgroundRotation:((a=s.backgroundRotation)==null||a.clone==null?void 0:a.clone())??[0,0,0],environmentIntensity:s.environmentIntensity,environmentRotation:((o=s.environmentRotation)==null||o.clone==null?void 0:o.clone())??[0,0,0]};return e!==`only`&&(s.environment=r),e&&(s.background=r),Ok(s,i),()=>{e!==`only`&&(s.environment=l),e&&(s.background=c),Ok(s,u)}}function AP({scene:e,background:t=!1,map:n,...r}){let i=Bk(e=>e.scene);return S.useLayoutEffect(()=>{if(n)return kP(t,e,i,n,r)}),null}function jP({background:e=!1,scene:t,blur:n,backgroundBlurriness:r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s,...c}){let l=xP(c),u=Bk(e=>e.scene);return S.useLayoutEffect(()=>kP(e,t,u,l,{backgroundBlurriness:n??r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s})),S.useEffect(()=>()=>{l.dispose()},[l]),null}function MP({children:e,near:t=.1,far:n=1e3,resolution:r=256,frames:i=1,map:a,background:o=!1,blur:s,backgroundBlurriness:c,backgroundIntensity:l,backgroundRotation:u,environmentIntensity:d,environmentRotation:f,scene:p,files:m,path:h,preset:g=void 0,extensions:_}){let v=Bk(e=>e.gl),y=Bk(e=>e.scene),b=S.useRef(null),[x]=S.useState(()=>new Q_),C=S.useMemo(()=>{let e=new K_(r);return e.texture.type=bf,e},[r]);S.useEffect(()=>()=>{C.dispose()},[C]),S.useLayoutEffect(()=>{if(i===1){let e=v.autoClear;v.autoClear=!0,b.current.update(v,x),v.autoClear=e}return kP(o,p,y,C.texture,{backgroundBlurriness:s??c,backgroundIntensity:l,backgroundRotation:u,environmentIntensity:d,environmentRotation:f})},[e,x,C.texture,p,y,o,i,v]);let w=1;return Vk(()=>{if(i===1/0||w<i){let e=v.autoClear;v.autoClear=!0,b.current.update(v,x),v.autoClear=e,w++}}),S.createElement(S.Fragment,null,TA(S.createElement(S.Fragment,null,e,S.createElement(`cubeCamera`,{ref:b,args:[t,n,C]}),m||g?S.createElement(jP,{background:!0,files:m,preset:g,path:h,extensions:_}):a?S.createElement(AP,{background:!0,map:a,extensions:_}):null),x))}function NP(e){let t=xP(e),n=e.map||t;S.useMemo(()=>eA({GroundProjectedEnvImpl:Pj}),[]),S.useEffect(()=>()=>{t.dispose()},[t]);let r=S.useMemo(()=>[n],[n]),i=e.ground?.height,a=e.ground?.radius,o=e.ground?.scale??1e3;return S.createElement(S.Fragment,null,S.createElement(AP,ej({},e,{map:n})),S.createElement(`groundProjectedEnvImpl`,{args:r,scale:o,height:i,radius:a}))}function PP(e){return e.ground?S.createElement(NP,e):e.map?S.createElement(AP,e):e.children?S.createElement(MP,e):S.createElement(jP,e)}var FP=S.forwardRef(({scale:e=10,frames:t=1/0,opacity:n=1,width:r=1,height:i=1,blur:a=1,near:o=0,far:s=10,resolution:c=512,smooth:l=!0,color:u=`#000000`,depthWrite:d=!1,renderOrder:f,...p},m)=>{let h=S.useRef(null),g=Bk(e=>e.scene),_=Bk(e=>e.gl),v=S.useRef(null);r*=Array.isArray(e)?e[0]:e||1,i*=Array.isArray(e)?e[1]:e||1;let[y,b,x,C,w,T,E]=S.useMemo(()=>{let e=new hh(c,c),t=new hh(c,c);t.texture.generateMipmaps=e.texture.generateMipmaps=!1;let n=new Ox(r,i).rotateX(Math.PI/2),a=new T_(n),o=new Jx;o.depthTest=o.depthWrite=!1,o.onBeforeCompile=e=>{e.uniforms={...e.uniforms,ucolor:{value:new Z(u)}},e.fragmentShader=e.fragmentShader.replace(`void main() {`,`uniform vec3 ucolor; 4801 void main() { 4802 `),e.fragmentShader=e.fragmentShader.replace(`vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );`)};let s=new I_(Fj),l=new I_(Ij);return l.depthTest=s.depthTest=!1,[e,n,o,a,s,l,t]},[c,r,i,e,u]),D=e=>{C.visible=!0,C.material=w,w.uniforms.tDiffuse.value=y.texture,w.uniforms.h.value=e*1/256,_.setRenderTarget(E),_.render(C,v.current),C.material=T,T.uniforms.tDiffuse.value=E.texture,T.uniforms.v.value=e*1/256,_.setRenderTarget(y),_.render(C,v.current),C.visible=!1},O=0,k,A;return Vk(()=>{v.current&&(t===1/0||O<t)&&(O++,k=g.background,A=g.overrideMaterial,h.current.visible=!1,g.background=null,g.overrideMaterial=x,_.setRenderTarget(y),_.render(g,v.current),D(a),l&&D(a*.4),_.setRenderTarget(null),h.current.visible=!0,g.overrideMaterial=A,g.background=k)}),S.useImperativeHandle(m,()=>h.current,[]),S.createElement(`group`,ej({"rotation-x":Math.PI/2},p,{ref:h}),S.createElement(`mesh`,{renderOrder:f,geometry:b,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},S.createElement(`meshBasicMaterial`,{transparent:!0,map:y.texture,opacity:n,depthWrite:d})),S.createElement(`orthographicCamera`,{ref:v,args:[-r/2,r/2,i/2,-i/2,o,s]}))});function IP(e){return e.isLight}function LP(e){return!!e.geometry}var RP=S.createContext(null),zP=jN({color:new Z,blend:2,alphaTest:.75,opacity:0,map:null},`varying vec2 vUv; 4803 void main() { 4804 gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); 4805 vUv = uv; 4806 }`,`varying vec2 vUv; 4807 uniform sampler2D map; 4808 uniform vec3 color; 4809 uniform float opacity; 4810 uniform float alphaTest; 4811 uniform float blend; 4812 void main() { 4813 vec4 sampledDiffuseColor = texture2D(map, vUv); 4814 gl_FragColor = vec4(color * sampledDiffuseColor.r * blend, max(0.0, (1.
48140 - (sampledDiffuseColor.r + sampledDiffuseColor.g + sampledDiffuseColor.b) / alphaTest)) * opacity); 4815 #include <tonemapping_fragment> 4816 #include <${MN>=154?`colorspace_fragment`:`encodings_fragment`}> 4817 }`),BP=S.forwardRef(({children:e,temporal:t,frames:n=40,limit:r=1/0,blend:i=20,scale:a=10,opacity:o=1,alphaTest:s=.75,color:c=`black`,colorBlend:l=2,resolution:u=1024,toneMapped:d=!0,...f},p)=>{eA({SoftShadowMaterial:zP});let m=Bk(e=>e.gl),h=Bk(e=>e.scene),g=Bk(e=>e.camera),_=Bk(e=>e.invalidate),v=S.useRef(null),y=S.useRef(null),[b]=S.useState(()=>new HP(m,h,u));S.useLayoutEffect(()=>{b.configure(v.current)},[]);let x=S.useMemo(()=>({lights:new Map,temporal:!!t,frames:Math.max(2,n),blend:Math.max(2,n===1/0?i:n),count:0,getMesh:()=>v.current,reset:()=>{b.clear();let e=v.current.material;e.opacity=0,e.alphaTest=0,x.count=0},update:(e=1)=>{let t=v.current.material;x.temporal?(t.opacity=Math.min(o,t.opacity+o/x.blend),t.alphaTest=Math.min(s,t.alphaTest+s/x.blend)):(t.opacity=o,t.alphaTest=s),y.current.visible=!0,b.prepare();for(let t=0;t<e;t++)x.lights.forEach(e=>e.update()),b.update(g,x.blend);y.current.visible=!1,b.finish()}}),[b,g,h,t,n,i,o,s]);return S.useLayoutEffect(()=>{x.reset(),!x.temporal&&x.frames!==1/0&&x.update(x.blend)}),S.useImperativeHandle(p,()=>x,[x]),Vk(()=>{(x.temporal||x.frames===1/0)&&x.count<x.frames&&x.count<r&&(_(),x.update(),x.count++)}),S.createElement(`group`,f,S.createElement(`group`,{traverse:()=>null,ref:y},S.createElement(RP.Provider,{value:x},e)),S.createElement(`mesh`,{receiveShadow:!0,ref:v,scale:a,rotation:[-Math.PI/2,0,0]},S.createElement(`planeGeometry`,null),S.createElement(`softShadowMaterial`,{transparent:!0,depthWrite:!1,toneMapped:d,color:c,blend:l,map:b.progressiveLightMap2.texture})))}),VP=S.forwardRef(({castShadow:e=!0,bias:t=.001,mapSize:n=512,size:r=5,near:i=.5,far:a=500,frames:o=1,position:s=[0,0,0],radius:c=1,amount:l=8,intensity:u=MN>=155?Math.PI:1,ambient:d=.5,...f},p)=>{let m=S.useRef(null),h=new X(...s).length(),g=S.useContext(RP),_=S.useCallback(()=>{let e;if(m.current)for(let t=0;t<m.current.children.length;t++)if(e=m.current.children[t],Math.random()>d)e.position.set(s[0]+qm.randFloatSpread(c),s[1]+qm.randFloatSpread(c),s[2]+qm.randFloatSpread(c));else{let t=Math.acos(2*Math.random()-1)-Math.PI/2,n=2*Math.PI*Math.random();e.position.set(Math.cos(t)*Math.cos(n)*h,Math.abs(Math.cos(t)*Math.sin(n)*h),Math.sin(t)*h)}},[c,d,h,...s]),v=S.useMemo(()=>({update:_}),[_]);return S.useImperativeHandle(p,()=>v,[v]),S.useLayoutEffect(()=>{var e;let t=m.current;return g&&((e=g.lights)==null||e.set(t.uuid,v)),()=>{var e;g==null||(e=g.lights)==null||e.delete(t.uuid)}},[g,v]),S.createElement(`group`,ej({ref:m},f),Array.from({length:l},(o,s)=>S.createElement(`directionalLight`,{key:s,castShadow:e,"shadow-bias":t,"shadow-mapSize":[n,n],intensity:u/l},S.createElement(`orthographicCamera`,{attach:`shadow-camera`,args:[-r,r,r,-r,i,a]}))))}),HP=class{constructor(e,t,n=1024){this.renderer=e,this.res=n,this.scene=t,this.buffer1Active=!1,this.lights=[],this.meshes=[],this.object=null,this.clearColor=new Z,this.clearAlpha=0;let r={type:bf,magFilter:nf,minFilter:nf};this.progressiveLightMap1=new hh(this.res,this.res,r),this.progressiveLightMap2=new hh(this.res,this.res,r),this.discardMat=new BN,this.targetMat=new qx({fog:!1}),this.previousShadowMap={value:this.progressiveLightMap1.texture},this.averagingWindow={value:100},this.targetMat.onBeforeCompile=e=>{e.vertexShader=`varying vec2 vUv; 4818`+e.vertexShader.slice(0,-1)+`vUv = uv; gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }`;let t=e.fragmentShader.indexOf(`void main() {`);e.fragmentShader=`varying vec2 vUv; 4819`+e.fragmentShader.slice(0,t)+`uniform sampler2D previousShadowMap; 4820 uniform float averagingWindow; 4821`+e.fragmentShader.slice(t-1,-1)+` 4822vec3 texelOld = texture2D(previousShadowMap, vUv).rgb; 4823 gl_FragColor.rgb = mix(texelOld, gl_FragColor.rgb, 1.0/ averagingWindow); 4824 }`,e.uniforms.previousShadowMap=this.previousShadowMap,e.uniforms.averagingWindow=this.averagingWindow}}clear(){this.renderer.getClearColor(this.clearColor),this.clearAlpha=this.renderer.getClearAlpha(),this.renderer.setClearColor(`black`,1),this.renderer.setRenderTarget(this.progressiveLightMap1),this.renderer.clear(),this.renderer.setRenderTarget(this.progressiveLightMap2),this.renderer.clear(),this.renderer.setRenderTarget(null),this.renderer.setClearColor(this.clearColor,this.clearAlpha),this.lights=[],this.meshes=[],this.scene.traverse(e=>{LP(e)?this.meshes.push({object:e,material:e.material}):IP(e)&&this.lights.push({object:e,intensity:e.intensity})})}
4824prepare(){this.lights.forEach(e=>e.object.intensity=0),this.meshes.forEach(e=>e.object.material=this.discardMat)}finish(){this.lights.forEach(e=>e.object.intensity=e.intensity),this.meshes.forEach(e=>e.object.material=e.material)}configure(e){this.object=e}update(e,t=100){if(!this.object)return;this.averagingWindow.value=t,this.object.material=this.targetMat;let n=this.buffer1Active?this.progressiveLightMap1:this.progressiveLightMap2,r=this.buffer1Active?this.progressiveLightMap2:this.progressiveLightMap1,i=this.scene.background;this.scene.background=null,this.renderer.setRenderTarget(n),this.previousShadowMap.value=r.texture,this.buffer1Active=!this.buffer1Active,this.renderer.render(this.scene,e),this.renderer.setRenderTarget(null),this.scene.background=i}},UP={rembrandt:{main:[1,2,1],fill:[-2,-.5,-2]},portrait:{main:[-1,2,.5],fill:[-1,.5,-1.5]},upfront:{main:[0,2,1],fill:[-1,.5,-1.5]},soft:{main:[-2,4,4],fill:[-1,.5,-1.5]}};function WP({radius:e,adjustCamera:t}){let n=ZN();return S.useEffect(()=>{t&&n.refresh().clip().fit()},[e,t]),null}function GP({children:e,center:t,adjustCamera:n=!0,intensity:r=.5,shadows:i=`contact`,environment:a=`city`,preset:o=`rembrandt`,...s}){let c=typeof o==`string`?UP[o]:o,[{radius:l,height:u},d]=S.useState({radius:0,width:0,height:0,depth:0}),f=i?.bias??-1e-4,p=i?.normalBias??0,m=i?.size??1024,h=i?.offset??0,g=i===`contact`||i?.type===`contact`,_=i===`accumulative`||i?.type===`accumulative`,v={...typeof i==`object`?i:{}},y=a?typeof a==`string`?{preset:a}:a:null,b=S.useCallback(e=>{let{width:n,height:r,depth:i,boundingSphere:a}=e;d({radius:a.radius,width:n,height:r,depth:i}),t!=null&&t.onCentered&&t.onCentered(e)},[]);return S.createElement(S.Fragment,null,S.createElement(`ambientLight`,{intensity:r/3}),S.createElement(`spotLight`,{penumbra:1,position:[c.main[0]*l,c.main[1]*l,c.main[2]*l],intensity:r*2,castShadow:!!i,"shadow-bias":f,"shadow-normalBias":p,"shadow-mapSize":m}),S.createElement(`pointLight`,{position:[c.fill[0]*l,c.fill[1]*l,c.fill[2]*l],intensity:r}),S.createElement(XN,ej({fit:!!n,clip:!!n,margin:Number(n),observe:!0},s),S.createElement(WP,{radius:l,adjustCamera:n}),S.createElement(IN,ej({},t,{position:[0,h/2,0],onCentered:b}),e)),S.createElement(`group`,{position:[0,-u/2-h/2,0]},g&&S.createElement(FP,ej({scale:l*4,far:l,blur:2},v)),_&&S.createElement(BP,ej({temporal:!0,frames:100,alphaTest:.9,toneMapped:!0,scale:l*4},v),S.createElement(VP,{amount:v.amount??8,radius:v.radius??l,ambient:v.ambient??.5,intensity:v.intensity??1,position:[c.main[0]*l,c.main[1]*l,c.main[2]*l],size:l*4,bias:-f,mapSize:m}))),a&&S.createElement(PP,y))}var KP=class extends I_{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:` 4825 uniform float time; 4826 attribute float size; 4827 varying vec3 vColor; 4828 void main() { 4829 vColor = color; 4830 vec4 mvPosition = modelViewMatrix * vec4(position, 0.5); 4831 gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(time + 100.0)); 4832 gl_Position = projectionMatrix * mvPosition; 4833 }`,fragmentShader:` 4834 uniform sampler2D pointTexture; 4835 uniform float fade; 4836 varying vec3 vColor; 4837 void main() { 4838 float opacity = 1.0; 4839 if (fade == 1.0) { 4840 float d = distance(gl_PointCoord, vec2(0.5, 0.5)); 4841 opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25))); 4842 } 4843 gl_FragColor = vec4(vColor, opacity); 4844 4845 #include <tonemapping_fragment> 4846 #include <${MN>=154?`colorspace_fragment`:`encodings_fragment`}> 4847 }`})}},qP=e=>new X().setFromSpherical(new iw(e,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),JP=S.forwardRef(({radius:e=100,depth:t=50,count:n=5e3,saturation:r=0,factor:i=4,fade:a=!1,speed:o=1},s)=>{let c=S.useRef(null),[l,u,d]=S.useMemo(()=>{let a=[],o=[],s=Array.from({length:n},()=>(.5+.5*Math.random())*i),c=new Z,l=e+t,u=t/n;for(let e=0;e<n;e++)l-=u*Math.random(),a.push(...qP(l).toArray()),c.setHSL(e/n,r,.9),o.push(c.r,c.g,c.b);return[new Float32Array(a),new Float32Array(o),new Float32Array(s)]},[n,t,i,e,r]);Vk(e=>c.current&&(c.current.uniforms.time.value=e.clock.elapsedTime*o));let[f]=S.useState(()=>new KP);return S.createElement(`points`,{ref:s},S.createElement(`bufferGeometry`,null,S.createElement(`bufferAttribute`,{attach:`attributes-position`,args:[l,3]}),S.createElement(`bufferAttribute`,{attach:`attributes-color`,args:[u,3]}
4847),S.createElement(`bufferAttribute`,{attach:`attributes-size`,args:[d,1]})),S.createElement(`primitive`,{ref:c,object:f,attach:`material`,blending:2,"uniforms-fade-value":a,depthWrite:!1,transparent:!0,vertexColors:!0}))}),YP=1/1e3,XP=1e3,ZP=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(e){typeof document<`u`&&document.hidden!==void 0&&(e?document.addEventListener(`visibilitychange`,this):document.removeEventListener(`visibilitychange`,this),this._autoReset=e)}get delta(){return this._delta*YP}get fixedDelta(){return this._fixedDelta*YP}set fixedDelta(e){this._fixedDelta=e*XP}get elapsed(){return this._elapsed*YP}update(e){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(e===void 0?performance.now():e)-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},QP=(()=>{let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]),n=new p_;return n.setAttribute(`position`,new Zg(e,3)),n.setAttribute(`uv`,new Zg(t,2)),n})(),$P=class e{static get fullscreenGeometry(){return QP}constructor(e=`Pass`,t=new Q_,n=new WS){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen===null?null:this.screen.material}set fullscreenMaterial(t){let n=this.screen;n===null?(n=new T_(e.fullscreenGeometry,t),n.frustumCulled=!1,this.scene===null&&(this.scene=new Q_),this.scene.add(n),this.screen=n):n.material=t}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=Ap){}render(e,t,n,r,i){throw Error(`Render method not implemented!`)}setSize(e,t){}initialize(e,t,n){}dispose(){for(let t of Object.keys(this)){let n=this[t];(n instanceof hh||n instanceof Vg||n instanceof fh||n instanceof e)&&this[t].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},eF=class extends $P{constructor(){super(`ClearMaskPass`,null,null),this.needsSwap=!1}render(e,t,n,r,i){let a=e.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},tF=`#ifdef COLOR_WRITE 4848#include <common> 4849#include <dithering_pars_fragment> 4850#ifdef FRAMEBUFFER_PRECISION_HIGH 4851uniform mediump sampler2D inputBuffer; 4852#else 4853uniform lowp sampler2D inputBuffer; 4854#endif 4855#endif 4856#ifdef DEPTH_WRITE 4857#include <packing> 4858#ifdef GL_FRAGMENT_PRECISION_HIGH 4859uniform highp sampler2D depthBuffer; 4860#else 4861uniform mediump sampler2D depthBuffer; 4862#endif 4863float readDepth(const in vec2 uv){ 4864#if DEPTH_PACKING == 3201 4865return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4866#else 4867return texture2D(depthBuffer,uv).r; 4868#endif 4869} 4870#endif 4871#ifdef USE_WEIGHTS 4872uniform vec4 channelWeights; 4873#endif 4874uniform float opacity;varying vec2 vUv;void main(){ 4875#ifdef COLOR_WRITE 4876vec4 texel=texture2D(inputBuffer,vUv); 4877#ifdef USE_WEIGHTS 4878texel*=channelWeights; 4879#endif 4880gl_FragColor=opacity*texel; 4881#ifdef COLOR_SPACE_CONVERSION 4882#include <colorspace_fragment> 4883#endif 4884#include <dithering_fragment> 4885#else 4886gl_FragColor=vec4(0.0); 4887#endif 4888#ifdef DEPTH_WRITE 4889gl_FragDepth=readDepth(vUv); 4890#endif 4891}`,nF=`varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`,rF=class extends I_{constructor(){super({name:`CopyMaterial`,defines:{COLOR_SPACE_CONVERSION:`1`,DEPTH_PACKING:`0`,COLOR_WRITE:`1`},uniforms:{inputBuffer:new qC(null),depthBuffer:new qC(null),channelWeights:new qC(null),opacity:new qC(1)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:tF,vertexShader:nF}),this.depthFunc=1}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(e){let t=e!==null;this.colorWrite!==t&&(t?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=t,this.needsUpdate=!0),this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){let t=e!==null;this.depthWrite!==t&&(t?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=t,this.depthWrite=t,this.needsUpdate=!0),this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get colorSpaceConversion(){return this.defines.COLOR_SPACE_CONVERSION!==void 0}set colorSpaceConversion(e){this.colorSpaceConversion!==e&&(e?this.defines.COLOR_SPACE_CONVERSION=!0:delete this.defines.COLOR_SPACE_CONVERSION,this.needsUpdate=!0)}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(e){e===null?delete this.defines.USE_WEIGHTS:(this.defines.USE_WEIGHTS=`1`,this.uniforms.channelWeights.value=e),this.needsUpdate=!0}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},iF=class extends $P{constructor(e,t=!0){super(`CopyPass`),this.fullscreenMaterial=new rF,this.needsSwap=!1,this.renderTarget=e,e===void 0&&(this.renderTarget=new hh(1,1,{minFilter:cf,magFilter:cf,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name=`CopyPass.Target`),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,n,r,i){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,n){n!==void 0&&(this.renderTarget.texture.type=n,n===1009?e!==null&&e.outputColorSpace
vendor: 4,167 bytes, line 4891
4891===`srgb`&&(this.renderTarget.texture.colorSpace=Pp):this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}},aF=new Z,oF=class extends $P{constructor(e=!0,t=!0,n=!1){super(`ClearPass`,null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=n,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,n){this.color=e,this.depth=t,this.stencil=n}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,n,r,i){let a=this.overrideClearColor,o=this.overrideClearAlpha,s=e.getClearAlpha(),c=a!==null,l=o>=0;c?(e.getClearColor(aF),e.setClearColor(a,l?o:s)):l&&e.setClearAlpha(o),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),c?e.setClearColor(aF,s):l&&e.setClearAlpha(s)}},sF=class extends $P{constructor(e,t){super(`MaskPass`,e,t),this.needsSwap=!1,this.clearPass=new oF(!1,!1,!0),this.inverse=!1}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,n,r,i){let a=e.getContext(),o=e.state.buffers,s=this.scene,c=this.camera,l=this.clearPass,u=this.inverted?0:1,d=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),o.stencil.setFunc(a.ALWAYS,u,4294967295),o.stencil.setClear(d),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(e,null):(l.render(e,t),l.render(e,n))),this.renderToScreen?(e.setRenderTarget(null),e.render(s,c)):(e.setRenderTarget(t),e.render(s,c),e.setRenderTarget(n),e.render(s,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(a.EQUAL,1,4294967295),o.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),o.stencil.setLocked(!0)}},cF=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:n=!1,multisampling:r=0,frameBufferType:i}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,n,i,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new iF,this.depthTexture=null,this.passes=[],this.timer=new ZP,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){let t=this.inputBuffer,n=this.multisampling;n>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):n!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){let t=e.getSize(new Y),n=e.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===1009&&e.outputColorSpace===`srgb`&&(this.inputBuffer.texture.colorSpace=Pp,this.outputBuffer.texture.colorSpace=Pp,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(let t of this.passes)t.initialize(e,n,r)}}replaceRenderer(e,t=!0){let n=this.renderer,r=n.domElement.parentNode;return this.setRenderer(e),t&&r!==null&&(r.removeChild(n.domElement),r.appendChild(e.domElement)),n}createDepthTexture(){let e=this.depthTexture=new Yy;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=Af,e.type=Cf):e.type=vf,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,n,r){let i=this.renderer,a=i===null?new Y:i.getDrawingBufferSize(new Y),o={minFilter:cf,magFilter:cf,stencilBuffer:t,depthBuffer:e,type:n},s=new hh(a.width,a.height,o);return r>
48910&&(s.samples=r),n===1009&&i!==null&&i.outputColorSpace===`srgb`&&(s.texture.colorSpace=Pp),s.texture.name=`EffectComposer.Buffer`,s.texture.generateMipmaps=!1,s}setMainScene(e){for(let t of this.passes)t.mainScene=e}setMainCamera(e){for(let t of this.passes)t.mainCamera=e}addPass(e,t){let n=this.passes,r=this.renderer,i=r.getDrawingBufferSize(new Y),a=r.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(e.setRenderer(r),e.setSize(i.width,i.height),e.initialize(r,a,o),this.autoRenderToScreen&&(n.length>0&&(n[n.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t===void 0?n.push(e):n.splice(t,0,e),this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let t=this.createDepthTexture();for(e of n)e.setDepthTexture(t)}else e.setDepthTexture(this.depthTexture)}removePass(e){let t=this.passes,n=t.indexOf(e);n!==-1&&t.splice(n,1).length>0&&(this.depthTexture!==null&&(t.reduce((e,t)=>e||t.needsDepthTexture,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())),this.autoRenderToScreen&&n===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0)))}removeAllPasses(){let e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){let t=this.renderer,n=this.copyPass,r=this.inputBuffer,i=this.outputBuffer,a=!1,o,s,c;
4891e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(let l of this.passes)l.enabled&&(l.render(t,r,i,e,a),l.needsSwap&&(a&&(n.renderToScreen=l.renderToScreen,o=t.getContext(),s=t.state.buffers.stencil,s.setFunc(o.NOTEQUAL,1,4294967295),n.render(t,r,i,e,a),s.setFunc(o.EQUAL,1,4294967295)),c=r,r=i,i=c),l instanceof sF?a=!0:l instanceof eF&&(a=!1))}setSize(e,t,n){let r=this.renderer,i=r.getSize(new Y);(e===void 0||t===void 0)&&(e=i.width,t=i.height),(i.width!==e||i.height!==t)&&r.setSize(e,t,n);let a=r.getDrawingBufferSize(new Y);this.inputBuffer.setSize(a.width,a.height),this.outputBuffer.setSize(a.width,a.height);for(let e of this.passes)e.setSize(a.width,a.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),$P.fullscreenGeometry.dispose()}},lF={NONE:0,DEPTH:1,CONVOLUTION:2},uF={FRAGMENT_HEAD:`FRAGMENT_HEAD`,FRAGMENT_MAIN_UV:`FRAGMENT_MAIN_UV`,FRAGMENT_MAIN_IMAGE:`FRAGMENT_MAIN_IMAGE`,VERTEX_HEAD:`VERTEX_HEAD`,VERTEX_MAIN_SUPPORT:`VERTEX_MAIN_SUPPORT`},dF=class{constructor(){this.shaderParts=new Map([[uF.FRAGMENT_HEAD,null],[uF.FRAGMENT_MAIN_UV,null],[uF.FRAGMENT_MAIN_IMAGE,null],[uF.VERTEX_HEAD,null],[uF.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=lF.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Fp}},fF=!1,pF=class{constructor(e=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case 2:t=this.materialsFlatShadedDoubleSide;break;case 1:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case 2:t=this.materialsDoubleSide;break;case 1:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(e){if(!(e instanceof I_))return e.clone();let t=e.uniforms,n=new Map;for(let e in t){let r=t[e].value;r.isRenderTargetTexture&&(t[e].value=null,n.set(e,r))}let r=e.clone();for(let e of n)t[e[0]].value=e[1],r.uniforms[e[0]].value=e[1];return r}setMaterial(e){if(this.disposeMaterials(),this.material=e,e!==null){let t=this.materials=[this.cloneMaterial(e),this.cloneMaterial(e),this.cloneMaterial(e)];for(let n of t)n.uniforms=Object.assign({},e.uniforms),n.side=0;t[2].skinning=!0,this.materialsBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=1,n}),this.materialsDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=2,n}),this.materialsFlatShaded=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=1,n}),this.materialsFlatShadedDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=2,n})}}render(e,t,n){let r=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,fF){let r=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,n);for(let e of r)e[0].material=e[1];this.meshCount!==r.size&&r.clear()}else{let r=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,n),t.overrideMaterial=r}e.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){let e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return fF}static set workaroundEnabled(e){fF=e}},mF=-1,hF=class extends bm{constructor(e,t=mF,n=mF,r=1){super(),this.resizable=e,this.baseSize=new Y(1,1),this.preferredSize=new Y(t,n),this.target=this.preferredSize,this.s=r,this.effectiveSize=new Y,this.addEventListener(`change`,()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){let e=this.baseSize,t=this.preferredSize,n=this.effectiveSize,r=this.scale;t.width===mF?t.height===mF?n.width=Math.round(e.width*r):n.width=Math.round(t.height*(e.width/Math.max(e.height,1))):n.width=t.width,t.height===mF?t.width===mF?n.height=Math.round(e.height*r):n.height=Math.round(t.width/
vendor: 9,935 bytes, line 4891
4891Math.max(e.width/Math.max(e.height,1),1)):n.height=t.height}get width(){return this.effectiveSize.width}set width(e){this.preferredWidth=e}get height(){return this.effectiveSize.height}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferredSize.setScalar(mF),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.baseSize.width}set baseWidth(e){this.baseSize.width!==e&&(this.baseSize.width=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(e){this.baseWidth=e}get baseHeight(){return this.baseSize.height}set baseHeight(e){this.baseSize.height!==e&&(this.baseSize.height=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.baseSize.width!==e||this.baseSize.height!==t)&&(this.baseSize.set(e,t),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(e){this.preferredSize.width!==e&&(this.preferredSize.width=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferredSize.height}set preferredHeight(e){this.preferredSize.height!==e&&(this.preferredSize.height=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferredSize.width!==e||this.preferredSize.height!==t)&&(this.preferredSize.set(e,t),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(e){this.s=e.scale,this.baseSize.set(e.baseWidth,e.baseHeight),this.preferredSize.set(e.preferredWidth,e.preferredHeight),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return mF}};Set;var gF={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},_F=new Map([[gF.ADD,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.ALPHA,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}`],[gF.AVERAGE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=(dst.rgb+src.rgb)*0.5;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.COLOR,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.xy,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.COLOR_BURN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/max(b,1e-9))),vec3(1.0),step(1.0,a));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.COLOR_DODGE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.DARKEN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.DIFFERENCE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=abs(dst.rgb-src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.DIVIDE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb/max(src.rgb,1e-9);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.DST,null],[gF.EXCLUSION,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-2.0*dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.HARD_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb,1.0);vec3 b=min(src.rgb,1.0);vec3 c=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.HARD_MIX,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=step(1.0,dst.rgb+src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.HUE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.x,a.yz));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.INVERT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.INVERT_RGB,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=src.rgb*max(1.0-dst.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.LIGHTEN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.LINEAR_BURN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.LINEAR_DODGE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb+src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.LINEAR_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(2.0*src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.LUMINOSITY,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.xy,b.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.MULTIPLY,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.NEGATION,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-abs(1.0-dst.rgb-src.rgb),0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.NORMAL,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}`],[gF.OVERLAY,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=2.0*src.rgb*dst.rgb;vec3 b=1.0-2.0*(1.0-src.rgb)*(1.0-dst.rgb);vec3 c=mix(a,b,step(0.5,dst.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.PIN_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 c=mix(mix(src2,dst.rgb,step(0.5*dst.rgb,src.rgb)),max(src2-1.0,vec3(0.0)),step(dst.rgb,src2-1.0));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.REFLECT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb*dst.rgb/max(1.0-src.rgb,1e-9),1.0);vec3 c=mix(a,src.rgb,step(1.0,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.SATURATION,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.x,b.y,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.SCREEN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-min(dst.rgb*src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.SOFT_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 d=dst.rgb+(src2-1.0);vec3 w=step(0.5,src.rgb);vec3 a=dst.rgb-(1.0-src2)*dst.rgb*(1.0-dst.rgb);vec3 b=mix(d*(sqrt(dst.rgb)-dst.rgb),d*dst.rgb*((16.0*dst.rgb-12.0)*dst.rgb+3.0),w*(1.0-step(0.25,dst.rgb)));vec3 c=mix(a,b,w);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.SRC,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}`],[gF.SUBTRACT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[gF.VIVID_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=mix(max(1.0-min((1.0-dst.rgb)/(2.0*src.rgb),1.0),0.0),min(dst.rgb/(2.0*(1.0-src.rgb)),1.0),step(0.5,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`]]),vF=class extends bm{constructor(e,t=1){super(),this._blendFunction=e,this.opacity=new qC(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this._blendFunction}set blendFunction(e){this._blendFunction=e,this.dispatchEvent({type:`change`})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return _F.get(this.blendFunction)}},yF=class extends bm{constructor(e,t,{attributes:n=lF.NONE,blendFunction:r=gF.NORMAL,defines:i=new Map,uniforms:a=new Map,extensions:o=null,vertexShader:s=null}={}){super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=s,this.defines=i,this.uniforms=a,this.extensions=o,this.blendMode=new vF(r),this.blendMode.addEventListener(`change`,e=>
4891this.setChanged()),this._inputColorSpace=Fp,this._outputColorSpace=``}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:`change`})}setDepthTexture(e,t=Ap){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];(t instanceof hh||t instanceof Vg||t instanceof fh||t instanceof $P)&&this[e].dispose()}}},bF={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},xF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4892uniform mediump sampler2D inputBuffer; 4893#else 4894uniform lowp sampler2D inputBuffer; 4895#endif 4896varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; 4897#include <colorspace_fragment> 4898}`,SF=`uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}`,CF=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],wF=class extends I_{constructor(e=new ph){super({name:`KawaseBlurMaterial`,uniforms:{inputBuffer:new qC(null),texelSize:new qC(new ph),scale:new qC(1),kernel:new qC(0)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:xF,vertexShader:SF}),this.setTexelSize(e.x,e.y),this.kernelSize=bF.MEDIUM}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get kernelSequence(){return CF[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t,e*.5,t*.5)}setSize(e,t){let n=1/e,r=1/t;this.uniforms.texelSize.value.set(n,r,n*.5,r*.5)}},TF=class extends $P{constructor({kernelSize:e=bF.MEDIUM,resolutionScale:t=.5,width:n=hF.AUTO_SIZE,height:r=hF.AUTO_SIZE,resolutionX:i=n,resolutionY:a=r}={}){super(`KawaseBlurPass`),this.renderTargetA=new hh(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name=`Blur.Target.A`,this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name=`Blur.Target.B`;let o=this.resolution=new hF(this,i,a,t);o.addEventListener(`change`,e=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new wF,this._blurMaterial.kernelSize=e,this.copyMaterial=new rF}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(e){this._blurMaterial=e}get dithering(){return this.copyMaterial.dithering}set dithering(e){this.copyMaterial.dithering=e}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(e){this.blurMaterial.kernelSize=e}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,r,i){let a=this.scene,o=this.camera,s=this.renderTargetA,c=this.renderTargetB,l=this.blurMaterial,u=l.kernelSequence,d=t;this.fullscreenMaterial=l;for(let t=0,n=u.length;t<n;++t){let n=t&1?c:s;l.kernel=u[t],l.inputBuffer=d.texture,e.setRenderTarget(n),e.render(a,o),d=n}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=d.texture,e.setRenderTarget(this.renderToScreen?null:n),e.render(a,o)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t);let r=n.width,i=n.height;this.renderTargetA.setSize(r,i),this.renderTargetB.setSize(r,i),this.blurMaterial.setSize(e,t)}initialize(e,t,n){n!==void 0&&(this.renderTargetA.texture.type=n,this.renderTargetB.texture.type=n,n===1009?e!==null&&e.outputColorSpace
4898===`srgb`&&(this.renderTargetA.texture.colorSpace=Pp,this.renderTargetB.texture.colorSpace=Pp):(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`,this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`))}static get AUTO_SIZE(){return hF.AUTO_SIZE}},EF=`#include <common> 4899#ifdef FRAMEBUFFER_PRECISION_HIGH 4900uniform mediump sampler2D inputBuffer; 4901#else 4902uniform lowp sampler2D inputBuffer; 4903#endif 4904#ifdef RANGE 4905uniform vec2 range; 4906#elif defined(THRESHOLD) 4907uniform float threshold;uniform float smoothing; 4908#endif 4909varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0; 4910#ifdef RANGE 4911float low=step(range.x,l);float high=step(l,range.y);mask=low*high; 4912#elif defined(THRESHOLD) 4913mask=smoothstep(threshold,threshold+smoothing,l); 4914#endif 4915#ifdef COLOR 4916gl_FragColor=texel*mask; 4917#else 4918gl_FragColor=vec4(l*mask); 4919#endif 4920}`,DF=class extends I_{constructor(e=!1,t=null){super({name:`LuminanceMaterial`,defines:{THREE_REVISION:`182`.replace(/\D+/g,``)},uniforms:{inputBuffer:new qC(null),threshold:new qC(0),smoothing:new qC(1),range:new qC(null)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:EF,vertexShader:nF}),this.colorOutput=e,this.luminanceRange=t}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get threshold(){return this.uniforms.threshold.value}set threshold(e){this.smoothing>0||e>0?this.defines.THRESHOLD=`1`:delete this.defines.THRESHOLD,this.uniforms.threshold.value=e}getThreshold(){return this.threshold}setThreshold(e){this.threshold=e}get smoothing(){return this.uniforms.smoothing.value}set smoothing(e){this.threshold>0||e>0?this.defines.THRESHOLD=`1`:delete this.defines.THRESHOLD,this.uniforms.smoothing.value=e}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(e){this.smoothing=e}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(e){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(e){e?this.defines.COLOR=`1`:delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(e){return this.colorOutput}setColorOutputEnabled(e){this.colorOutput=e}get useRange(){return this.luminanceRange!==null}set useRange(e){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(e){e===null?delete this.defines.RANGE:this.defines.RANGE=`1`,this.uniforms.range.value=e,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(e){this.luminanceRange=e}},OF=class extends $P{constructor({renderTarget:e,luminanceRange:t,colorOutput:n,resolutionScale:r=1,width:i=hF.AUTO_SIZE,height:a=hF.AUTO_SIZE,resolutionX:o=i,resolutionY:s=a}={}){super(`LuminancePass`),this.fullscreenMaterial=new DF(n,t),this.needsSwap=!1,this.renderTarget=e,this.renderTarget===void 0&&(this.renderTarget=new hh(1,1,{depthBuffer:!1}),this.renderTarget.texture.name=`LuminancePass.Target`);let c=this.resolution=new hF(this,o,s,r);c.addEventListener(`change`,e=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(e,t,n,r,i){let a=this.fullscreenMaterial;a.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}initialize(e,t,n){n!==void 0&&n!==1009&&(this.renderTarget.texture.type=n,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}},kF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4921uniform mediump sampler2D inputBuffer; 4922#else 4923uniform lowp sampler2D inputBuffer; 4924#endif 4925#define WEIGHT_INNER 0.125 4926#define WEIGHT_OUTER 0.0555555 4927varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; 4928#include <colorspace_fragment> 4929}`,AF=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;
4929vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}`,jF=class extends I_{constructor(){super({name:`DownsamplingMaterial`,uniforms:{inputBuffer:new qC(null),texelSize:new qC(new Y)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:kF,vertexShader:AF})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},MF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4930uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; 4931#else 4932uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; 4933#endif 4934uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); 4935#include <colorspace_fragment> 4936}`,NF=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}`,PF=class extends I_{constructor(){super({name:`UpsamplingMaterial`,uniforms:{inputBuffer:new qC(null),supportBuffer:new qC(null),texelSize:new qC(new Y),radius:new qC(.85)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:MF,vertexShader:NF})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}set supportBuffer(e){this.uniforms.supportBuffer.value=e}get radius(){return this.uniforms.radius.value}set radius(e){this.uniforms.radius.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},FF=class extends $P{constructor(){super(`MipmapBlurPass`),this.needsSwap=!1,this.renderTarget=new hh(1,1,{depthBuffer:!1}),this.renderTarget.texture.name=`Upsampling.Mipmap0`,this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new jF,this.upsamplingMaterial=new PF,this.resolution=new Y}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(e){if(this.levels!==e){let t=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let n=0;n<e;++n){let e=t.clone();e.texture.name=`Downsampling.Mipmap`+n,this.downsamplingMipmaps.push(e)}this.upsamplingMipmaps.push(t);for(let n=1,r=e-1;n<r;++n){let e=t.clone();e.texture.name=`Upsampling.Mipmap`+n,this.upsamplingMipmaps.push(e)}this.setSize(this.resolution.x,this.resolution.y)}}get radius(){return this.upsamplingMaterial.radius}set radius(e){this.upsamplingMaterial.radius=e}render(e,t,n,r,i){let{scene:a,camera:o}=this,{downsamplingMaterial:s,upsamplingMaterial:c}=this,{downsamplingMipmaps:l,upsamplingMipmaps:u}=this,d=t;this.fullscreenMaterial=s;for(let t=0,n=l.length;t<n;++t){let n=l[t];s.setSize(d.width,d.height),s.inputBuffer=d.texture,e.setRenderTarget(n),e.render(a,o),d=n}this.fullscreenMaterial=c;for(let t=u.length-1;t>=0;--t){let n=u[t];c.setSize(d.width,d.height),c.inputBuffer=d.texture,c.supportBuffer=l[t].texture,e.setRenderTarget(n),e.render(a,o),d=n}}setSize(e,t){let n=this.resolution;n.set(e,t);let r=n.width,i=n.height;for(let e=0,t=this.downsamplingMipmaps.length;e<t;++e)r=Math.round(r*.5),i=Math.round(i*.5),this.downsamplingMipmaps[e].setSize(r,i),e<this.upsamplingMipmaps.length&&this.upsamplingMipmaps[e].setSize(r,i)}initialize(e,t,n){if(n!==void 0){let t=this.downsamplingMipmaps.concat(this.upsamplingMipmaps);for(let e of t)e.texture.type=n;if(n!==1009)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`,this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`;
4936else if(e!==null&&e.outputColorSpace===`srgb`)for(let e of t)e.texture.colorSpace=Pp}}dispose(){super.dispose();for(let e of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))e.dispose()}},IF=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4937uniform mediump sampler2D map; 4938#else 4939uniform lowp sampler2D map; 4940#endif 4941uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,LF=class extends yF{constructor({blendFunction:e=gF.SCREEN,luminanceThreshold:t=1,luminanceSmoothing:n=.03,mipmapBlur:r=!0,intensity:i=1,radius:a=.85,levels:o=8,kernelSize:s=bF.LARGE,resolutionScale:c=.5,width:l=hF.AUTO_SIZE,height:u=hF.AUTO_SIZE,resolutionX:d=l,resolutionY:f=u}={}){super(`BloomEffect`,IF,{blendFunction:e,uniforms:new Map([[`map`,new qC(null)],[`intensity`,new qC(i)]])}),this.renderTarget=new hh(1,1,{depthBuffer:!1}),this.renderTarget.texture.name=`Bloom.Target`,this.blurPass=new TF({kernelSize:s}),this.luminancePass=new OF({colorOutput:!0}),this.luminanceMaterial.threshold=t,this.luminanceMaterial.smoothing=n,this.mipmapBlurPass=new FF,this.mipmapBlurPass.enabled=r,this.mipmapBlurPass.radius=a,this.mipmapBlurPass.levels=o,this.uniforms.get(`map`).value=r?this.mipmapBlurPass.texture:this.renderTarget.texture;let p=this.resolution=new hF(this,d,f,c);p.addEventListener(`change`,e=>this.setSize(p.baseWidth,p.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get dithering(){return this.blurPass.dithering}set dithering(e){this.blurPass.dithering=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}get distinction(){return console.warn(this.name,`distinction was removed`),1}set distinction(e){console.warn(this.name,`distinction was removed`)}get intensity(){return this.uniforms.get(`intensity`).value}set intensity(e){this.uniforms.get(`intensity`).value=e}getIntensity(){return this.intensity}setIntensity(e){this.intensity=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}update(e,t,n){let r=this.renderTarget,i=this.luminancePass;i.enabled?(i.render(e,t),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(e,i.renderTarget):this.blurPass.render(e,i.renderTarget,r)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(e,t):this.blurPass.render(e,t,r)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height),this.blurPass.resolution.copy(n),this.luminancePass.setSize(e,t),this.mipmapBlurPass.setSize(e,t)}initialize(e,t,n){this.blurPass.initialize(e,t,n),this.luminancePass.initialize(e,t,n),this.mipmapBlurPass.initialize(e,t,n),n!==void 0&&(this.renderTarget.texture.type=n,e!==null&&e.outputColorSpace===`srgb`&&(this.renderTarget.texture.colorSpace=Pp))}},RF=`#ifdef RADIAL_MODULATION 4942uniform float modulationOffset; 4943#endif 4944varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=inputColor.ra;vec2 ba=inputColor.ba; 4945#ifdef RADIAL_MODULATION 4946const vec2 center=vec2(0.5);float d=distance(uv,center)*2.0;d=max(d-modulationOffset,0.0);if(vActive>0.0&&d>0.0){ra=texture2D(inputBuffer,mix(uv,vUvR,d)).ra;ba=texture2D(inputBuffer,mix(uv,vUvB,d)).ba;} 4947#else 4948if(vActive>0.0){ra=texture2D(inputBuffer,vUvR).ra;ba=texture2D(inputBuffer,vUvB).ba;} 4949#endif 4950outputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}`,zF=`uniform vec2 offset;varying float vActive;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vActive=(shift.x!=0.0||shift.y!=0.0)?1.0:0.0;vUvR=uv+shift;vUvB=uv-shift;}`,BF=class extends yF{constructor({offset:e=new Y(.001,5e-4),radialModulation:t=!1,modulationOffset:n=.15}={}){super(`ChromaticAberrationEffect`,RF,{vertexShader:zF,attributes:lF.CONVOLUTION,uniforms:new Map([[`offset`,new qC(e)],[`modulationOffset`,new qC(n)]])}),this.radialModulation=t}get offset(){return this.uniforms.get(`offset`).value}set offset(e){this.uniforms.get(`offset`).value=e}get radialModulation(){return this.defines.has(`RADIAL_MODULATION`)}set radialModulation(e){e?this.defines.set(`RADIAL_MODULATION`,`1`):this.defines.delete(`RADIAL_MODULATION`),this.setChanged()}get modulationOffset(){return this.uniforms.get(`modulationOffset`).value}set modulationOffset(e){this.uniforms.get(`modulationOffset`).value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}},VF=class extends $P{constructor(e,t,n=null){super(`RenderPass`,e,t),this.needsSwap=!1,this.clearPass=new oF,this.overrideMaterialManager=n===null?null:new pF(n),this.ignoreBackgroun
4950d=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){let e=this.overrideMaterialManager;return e===null?null:e.material}set overrideMaterial(e){let t=this.overrideMaterialManager;e===null?t!==null&&(t.dispose(),this.overrideMaterialManager=null):t===null?this.overrideMaterialManager=new pF(e):t.setMaterial(e)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,n,r,i){let a=this.scene,o=this.camera,s=this.selection,c=o.layers.mask,l=a.background,u=e.shadowMap.autoUpdate,d=this.renderToScreen?null:t;s!==null&&o.layers.set(s.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(d),this.overrideMaterialManager===null?e.render(a,o):this.overrideMaterialManager.render(e,a,o),o.layers.mask=c,a.background=l,e.shadowMap.autoUpdate=u}},HF={DEFAULT:0,ESKIL:1},UF=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*(1.0+time))); 4951#ifdef PREMULTIPLY 4952outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); 4953#else 4954outputColor=vec4(noise,inputColor.a); 4955#endif 4956}`,WF=class extends yF{constructor({blendFunction:e=gF.SCREEN,premultiply:t=!1}={}){super(`NoiseEffect`,UF,{blendFunction:e}),this.premultiply=t}get premultiply(){return this.defines.has(`PREMULTIPLY`)}set premultiply(e){this.premultiply!==e&&(e?this.defines.set(`PREMULTIPLY`,`1`):this.defines.delete(`PREMULTIPLY`),this.setChanged())}isPremultiplied(){return this.premultiply}setPremultiplied(e){this.premultiply=e}};Math.PI*.5;var GF=`#include <packing> 4957#ifdef GL_FRAGMENT_PRECISION_HIGH 4958uniform highp sampler2D depthBuffer; 4959#else 4960uniform mediump sampler2D depthBuffer; 4961#endif 4962#ifdef DOWNSAMPLE_NORMALS 4963uniform lowp sampler2D normalBuffer; 4964#endif 4965varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ 4966#if DEPTH_PACKING == 3201 4967return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4968#else 4969return texture2D(depthBuffer,uv).r; 4970#endif 4971}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d); 4972#ifdef DOWNSAMPLE_NORMALS 4973vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1).rgb;n[2]=texture2D(normalBuffer,vUv2).rgb;n[3]=texture2D(normalBuffer,vUv3).rgb; 4974#else 4975vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0); 4976#endif 4977gl_FragColor=vec4(n[index],d[index]);}`,KF=`uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}`,qF=class extends I_{constructor(){super({name:`DepthDownsamplingMaterial`,defines:{DEPTH_PACKING:`0`},uniforms:{depthBuffer:new qC(null),normalBuffer:new qC(null),texelSize:new qC(new Y)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:GF,vertexShader:KF})}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=Ap){this.depthBuffer=e,this.depthPacking=t}set normalBuffer(e){this.uniforms.normalBuffer.value=e,e===null?delete this.defines.DOWNSAMPLE_NORMALS:this.defines.DOWNSAMPLE_NORMALS=`1`,this.needsUpdate=!0}setNormalBuffer(e){this.normalBuffer=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},JF=class extends $P{constructor({normalBuffer:e=null,resolutionScale:t=.5,width:n=hF.AUTO_SIZE,height:r=hF.AUTO_SIZE,resolutionX:i=n,resolutionY:a=r}={}){super(`DepthDownsamplingPass`);let o=new qF;o.normalBuffer=e,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new hh(1,1,{minFilter:nf,magFilter:nf,depthBuffer:!1,type:yf}),this.renderTarget.texture.name=`DepthDownsamplingPass.Target`,this.renderTarget.texture.generateMipmaps=!1;let s=this.resolution=new hF(this,i,a,t);s.addEventListener(`change`,e=>this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}
4977setDepthTexture(e,t=Ap){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t}render(e,t,n,r,i){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height),this.fullscreenMaterial.setSize(e,t)}initialize(e,t,n){let r=e.getContext();if(!(r.getExtension(`EXT_color_buffer_float`)||r.getExtension(`EXT_color_buffer_half_float`)))throw Error(`Rendering to float texture is not supported.`)}},YF=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; 4978#if VIGNETTE_TECHNIQUE == 0 4979float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); 4980#else 4981vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); 4982#endif 4983outputColor=vec4(color,inputColor.a);}`,XF=class extends yF{constructor({blendFunction:e,eskil:t=!1,technique:n=t?HF.ESKIL:HF.DEFAULT,offset:r=.5,darkness:i=.5}={}){super(`VignetteEffect`,YF,{blendFunction:e,defines:new Map([[`VIGNETTE_TECHNIQUE`,n.toFixed(0)]]),uniforms:new Map([[`offset`,new qC(r)],[`darkness`,new qC(i)]])})}get technique(){return Number(this.defines.get(`VIGNETTE_TECHNIQUE`))}set technique(e){this.technique!==e&&(this.defines.set(`VIGNETTE_TECHNIQUE`,e.toFixed(0)),this.setChanged())}get eskil(){return this.technique===HF.ESKIL}set eskil(e){this.technique=e?HF.ESKIL:HF.DEFAULT}getTechnique(){return this.technique}setTechnique(e){this.technique=e}get offset(){return this.uniforms.get(`offset`).value}set offset(e){this.uniforms.get(`offset`).value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}get darkness(){return this.uniforms.get(`darkness`).value}set darkness(e){this.uniforms.get(`darkness`).value=e}getDarkness(){return this.darkness}setDarkness(e){this.darkness=e}},ZF=`#include <common> 4984#include <packing> 4985#include <dithering_pars_fragment> 4986#define packFloatToRGBA(v) packDepthToRGBA(v) 4987#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) 4988#ifdef FRAMEBUFFER_PRECISION_HIGH 4989uniform mediump sampler2D inputBuffer; 4990#else 4991uniform lowp sampler2D inputBuffer; 4992#endif 4993#if DEPTH_PACKING == 3201 4994uniform lowp sampler2D depthBuffer; 4995#elif defined(GL_FRAGMENT_PRECISION_HIGH) 4996uniform highp sampler2D depthBuffer; 4997#else 4998uniform mediump sampler2D depthBuffer; 4999#endif 5000uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){ 5001#if DEPTH_PACKING == 3201 5002float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv)); 5003#else 5004float depth=texture2D(depthBuffer,uv).r; 5005#endif 5006#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH) 5007float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d; 5008#elif defined(USE_REVERSED_DEPTH_BUFFER) 5009depth=1.0-depth; 5010#endif 5011return depth;}float getViewZ(const in float depth){ 5012#ifdef PERSPECTIVE_CAMERA 5013return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); 5014#else 5015return orthographicDepthToViewZ(depth,cameraNear,cameraFar); 5016#endif 5017}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; 5018#ifdef ENCODE_OUTPUT 5019#include <colorspace_fragment> 5020#endif 5021#include <dithering_fragment> 5022}`,QF=`uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}`,$F=class extends I_{constructor(e,t,n,r,i=!1){super({name:`EffectMaterial`,defines:{THREE_REVISION:`182`.replace(/\D+/g,``),DEPTH_PACKING:`0`,ENCODE_OUTPUT:`1`},uniforms:{inputBuffer:new qC(null),depthBuffer:new qC(null),resolution:new qC(new Y),texelSize:new qC(new Y),cameraNear:new qC(.3),
5022cameraFar:new qC(1e3),aspect:new qC(1),time:new qC(0)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),e&&this.setShaderParts(e),t&&this.setDefines(t),n&&this.setUniforms(n),this.copyCameraSettings(r)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=Ap){this.depthBuffer=e,this.depthPacking=t}setShaderData(e){this.setShaderParts(e.shaderParts),this.setDefines(e.defines),this.setUniforms(e.uniforms),this.setExtensions(e.extensions)}setShaderParts(e){return this.fragmentShader=ZF.replace(uF.FRAGMENT_HEAD,e.get(uF.FRAGMENT_HEAD)||``).replace(uF.FRAGMENT_MAIN_UV,e.get(uF.FRAGMENT_MAIN_UV)||``).replace(uF.FRAGMENT_MAIN_IMAGE,e.get(uF.FRAGMENT_MAIN_IMAGE)||``),this.vertexShader=QF.replace(uF.VERTEX_HEAD,e.get(uF.VERTEX_HEAD)||``).replace(uF.VERTEX_MAIN_SUPPORT,e.get(uF.VERTEX_MAIN_SUPPORT)||``),this.needsUpdate=!0,this}setDefines(e){for(let t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(let t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(let t of e)this.extensions[t]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT=`1`:delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof V_?this.defines.PERSPECTIVE_CAMERA=`1`:delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){let n=this.uniforms;n.resolution.value.set(e,t),n.texelSize.value.set(1/e,1/t),n.aspect.value=e/t}static get Section(){return uF}};Number(`182`.replace(/\D+/g,``));var eI=255/256;new Float32Array([eI/256**3,eI/256**2,eI/256,eI]),new Float32Array([eI,eI/256,eI/256**2,1/256**3]);function tI(e,t,n){for(let r of t){let t=`$1`+e+r.charAt(0).toUpperCase()+r.slice(1),i=RegExp(`([^\\.])(\\b`+r+`\\b)`,`g`);for(let e of n.entries())e[1]!==null&&n.set(e[0],e[1].replace(i,t))}}function nI(e,t,n){let r=t.getFragmentShader(),i=t.getVertexShader(),a=r!==void 0&&/mainImage/.test(r),o=r!==void 0&&/mainUv/.test(r);if(n.attributes|=t.getAttributes(),r===void 0)throw Error(`Missing fragment shader (${t.name})`);if(o&&(n.attributes&lF.CONVOLUTION)!==0)throw Error(`Effects that transform UVs are incompatible with convolution effects (${t.name})`);if(!a&&!o)throw Error(`Could not find mainImage or mainUv function (${t.name})`);{let s=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=n.shaderParts,l=c.get(uF.FRAGMENT_HEAD)||``,u=c.get(uF.FRAGMENT_MAIN_UV)||``,d=c.get(uF.FRAGMENT_MAIN_IMAGE)||``,f=c.get(uF.VERTEX_HEAD)||``,p=c.get(uF.VERTEX_MAIN_SUPPORT)||``,m=new Set,h=new Set;if(o&&(u+=` ${e}MainUv(UV); 5023`,n.uvTransformation=!0),i!==null&&/mainSupport/.test(i)){let t=/mainSupport *\([\w\s]*?uv\s*?\)/.test(i);p+=` ${e}MainSupport(`,p+=t?`vUv); 5024`:`); 5025`;for(let e of i.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(let t of e[1].split(/\s*,\s*/))n.varyings.add(t),m.add(t),h.add(t);for(let e of i.matchAll(s))h.add(e[1])}for(let e of r.matchAll(s))h.add(e[1]);for(let e of t.defines.keys())h.add(e.replace(/\([\w\s,]*\)/g,``));for(let e of t.uniforms.keys())h.add(e);h.delete(`while`),h.delete(`for`),h.delete(`if`),t.uniforms.forEac
5025h((t,r)=>n.uniforms.set(e+r.charAt(0).toUpperCase()+r.slice(1),t)),t.defines.forEach((t,r)=>n.defines.set(e+r.charAt(0).toUpperCase()+r.slice(1),t));let g=new Map([[`fragment`,r],[`vertex`,i]]);tI(e,h,n.defines),tI(e,h,g),r=g.get(`fragment`),i=g.get(`vertex`);let _=t.blendMode;if(n.blendModes.set(_.blendFunction,_),a){t.inputColorSpace!==null&&t.inputColorSpace!==n.colorSpace&&(d+=t.inputColorSpace===`srgb`?`color0 = sRGBTransferOETF(color0); 5026 `:`color0 = sRGBToLinear(color0); 5027 `),t.outputColorSpace===``?t.inputColorSpace!==null&&(n.colorSpace=t.inputColorSpace):n.colorSpace=t.outputColorSpace,d+=`${e}MainImage(color0, UV, `,(n.attributes&lF.DEPTH)!==0&&/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/.test(r)&&(d+=`depth, `,n.readDepth=!0),d+=`color1); 5028 `;let i=e+`BlendOpacity`;n.uniforms.set(i,_.opacity),d+=`color0 = blend${_.blendFunction}(color0, color1, ${i}); 5029 5030 `,l+=`uniform float ${i}; 5031 5032`}if(l+=r+` 5033`,i!==null&&(f+=i+` 5034`),c.set(uF.FRAGMENT_HEAD,l),c.set(uF.FRAGMENT_MAIN_UV,u),c.set(uF.FRAGMENT_MAIN_IMAGE,d),c.set(uF.VERTEX_HEAD,f),c.set(uF.VERTEX_MAIN_SUPPORT,p),t.extensions!==null)for(let e of t.extensions)n.extensions.add(e)}}var rI=class extends $P{constructor(e,...t){super(`EffectPass`),this.fullscreenMaterial=new $F(null,null,null,e),this.listener=e=>this.handleEvent(e),this.effects=[],this.setEffects(t),this.skipRendering=!1,this.minTime=1,this.maxTime=1/0,this.timeScale=1}set mainScene(e){for(let t of this.effects)t.mainScene=e}set mainCamera(e){this.fullscreenMaterial.copyCameraSettings(e);for(let t of this.effects)t.mainCamera=e}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(e){this.fullscreenMaterial.encodeOutput=e}get dithering(){return this.fullscreenMaterial.dithering}set dithering(e){let t=this.fullscreenMaterial;t.dithering=e,t.needsUpdate=!0}setEffects(e){for(let e of this.effects)e.removeEventListener(`change`,this.listener);this.effects=e.sort((e,t)=>t.attributes-e.attributes);for(let e of this.effects)e.addEventListener(`change`,this.listener)}updateMaterial(){let e=new dF,t=0;for(let n of this.effects)if(n.blendMode.blendFunction===gF.DST)e.attributes|=n.getAttributes()&lF.DEPTH;else if((e.attributes&n.getAttributes()&lF.CONVOLUTION)!==0)throw Error(`Convolution effects cannot be merged (${n.name})`);else nI(`e`+ t++,n,e);let n=e.shaderParts.get(uF.FRAGMENT_HEAD),r=e.shaderParts.get(uF.FRAGMENT_MAIN_IMAGE),i=e.shaderParts.get(uF.FRAGMENT_MAIN_UV),a=/\bblend\b/g;for(let t of e.blendModes.values())n+=t.getShaderCode().replace(a,`blend${t.blendFunction}`)+` 5035`;(e.attributes&lF.DEPTH)===0?this.needsDepthTexture=!1:(e.readDepth&&(r=`float depth = readDepth(UV); 5036 5037 `+r),this.needsDepthTexture=this.getDepthTexture()===null),e.colorSpace===`srgb`&&(r+=`color0 = sRGBToLinear(color0); 5038 `),e.uvTransformation?(i=`vec2 transformedUv = vUv; 5039`+i,e.defines.set(`UV`,`transformedUv`)):e.defines.set(`UV`,`vUv`),e.shaderParts.set(uF.FRAGMENT_HEAD,n),e.shaderParts.set(uF.FRAGMENT_MAIN_IMAGE,r),e.shaderParts.set(uF.FRAGMENT_MAIN_UV,i);for(let[t,n]of e.shaderParts)n!==null&&e.shaderParts.set(t,n.trim().replace(/^#/,` 5040#`));this.skipRendering=t===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(e)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e,t=Ap){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(let n of this.effects)n.setDepthTexture(e,t)}render(e,t,n,r,i){for(let n of this.effects)n.update(e,t,r);if(!this.skipRendering||this.renderToScreen){let i=this.fullscreenMaterial;i.inputBuffer=t.texture,i.time+=r*this.timeScale,e.setRenderTarget(this.renderToScreen?null:n),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(let n of this.effects)n.setSize(e,t)}initialize(e,t,n){this.renderer=e;for(let r of this.effects)r.initialize(e,t,n);this.updateMaterial(),n!==void 0&&n!==1009&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}dispose(){super.dispose();for(let e of this.effects)e.removeEventListener(`change`,this.listener),e.dispose()}handleEvent(e){switch(e.type){case`change`:this.recompile();break}}},iI=class extends $P{constructor(e,t,{renderTarget:n,resolutionScale:r=1,width:i=hF.AUTO_SIZE,height:a=hF.AUTO_SIZE,resolutionX:o=i,resolutionY:s=a}={}){super(`NormalPass`),this.needsSwap=!1,this.renderPass=new VF(e,t,new Kx);let c=this.renderPass;
5040c.ignoreBackground=!0,c.skipShadowMapUpdate=!0;let l=c.getClearPass();l.overrideClearColor=new Z(7829503),l.overrideClearAlpha=1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new hh(1,1,{minFilter:nf,magFilter:nf}),this.renderTarget.texture.name=`NormalPass.Target`);let u=this.resolution=new hF(this,o,s,r);u.addEventListener(`change`,e=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(e){this.renderPass.mainScene=e}set mainCamera(e){this.renderPass.mainCamera=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,r,i){let a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a,a)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}};new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),oI(0,0,0,0),new Float32Array([0,0,0,0]),oI(0,0,0,1),new Float32Array([0,0,0,1]),oI(0,0,1,0),new Float32Array([0,0,1,0]),oI(0,0,1,1),new Float32Array([0,0,1,1]),oI(0,1,0,0),new Float32Array([0,1,0,0]),oI(0,1,0,1),new Float32Array([0,1,0,1]),oI(0,1,1,0),new Float32Array([0,1,1,0]),oI(0,1,1,1),new Float32Array([0,1,1,1]),oI(1,0,0,0),new Float32Array([1,0,0,0]),oI(1,0,0,1),new Float32Array([1,0,0,1]),oI(1,0,1,0),new Float32Array([1,0,1,0]),oI(1,0,1,1),new Float32Array([1,0,1,1]),oI(1,1,0,0),new Float32Array([1,1,0,0]),oI(1,1,0,1),new Float32Array([1,1,0,1]),oI(1,1,1,0),new Float32Array([1,1,1,0]),oI(1,1,1,1),new Float32Array([1,1,1,1]);
5040function aI(e,t,n){return e+(t-e)*n}function oI(e,t,n,r){return aI(aI(e,t,.75),aI(n,r,.75),.875)}function sI(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cI(e,t){return cI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},cI(e,t)}new Y,new Y;function lI(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var uI=function e(t,n,r){var i=this;lI(this,e),sI(this,`dot2`,function(e,t){return i.x*e+i.y*t}),sI(this,`dot3`,function(e,t,n){return i.x*e+i.y*t+i.z*n}),this.x=t,this.y=n,this.z=r},dI=[new uI(1,1,0),new uI(-1,1,0),new uI(1,-1,0),new uI(-1,-1,0),new uI(1,0,1),new uI(-1,0,1),new uI(1,0,-1),new uI(-1,0,-1),new uI(0,1,1),new uI(0,-1,1),new uI(0,1,-1),new uI(0,-1,-1)],fI=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],pI=Array(512),mI=Array(512);(function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var n=t&1?fI[t]^e&255:fI[t]^e>>8&255;pI[t]=pI[t+256]=n,mI[t]=mI[t+256]=dI[n%12]}})(0),.5*(Math.sqrt(3)-1),(3-Math.sqrt(3))/6,Math.PI*2;function hI(e){if(typeof e==`number`)e=Math.abs(e);else if(typeof e==`string`){var t=e;e=0;for(var n=0;n<t.length;n++)e=(e+(n+1)*(t.charCodeAt(n)%96))%2147483647}return e===0&&(e=311),e}function gI(e){var t=hI(e);return function(){var e=t*48271%2147483647;return t=e,e/2147483647}}new function e(t){var n=this;lI(this,e),sI(this,`seed`,0),sI(this,`init`,function(e){n.seed=e,n.value=gI(e)}),sI(this,`value`,gI(this.seed)),this.init(t)}(Math.random());function _I(e){return _I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_I(e)}var vI=(0,S.createContext)(null),yI=e=>(e.getAttributes()&2)==2,bI=(0,S.memo)((0,S.forwardRef)(({children:e,camera:t,scene:n,resolutionScale:r,enabled:i=!0,renderPriority:a=1,autoClear:o=!0,depthBuffer:s,enableNormalPass:c,stencilBuffer:l,multisampling:u=8,frameBufferType:d=bf},f)=>{let{gl:p,scene:m,camera:h,size:g}=Bk(),_=n||m,v=t||h,[y,b,x]=(0,S.useMemo)(()=>{let e=new cF(p,{depthBuffer:s,stencilBuffer:l,multisampling:u,frameBufferType:d});e.addPass(new VF(_,v));let t=null,n=null;return c&&(n=new iI(_,v),n.enabled=!1,e.addPass(n),r!==void 0&&(t=new JF({normalBuffer:n.texture,resolutionScale:r}),t.enabled=!1,e.addPass(t))),[e,n,t]},[v,p,s,l,u,d,_,c,r]);(0,S.useEffect)(()=>y?.setSize(g.width,g.height),[y,g]),Vk((e,t)=>{if(i){let e=p.autoClear;p.autoClear=o,l&&!o&&p.clearStencil(),y.render(t),p.autoClear=e}},i?a:0);let C=(0,S.useRef)(null);(0,S.useLayoutEffect)(()=>{let e=[],t=C.current.__r3f;if(t&&y){let n=t.children;for(let t=0;t<n.length;t++){let r=n[t].object;if(r instanceof yF){let i=[r];if(!yI(r)){let e=null;for(;(e=n[t+1]?.object)instanceof yF&&!yI(e);)i.push(e),t++}let a=new rI(v,...i);e.push(a)}else r instanceof $P&&e.push(r)}for(let t of e)y?.addPass(t);b&&(b.enabled=!0),x&&(x.enabled=!0)}return()=>{for(let t of e)y?.removePass(t);b&&(b.enabled=!1),x&&(x.enabled=!1)}},[y,e,v,b,x]),(0,S.useEffect)(()=>{let e=p.toneMapping;return p.toneMapping=0,()=>{p.toneMapping=e}},[p]);let w=(0,S.useMemo)(()=>({composer:y,normalPass:b,downSamplingPass:x,resolutionScale:r,camera:v,scene:_}),[y,b,x,r,v,_]);return(0,S.useImperativeHandle)(f,()=>y,[y]),(0,K.jsx)(vI.Provider,{value:w,children:(0,K.jsx)(`group`,{ref:C,children:e})})})),xI=0,SI=new WeakMap,CI=(e,t)=>function({blendFunction:n=t?.blendFunction,opacity:r=t?.opacity,...i}){let a=SI.get(e);if(!a){let t=`@react-three/postprocessing/${e.name}-${xI++}`;eA({[t]:e}),SI.set(e,a=t)}let o=Bk(e=>e.camera),s=S.useMemo(()=>[...t?.args??[],...i.args??[{...t,...i}]],[JSON.stringify(i)]);return(0,K.jsx)(a,{camera:o,"blendMode-blendFunction":n,"blendMode-opacity-value":r,...i,args:s})},wI=CI(LF,{blendFunction:0}),TI=CI(BF),EI=CI(WF,{blendFunction:5}),DI=CI(XF),OI=()=>{let e=(0,S.useRef)(null);return(0,S.useEffect)(()=>{let t=new Audio(`/music/audio/spacey-supp.mp3`);return t.loop=!0,t.volume=.3,e.current=t,()=>{e.current&&=(e.current.pause(),null)}},[]),{playMusic:()=>{e.current&&e.current.play().catch(()=>{})},stopMusic:()=>{e.current&&(e.current.pause(),e.current.currentTime=0)}}},kI=3,AI=.001,jI=.4;function MI({position:e,isDead:t}){let n=(0,S.useRef)(),[r,i]=(0,S.useState)(0);return Vk(r=>{!n.current||t||(n.current.rotation.z=qm.lerp(n.current.rotation.z,-e[0]*.1,.1),n.current.rotation.x=qm.lerp(n.current.rotation.x,t?.5:0,.1),n.current.position.y=.5+Math.sin(r.clock.elapsedTime*5)*.05,n.current.position.x=qm.lerp(n.current.position.x,e[0],.1)
5040)}),(0,K.jsxs)(`group`,{ref:n,position:[0,.5,0],children:[(0,K.jsxs)(`mesh`,{castShadow:!0,receiveShadow:!0,children:[(0,K.jsx)(`boxGeometry`,{args:[1,.4,2]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#1a1a1a`,roughness:.2,metalness:.8})]}),(0,K.jsxs)(`mesh`,{position:[.51,0,0],children:[(0,K.jsx)(`boxGeometry`,{args:[.05,.1,1.8]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#00ffff`,toneMapped:!1})]}),(0,K.jsxs)(`mesh`,{position:[-.51,0,0],children:[(0,K.jsx)(`boxGeometry`,{args:[.05,.1,1.8]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#00ffff`,toneMapped:!1})]}),(0,K.jsxs)(`mesh`,{position:[0,0,1.01],children:[(0,K.jsx)(`planeGeometry`,{args:[.8,.2]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#ff0055`,toneMapped:!1})]}),(0,K.jsxs)(`mesh`,{position:[0,0,-1.01],children:[(0,K.jsx)(`planeGeometry`,{args:[.8,.1]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#ffffff`,toneMapped:!1})]})]})}function NI({speed:e}){let t=(0,S.useRef)(),n=(0,S.useRef)(0);Vk((r,i)=>{t.current&&(n.current-=e*i*10,t.current.material.map.offset.y=n.current)});let r=(0,S.useMemo)(()=>{let e=document.createElement(`canvas`);e.width=64,e.height=64;let t=e.getContext(`2d`);t.fillStyle=`#000000`,t.fillRect(0,0,64,64),t.strokeStyle=`#bc13fe`,t.lineWidth=2,t.strokeRect(0,0,64,64),t.fillStyle=`#bc13fe`,t.fillRect(30,0,4,64);let n=new Jy(e);return n.wrapS=$d,n.wrapT=$d,n.repeat.set(20,20),n},[]);return(0,K.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],position:[0,0,-50],receiveShadow:!0,ref:t,children:[(0,K.jsx)(`planeGeometry`,{args:[100,200]}),(0,K.jsx)(`meshStandardMaterial`,{map:r,roughness:.1,metalness:.1})]})}function PI({obstacles:e}){return(0,K.jsx)(K.Fragment,{children:e.map((e,t)=>(0,K.jsxs)(`group`,{position:[e.x,.5,e.z],children:[(0,K.jsxs)(`mesh`,{castShadow:!0,children:[(0,K.jsx)(`boxGeometry`,{args:[1.5,1,1]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#ff0000`,wireframe:!0})]}),(0,K.jsxs)(`mesh`,{children:[(0,K.jsx)(`boxGeometry`,{args:[1.4,.9,.9]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#ff0000`,transparent:!0,opacity:.5,toneMapped:!1})]})]},e.id))})}function FI({isGameOver:e,setScore:t,setGameOver:n}){let[r,i]=(0,S.useState)(0),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(jI);(0,S.useRef)(-20);let l=(0,S.useRef)(0),u=(0,S.useRef)(null),d=window.innerWidth<768;return(0,S.useEffect)(()=>{let t=t=>{e||d||(t.key===`ArrowLeft`||t.key===`a`?i(e=>Math.max(e-1,-1)):(t.key===`ArrowRight`||t.key===`d`)&&i(e=>Math.min(e+1,1)))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,d]),(0,S.useEffect)(()=>{if(!d)return;let t=e=>{u.current=e.touches[0].clientX},n=t=>{if(e||u.current===null)return;let n=t.changedTouches[0].clientX-u.current;Math.abs(n)>50&&i(n>0?e=>Math.min(e+1,1):e=>Math.max(e-1,-1)),u.current=null};return window.addEventListener(`touchstart`,t),window.addEventListener(`touchend`,n),()=>{window.removeEventListener(`touchstart`,t),window.removeEventListener(`touchend`,n)}},[e,d]),Vk((i,u)=>{if(!e){if(c(e=>Math.min(e+AI*u,1.5)),o(e=>{let i=e.map(e=>({...e,z:e.z+s})).filter(e=>e.z<10);for(let e of i){let i={x:r*kI,y:.5,z:0},a={x:e.x,y:.5,z:e.z},o=Math.abs(i.x-a.x),s=Math.abs(i.y-a.y),c=Math.abs(i.z-a.z);if(o<2/2&&s<2/2&&c<2/2){n(!0),l.current=0,t(0);break}}return i}),(a.length<5||a[a.length-1]?.z>-30)&&Math.random()>.95){let e=Math.floor(Math.random()*3)-1;o(t=>[...t,{id:Date.now(),x:e*kI,z:-100,lane:e}])}e||(l.current+=s,t(Math.floor(l.current)))}}),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(FN,{makeDefault:!0,position:[0,4,6],rotation:[-.4,0,0]}),(0,K.jsx)(`ambientLight`,{intensity:.2}),(0,K.jsx)(`pointLight`,{position:[10,10,10],intensity:1}),(0,K.jsx)(`fog`,{attach:`fog`,args:[`#000000`,5,80]}),` `,(0,K.jsx)(JP,{radius:100,depth:50,count:5e3,factor:4,saturation:0,fade:!0,speed:1}),(0,K.jsx)(MI,{position:[r*kI,0,0],isDead:e}),(0,K.jsx)(NI,{speed:e?0:s}),(0,K.jsx)(PI,{obstacles:a}),(0,K.jsxs)(bI,{disableNormalPass:!0,children:[(0,K.jsx)(wI,{luminanceThreshold:.5,mipmapBlur:!0,intensity:1.5,radius:.6}),(0,K.jsx)(TI,{offset:[.002,.002]}),` `]})]})}function II(){let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(0),{playMusic:o,stopMusic:s}=OI(),c=()=>{t(!1),r(!0),a(0),o()};return(0,S.useEffect)(()=>{let t=t=>{(t.key===`Enter`||t.key===` `)&&e&&(t.preventDefault(),c())};
5040return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),(0,K.jsxs)(`div`,{className:`relative w-full h-full bg-black overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`absolute top-0 left-0 w-full z-10 p-4 flex justify-between pointer-events-none`,children:[(0,K.jsxs)(`div`,{className:`text-white font-mono text-lg md:text-xl drop-shadow-[0_0_5px_rgba(255,255,255,0.8)]`,children:[`SCORE: `,(0,K.jsx)(`span`,{className:`text-purple-400`,children:i})]}),(0,K.jsxs)(`div`,{className:`text-white/50 text-xs md:text-sm font-mono text-right`,children:[(0,K.jsx)(`div`,{className:`hidden md:block`,children:`CONTROLS: ARROWS / A-D`}),(0,K.jsx)(`div`,{className:`md:hidden`,children:`SWIPE TO MOVE`}),(0,K.jsx)(`div`,{children:`RESTART: ENTER / SPACE`})]})]}),(e||!n)&&(0,K.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center bg-black/60 backdrop-blur-sm`,children:[(0,K.jsx)(`h1`,{className:`text-6xl font-black italic tracking-tighter text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-cyan-400 mb-2 drop-shadow-[0_0_10px_rgba(168,85,247,0.5)]`,children:`NEON DRIFT`}),n&&(0,K.jsx)(`p`,{className:`text-red-500 font-mono text-xl mb-6 animate-pulse`,children:`SYSTEM FAILURE`}),(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,K.jsx)(`p`,{className:`text-gray-400 text-sm mb-4`,children:`AVOID THE RED BLOCKS`}),(0,K.jsx)(`button`,{onClick:c,className:`px-8 py-3 bg-cyan-600 hover:bg-cyan-500 text-black font-bold text-lg rounded skew-x-[-10deg] transition-transform hover:scale-110 active:scale-95 shadow-[0_0_20px_rgba(8,145,178,0.6)]`,children:n?`RESTART SYSTEM`:`INITIATE SEQUENCE`})]})]}
5040),(0,K.jsx)($A,{shadows:!0,dpr:[1,2],children:(0,K.jsx)(FI,{isGameOver:e&&n,setScore:a,setGameOver:()=>{t(!0),s()}})})]})}var LI={};(function e(t,n,r,i){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D==`function`&&typeof DOMMatrix==`function`,s=(function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),n=e.getContext(`2d`);n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();n.createPattern(r,`no-repeat`)}catch{return!1}return!0})();function c(){}function l(e){var r=n.exports.Promise,i=r===void 0?t.Promise:r;return typeof i==`function`?new i(e):(e(c,c),null)}var u=(function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext(`2d`).drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}})(s,new Map),d=function(){var e=16,t,n,r={},i=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(t=function(t){var n=Math.random();return r[n]=requestAnimationFrame(function a(o){i===o||i+e-1<o?(i=o,delete r[n],t()):r[n]=requestAnimationFrame(a)}),n},n=function(e){r[e]&&cancelAnimationFrame(r[e])}):(t=function(t){return setTimeout(t,e)},n=function(e){return clearTimeout(e)}),{frame:t,cancel:n}}(),f=(function(){var t,n,i={};function o(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(r,a,o){if(n)return t(r,null),n;var s=Math.random().toString(36).slice(2);return n=l(function(a){function c(t){t.data.callback===s&&(delete i[s],e.removeEventListener(`message`,c),n=null,u.clear(),o(),a())}e.addEventListener(`message`,c),t(r,s),i[s]=c.bind(null,{data:{callback:s}})}),n},e.reset=function(){for(var t in e.postMessage({reset:!0}),i)i[t](),delete i[t]}}return function(){if(t)return t;if(!r&&a){var n=[`var CONFETTI, SIZE = {}, module = {};`,`(`+e.toString()+`)(this, module, true, SIZE);`,`onmessage = function(msg) {`,` if (msg.data.options) {`,` CONFETTI(msg.data.options).then(function () {`,` if (msg.data.callback) {`,` postMessage({ callback: msg.data.callback });`,` }`,` });`,` } else if (msg.data.reset) {`,` CONFETTI && CONFETTI.reset();`,` } else if (msg.data.resize) {`,` SIZE.width = msg.data.resize.width;`,` SIZE.height = msg.data.resize.height;`,` } else if (msg.data.canvas) {`,` SIZE.width = msg.data.canvas.width;`,` SIZE.height = msg.data.canvas.height;`,` CONFETTI = module.exports.create(msg.data.canvas);`,` }`,`}`].join(` 5041`);try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`ð Could not load worker`,e),null}o(t)}return t}})(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function m(e,t){return t?t(e):e}function h(e){return e!=null}function g(e,t,n){return m(e&&h(e[t])?e[t]:p[t],n)}function _(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function y(e){return parseInt(e,16)}function b(e){return e.map(x)}function x(e){var t=String(e).replace(/[^0-9a-f]/gi,``);return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function S(e){var t=g(e,`origin`,Object);return t.x=g(t,`x`,Number),t.y=g(t,`y`,Number),t}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function w(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function T(e){var t=document.createElement(`canvas`);return t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.pointerEvents=`none`,t.style.zIndex=e,t}function E(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),e.arc(0,0,1,o,s,c),e.restore(
vendor: 4,785 bytes, line 5041
5041)}function D(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function O(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle=`rgba(`+t.color.r+`, `+t.color.g+`, `+t.color.b+`, `+(1-n)+`)`,e.beginPath(),o&&t.shape.type===`path`&&typeof t.shape.path==`string`&&Array.isArray(t.shape.matrix))e.fill(M(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(a-r)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble));else if(t.shape.type===`bitmap`){var c=Math.PI/10*t.wobble,l=Math.abs(a-r)*.1,d=Math.abs(s-i)*.1,f=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*l,Math.sin(c)*l,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(u.transform(t.shape.bitmap),`no-repeat`);h.setTransform(m),e.globalAlpha=1-n,e.fillStyle=h,e.fillRect(t.x-f/2,t.y-p/2,f,p),e.globalAlpha=1}else if(t.shape===`circle`)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):E(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape===`star`)for(var g=Math.PI/2*3,_=4*t.scalar,v=8*t.scalar,y=t.x,b=t.y,x=5,S=Math.PI/x;x--;)y=t.x+Math.cos(g)*v,b=t.y+Math.sin(g)*v,e.lineTo(y,b),g+=S,y=t.x+Math.cos(g)*_,b=t.y+Math.sin(g)*_,e.lineTo(y,b),g+=S;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(a),Math.floor(s)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function k(e,t,n,a,o){var s=t.slice(),c=e.getContext(`2d`),f,p,m=l(function(t){function l(){f=p=null,c.clearRect(0,0,a.width,a.height),u.clear(),o(),t()}function m(){r&&!(a.width===i.width&&a.height===i.height)&&(a.width=e.width=i.width,a.height=e.height=i.height),!a.width&&!a.height&&(n(e),a.width=e.width,a.height=e.height),c.clearRect(0,0,a.width,a.height),s=s.filter(function(e){return O(c,e)}),s.length?f=d.frame(m):l()}f=d.frame(m),p=l});return{addFettis:function(e){return s=s.concat(e),m},canvas:e,promise:m,reset:function(){f&&d.cancel(f),p&&p()}}}function A(e,n){var r=!e,i=!!g(n||{},`resize`),o=!1,s=g(n,`disableForReducedMotion`,Boolean),c=a&&g(n||{},`useWorker`)?f():null,u=r?C:w,d=e&&c?!!e.__confetti_initialized:!1,p=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,m;function h(t,n,r){for(var i=g(t,`particleCount`,_),a=g(t,`angle`,Number),o=g(t,`spread`,Number),s=g(t,`startVelocity`,Number),c=g(t,`decay`,Number),l=g(t,`gravity`,Number),d=g(t,`drift`,Number),f=g(t,`colors`,b),p=g(t,`ticks`,Number),h=g(t,`shapes`),y=g(t,`scalar`),x=!!g(t,`flat`),C=S(t),w=i,T=[],E=e.width*C.x,O=e.height*C.y;w--;)T.push(D({x:E,y:O,angle:a,spread:o,startVelocity:s,color:f[w%f.length],shape:h[v(0,h.length)],ticks:p,decay:c,gravity:l,drift:d,scalar:y,flat:x}));return m?m.addFettis(T):(m=k(e,T,u,n,r),m.promise)}function y(n){var a=s||g(n,`disableForReducedMotion`,Boolean),f=g(n,`zIndex`,Number);if(a&&p)return l(function(e){e()});r&&m?e=m.canvas:r&&!e&&(e=T(f),document.body.appendChild(e)),i&&!d&&u(e);var _={width:e.width,height:e.height};c&&!d&&c.init(e),d=!0,c&&(e.__confetti_initialized=!0);function v(){if(c){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};u(t),c.postMessage({resize:{width:t.width,height:t.height}});return}_.width=_.height=null}function y(){m=null,i&&(o=!1,t.removeEventListener(`resize`,v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,d=!1)}return i&&!o&&(o=!0,t.addEventListener(`resize`,v,!1)),c?c.fire(n,_,y):h(n,_,y)}return y.reset=function(){c&&c.reset(),m&&m.reset()},y}var j;function ee(){return j||=A(null,{useWorker:!0,resize:!0}),j}function M(e,t,n,r,i,a,o){var s=new Path2D(e),c=new Path2D;c.addPath(s,new DOMMatrix(t));var l=new Path2D;
5041return l.addPath(c,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*a,Math.cos(o)*a,n,r])),l}function te(e){if(!o)throw Error(`path confetti are not supported in this browser`);var t,n;typeof e==`string`?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),i=document.createElement(`canvas`).getContext(`2d`);if(!n){for(var a=1e3,s=a,c=a,l=0,u=0,d,f,p=0;p<a;p+=2)for(var m=0;m<a;m+=2)i.isPointInPath(r,p,m,`nonzero`)&&(s=Math.min(s,p),c=Math.min(c,m),l=Math.max(l,p),u=Math.max(u,m));d=l-s,f=u-c;var h=10,g=Math.min(h/d,h/f);n=[g,0,0,g,-Math.round(d/2+s)*g,-Math.round(f/2+c)*g]}return{type:`path`,path:t,matrix:n}}function N(e){var t,n=1,r=`#000000`,i=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof e==`string`?t=e:(t=e.text,n=`scalar`in e?e.scalar:n,i=`fontFamily`in e?e.fontFamily:i,r=`color`in e?e.color:r);var a=10*n,o=``+a+`px `+i,s=new OffscreenCanvas(a,a),c=s.getContext(`2d`);c.font=o;var l=c.measureText(t),u=Math.ceil(l.actualBoundingBoxRight+l.actualBoundingBoxLeft),d=Math.ceil(l.actualBoundingBoxAscent+l.actualBoundingBoxDescent),f=2,p=l.actualBoundingBoxLeft+f,m=l.actualBoundingBoxAscent+f;u+=f+f,d+=f+f,s=new OffscreenCanvas(u,d),c=s.getContext(`2d`),c.font=o,c.fillStyle=r,c.fillText(t,p,m);var h=1/n;return{type:`bitmap`,bitmap:s.transferToImageBitmap(),matrix:[h,0,0,h,-u*h/2,-d*h/2]}}n.exports=function(){return ee().apply(this,arguments)},n.exports.reset=function(){ee().reset()},n.exports.create=A,n.exports.shapeFromPath=te,n.exports.shapeFromText=N})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),LI,!1);var RI=LI.exports;LI.exports.create;var zI=e=>{let t=(0,S.useRef)(null);return(0,S.useEffect)(()=>{let n=new Audio(e);return n.loop=!0,n.volume=.4,t.current=n,()=>{t.current&&=(t.current.pause(),null)}},[e]),{playMusic:()=>{t.current&&t.current.play().catch(e=>console.log(`Audio play failed:`,e))},stopMusic:()=>{t.current&&(t.current.pause(),t.current.currentTime=0)}}},BI=[{rings:2,speed:.8,tolerance:.35},{rings:3,speed:1,tolerance:.3},{rings:4,speed:1.3,tolerance:.25},{rings:5,speed:1.6,tolerance:.2}],VI={NEON_CYAN:`#00f3ff`,NEON_RED:`#ff0055`,NEON_GREEN:`#00ff66`,NEON_GOLD:`#ffae00`,DARK_BG:`#050505`},HI={ru:{title:`ÐÐÐÐÐ ÐÐÐÐÐ`,subtitle:`СÐСТÐÐÐ ÐÐЩÐТЫ`,status_locked:`ЦÐÐЬ ÐÐÐ¥ÐÐЧÐÐÐ`,status_won:`ÐÐСТУРРÐÐÐ ÐШÐÐ`,status_completed:`СÐСТÐÐÐ ÐÐÐÐÐÐÐÐ`,status_fail:`ÐШÐÐÐÐ`,instruction_title:`ÐÐÐ ÐÐÐ ÐТЬ:`,instruction_1:`1. ÐдиÑе, пока ÑазÑÑв колÑÑа ÑÐ¾Ð²Ð¿Ð°Ð´ÐµÑ Ñ Ð»Ð¸Ð½Ð¸ÐµÐ¹ ÑпÑава.`,instruction_2:`2. ÐажмиÑе ÐÐ ÐÐÐРили ÐÐÐÐÐÐТÐ, ÑÑÐ¾Ð±Ñ Ð¾ÑÑановиÑÑ ÐºÐ¾Ð»ÑÑо.`,instruction_tip:`ÐодÑказка: ÐÐ¸Ð½Ð¸Ñ ÑÑÐ°Ð½ÐµÑ ÐÐÐÐÐÐРв пÑавилÑнÑй моменÑ.`,btn_start:`ÐÐÐÐÐТРЧТÐÐЫ ÐÐЧÐТЬ`,btn_restart:`ÐÐÐÐÐТРÐÐЯ ÐÐÐ ÐÐÐÐРУÐÐÐ`,level:`УРÐÐÐÐЬ`,final_score:`ÐÐÐÐЫРÐÐСТУРÐÐÐУЧÐÐ`,btn_lang_switch:`ENG`},en:{title:`CYBER LOCK`,subtitle:`SECURITY SYSTEM`,status_locked:`TARGET LOCKED`,status_won:`ACCESS GRANTED`,status_completed:`SYSTEM COMPROMISED`,status_fail:`BREACH FAILED`,instruction_title:`HOW TO PLAY:`,instruction_1:`1. Wait for the ring GAP to align with the line on the right.`,instruction_2:`2. Press SPACE or CLICK ANYWHERE to lock the ring.`,instruction_tip:`Tip: The line turns GREEN when timing is right.`,btn_start:`CLICK OR SPACE TO START`,btn_restart:`CLICK TO REBOOT SYSTEM`,level:`LEVEL`,final_score:`FULL ROOT ACCESS GRANTED`,btn_lang_switch:`RUS`}};function UI({isWon:e,isError:t}){let n=(0,S.useRef)();return Vk(e=>{let t=e.clock.elapsedTime;if(n.current){n.current.rotation.x=t*.5,n.current.rotation.y=t*.8;let e=1+Math.sin(t*4)*.05;n.current.scale.setScalar(e)}}),(0,K.jsx)(QN,{speed:5,rotationIntensity:.5,floatIntensity:.5,children:(0,K.jsxs)(`mesh`,{ref:n,children:[(0,K.jsx)(`icosahedronGeometry`,{args:[.8,1]}),(0,K.jsx)(zN,{color:t?VI.NEON_RED:e?VI.NEON_GREEN:VI.NEON_CYAN,emissive:t?VI.NEON_RED:e?VI.NEON_GREEN:VI.NEON_CYAN,emissiveIntensity:2,roughness:.2,metalness:1,distort:.4,speed:3})]})})}
5041var WI=(0,S.forwardRef)(({radius:e,speed:t,index:n,isLocked:r,isCurrentTarget:i},a)=>{let o=(0,S.useRef)(),s=(0,S.useRef)(Math.random()*Math.PI*2),c=n%2!=0;(0,S.useImperativeHandle)(a,()=>({getRotation:()=>s.current})),Vk((e,n)=>{if(r){o.current.rotation.z=qm.lerp(o.current.rotation.z,0,.15);return}let i=t*(c?-1:1);s.current=(s.current+i*n)%(Math.PI*2),s.current<0&&(s.current+=Math.PI*2),o.current.rotation.z=s.current});let l=(0,S.useMemo)(()=>{let t=12+n*5,a=[];for(let n=0;n<t;n++){if(n===0)continue;let o=n/t*Math.PI*2;a.push((0,K.jsxs)(`mesh`,{position:[Math.cos(o)*e,Math.sin(o)*e,0],rotation:[0,0,o],children:[(0,K.jsx)(`boxGeometry`,{args:[.2,.08,.05]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#222`,emissive:r?VI.NEON_GREEN:i?VI.NEON_CYAN:`#333`,emissiveIntensity:r?2:i?.8:0,toneMapped:!1})]},n))}return a},[n,e,r,i]);return(0,K.jsxs)(`group`,{ref:o,children:[(0,K.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,K.jsx)(`torusGeometry`,{args:[e,.02,16,100]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#444`})]}),l,(0,K.jsxs)(`mesh`,{position:[e,0,0],children:[(0,K.jsx)(`sphereGeometry`,{args:[.08,16,16]}),(0,K.jsx)(`meshBasicMaterial`,{color:VI.NEON_GOLD})]})]})});function GI({isAligned:e}){return(0,K.jsxs)(`group`,{position:[0,0,-.1],children:[(0,K.jsxs)(`mesh`,{position:[3.5,0,0],rotation:[0,0,Math.PI/2],children:[(0,K.jsx)(`planeGeometry`,{args:[.05,7]}),(0,K.jsx)(`meshBasicMaterial`,{color:e?VI.NEON_GREEN:VI.NEON_RED,transparent:!0,opacity:e?.8:.2})]}),(0,K.jsxs)(`mesh`,{position:[4.5,0,0],rotation:[0,0,-Math.PI/2],children:[(0,K.jsx)(`coneGeometry`,{args:[.3,.5,3]}),(0,K.jsx)(`meshBasicMaterial`,{color:e?VI.NEON_GREEN:VI.NEON_CYAN})]})]})}function KI({levelData:e,onWin:t,onFail:n,isPlaying:r,inputTrigger:i}){let[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),l=(0,S.useRef)([]);return(0,S.useEffect)(()=>{o(0),c(!1)},[e]),Vk(()=>{if(!r||a>=e.rings)return;let t=l.current[a];if(t){let n=t.getRotation();c(Math.min(Math.abs(n),Math.abs(n-Math.PI*2))<e.tolerance)}}),(0,S.useEffect)(()=>{if(!r||i===0)return;let s=l.current[a];if(s){let r=s.getRotation();if(Math.min(Math.abs(r),Math.abs(r-Math.PI*2))<e.tolerance){let n=a+1;n>=e.rings?t():o(n)}else n()}},[i]),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(FN,{makeDefault:!0,position:[0,0,8]}),(0,K.jsx)(GI,{isAligned:s}),(0,K.jsx)(UI,{isWon:a>=e.rings,isError:!1}),Array.from({length:e.rings}).map((t,n)=>(0,K.jsx)(WI,{ref:e=>l.current[n]=e,index:n,radius:1.5+n*.8,speed:e.speed*(1+(e.rings-n)*.1),isLocked:n<a,isCurrentTarget:n===a},n)),(0,K.jsxs)(bI,{disableNormalPass:!0,children:[(0,K.jsx)(wI,{luminanceThreshold:.5,mipmapBlur:!0,intensity:1.5,radius:.6}),(0,K.jsx)(EI,{opacity:.05}),(0,K.jsx)(DI,{eskil:!1,offset:.1,darkness:1.1}),(0,K.jsx)(TI,{offset:[.002,.002]})]})]})}function qI({level:e,status:t,lives:n,lang:r,setLang:i}){let a=HI[r],o=e=>{e.stopPropagation(),i(e=>e===`en`?`ru`:`en`)};return(0,K.jsxs)(`div`,{className:`absolute inset-0 pointer-events-none p-6 flex flex-col justify-between z-10 select-none`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-start`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-4xl font-black italic text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-blue-600 drop-shadow-[0_0_10px_rgba(0,243,255,0.8)]`,children:a.title}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-cyan-200 font-mono text-sm mt-1`,children:[(0,K.jsx)(bd,{size:14}),(0,K.jsx)(`span`,{children:a.subtitle})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col items-end gap-3 pointer-events-auto`,children:[(0,K.jsxs)(`button`,{onClick:o,className:`flex items-center gap-2 bg-black/40 hover:bg-cyan-500/20 border border-cyan-500/30 px-4 py-2 rounded-md text-sm text-cyan-400 font-mono transition-all active:scale-95`,children:[(0,K.jsx)(Eu,{size:16}),r===`en`?`ENG`:`RUS`]}),(0,K.jsxs)(`div`,{className:`text-right font-mono`,children:[(0,K.jsx)(`div`,{className:`text-xs text-gray-500`,children:a.level}),(0,K.jsxs)(`div`,{className:`text-4xl font-bold text-white drop-shadow-[0_0_5px_rgba(255,255,255,0.5)]`,children:[e,` / 04`]})]})]})]}),t!==`playing`&&(0,K.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center pointer-events-auto bg-black/60 backdrop-blur-sm z-20`,children:(0,K.jsxs)(`div`,{className:`bg-black/90 border border-cyan-500/30 p-8 rounded-xl max-w-md w-full text-center shadow-[0_0_50px_rgba(0,243,255,0.2)] transform transition-all animate-in zoom-in duration-300`,children:[t===`start`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ru,{size:64,className:`mx-auto text-cyan-500 mb-6 animate-pulse`}),(0,K.jsx)(`h2`,{className:`text-2xl font-bold text-white mb-6 uppercase tracking-widest`,children:a.instruction_title}),(0,K.jsxs)(`div`,{className:`text-left space-y-4 mb-8 bg-white/5 p-4 rounded border border-white/10`,children:[(0,K.jsxs)(`p`,{className:`text-gray-300 text-sm flex gap-3`,children:[(0,K.jsx)(`span`,{className:`text-cyan-400 font-bold`,children:`»`}),` `,a.instruction_1]}),(0,K.jsxs)(`p`,{className:`text-gray-300 text-sm flex gap-3`,children:[(0,K.jsx)(`span`,{className:`text-cyan-400 font-bold`,children:`»`}),` `,a.instruction_2]}),(0,K.jsxs)(`p`,{className:`text-yellow-400 text-xs mt-2 border-t border-white/10 pt-2`,children:[`â `,a.instruction_tip]})]}),(0,K.jsxs)(`button`,{onClick:o,className:`flex items-center justify-center gap-2 bg-black/40 hover:bg-cyan-500/20 border border-cyan-500/30 px-4 py-2 rounded-md text-sm text-cyan-400 font-mono transition-all active:scale-95 mx-auto mb-4`,children:[(0,K.jsx)(Eu,{size:16}),a.btn_lang_switch]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-cyan-400 text-sm animate-bounce`,children:[(0,K.jsx)(qu,{size:16}),(0,K.jsx)(`span`,{children:a.btn_start})]})]}),t===`won`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Lu,{size:64,className:`mx-auto text-green-500 mb-4`}),(0,K.jsx)(`h2`,{className:`text-3xl font-bold text-white mb-2`,children:a.status_won}),(0,K.jsx)(`p`,{className:`text-green-400/80 mb-6 font-mono`,children:`LOADING_NEXT_LAYER...`})]}),t===`completed`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(md,{size:80,className:`mx-auto text-yellow-500 mb-4 drop-shadow-[0_0_25px_rgba(255,200,0,0.6)]`}),(0,K.jsx)(`h2`,{className:`text-3xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-yellow-400 to-orange-500 mb-2`,children:a.status_completed}),(0,K.jsx)(`p`,{className:`text-yellow-100/80 mb-8 font-mono tracking-widest text-sm`,children:a.final_score}),(0,K.jsx)(`div`,{className:`text-xs text-white/50 animate-pulse`,children:a.btn_restart})]}),t===`gameover`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(od,{size:64,className:`mx-auto text-red-500 mb-4`}),(0,K.jsx)(`h2`,{className:`text-3xl font-bold text-white mb-2`,children:a.status_fail}),(0,K.jsx)(`p`,{className:`text-red-400/80 mb-6 font-mono`,children:`CONNECTION_TERMINATED`}),(0,K.jsx)(`div`,{className:`text-xs text-white/50 animate-pulse`,children:a.btn_restart})]})]})}),(0,K.jsxs)(`div`,{className:`flex justify-between items-end`,children:[(0,K.jsx)(`div`,{className:`flex gap-2`,children:Array.from({length:3}).map((e,t)=>(0,K.jsx)(`div`,{className:`h-2 w-12 skew-x-12 border border-cyan-500/50 ${t<n?`bg-cyan-400 shadow-[0_0_10px_cyan]`:`bg-transparent`}`},t))}),(0,K.jsx)(`div`,{className:`text-xs text-gray-600 font-mono`,children:`VER 2.5.0`})]})]})}function JI(){let[e,t]=(0,S.useState)(1),[n,r]=(0,S.useState)(`start`),[i,a]=(0,S.useState)(3),[o,s]=(0,S.useState)(`en`),[c,l]=(0,S.useState)(0),{playMusic:u,stopMusic:d}=zI(`/music/audio/memory-reboot.mp3`);(0,S.useEffect)(()=>{let e=e=>{e.code===`Space`&&(n===`playing`?l(e=>e+1):p())};
5041return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let f=()=>{n===`playing`?l(e=>e+1):p()},p=()=>{(n===`gameover`||n===`completed`)&&(t(1),a(3)),r(`playing`),u()},m=()=>{r(`gameover`),d()};return(0,K.jsxs)(`div`,{className:`relative w-full h-full bg-[#050505] overflow-hidden select-none cursor-pointer font-sans`,onClick:f,children:[(0,K.jsx)(qI,{level:e,status:n,lives:i,lang:o,setLang:s}),(0,K.jsxs)($A,{shadows:!0,dpr:[1,2],children:[(0,K.jsx)(`color`,{attach:`background`,args:[VI.DARK_BG]}),(0,K.jsx)(`ambientLight`,{intensity:.5}),(0,K.jsx)(KI,{levelData:BI[e-1],onWin:()=>{if(e<BI.length)r(`won`),RI({particleCount:100,spread:70,origin:{y:.6},colors:[VI.NEON_CYAN,VI.NEON_GREEN]}),setTimeout(()=>{t(e=>e+1),r(`playing`)},2e3);else{r(`completed`);let e=Date.now()+3e3;(function t(){RI({particleCount:5,angle:60,spread:55,origin:{x:0},colors:[VI.NEON_GOLD,VI.NEON_CYAN]}),RI({particleCount:5,angle:120,spread:55,origin:{x:1},colors:[VI.NEON_GOLD,VI.NEON_RED]}),Date.now()<e&&requestAnimationFrame(t)})()}},onFail:()=>{i>1?a(e=>e-1):m()},isPlaying:n===`playing`,inputTrigger:c})]})]})}var YI=[{title:`Intern`,minXp:0},{title:`Junior Dev`,minXp:500},{title:`Middle Dev`,minXp:2e3},{title:`Senior Dev`,minXp:8e3},{title:`Tech Lead`,minXp:25e3},{title:`CTO`,minXp:1e5},{title:`AI Overlord`,minXp:1e6}],XI=[{id:`coffee`,name:`Double Espresso`,icon:du,baseCost:15,costMult:1.2,type:`click`,value:1,desc:`Caffeine boost. +1 Click Power.`},{id:`mech_kb`,name:`Mech Keyboard`,icon:Nu,baseCost:100,costMult:1.3,type:`click`,value:5,desc:`Clicky sounds! +5 Click Power.`},{id:`chatgpt`,name:`Copilot AI`,icon:pu,baseCost:500,costMult:1.4,type:`passive`,value:5,desc:`Code writes itself. +5 $/sec.`},{id:`server`,name:`Cloud Server`,icon:id,baseCost:2e3,costMult:1.5,type:`passive`,value:25,desc:`Deploy faster. +25 $/sec.`},{id:`rust`,name:`Rewrite in Rust`,icon:bd,baseCost:8e3,costMult:1.6,type:`click`,value:50,desc:`Blazingly fast. +50 Click Power.`},{id:`crypto`,name:`Crypto ICO`,icon:Eu,baseCost:5e4,costMult:1.8,type:`passive`,value:200,desc:`To the moon! +200 $/sec.`}],ZI={primary:`#007acc`,secondary:`#ff0055`,accent:`#00ff88`,bg:`#1e1e1e`,text:`#ffffff`},QI=typeof window<`u`?new(window.AudioContext||window.webkitAudioContext):null,$I=e=>{if(!QI)return;QI.state===`suspended`&&QI.resume();let t=QI.createOscillator(),n=QI.createGain();t.connect(n),n.connect(QI.destination);let r=QI.currentTime;if(e===`click`)t.type=`triangle`,t.frequency.setValueAtTime(150,r),t.frequency.exponentialRampToValueAtTime(40,r+.1),n.gain.setValueAtTime(.5,r),n.gain.exponentialRampToValueAtTime(.01,r+.1),t.start(r),t.stop(r+.1);else if(e===`buy`)t.type=`sine`,t.frequency.setValueAtTime(1200,r),t.frequency.exponentialRampToValueAtTime(2e3,r+.1),n.gain.setValueAtTime(.3,r),n.gain.exponentialRampToValueAtTime(.01,r+.3),t.start(r),t.stop(r+.3);else if(e===`levelup`){let e=(e,t)=>{let n=QI.createOscillator(),i=QI.createGain();n.connect(i),i.connect(QI.destination),n.type=`square`,n.frequency.value=e,i.gain.setValueAtTime(.1,r+t),i.gain.exponentialRampToValueAtTime(.001,r+t+.5),n.start(r+t),n.stop(r+t+.5)};e(440,0),e(554.37,.1),e(659.25,.2),e(880,.4)}};function eL({count:e=20}){let t=(0,S.useRef)(),n=(0,S.useMemo)(()=>new bg,[]),r=(0,S.useMemo)(()=>Array(e).fill().map(()=>({position:[Math.random()*10-5,Math.random()*10-5,Math.random()*5-5],factor:Math.random()*.5+.5,speed:Math.random()*.02+.01})),[e]);return Vk(()=>{r.forEach((e,r)=>{e.position[1]+=e.speed,e.position[1]>5&&(e.position[1]=-5),n.position.set(e.position[0],e.position[1],e.position[2]),n.scale.setScalar(e.factor),n.updateMatrix(),t.current.setMatrixAt(r,n.matrix)}),t.current.instanceMatrix.needsUpdate=!0}),(0,K.jsxs)(`instancedMesh`,{ref:t,args:[null,null,e],children:[(0,K.jsx)(`boxGeometry`,{args:[.1,.1,.1]}),(0,K.jsx)(`meshBasicMaterial`,{color:ZI.primary,transparent:!0,opacity:.4})]})}function tL({active:e,onClick:t}){let n=(0,S.useRef)();return Vk((t,r)=>{if(n.current){let t=e?.9:1,r=e?-.2:0;n.current.scale.x=qm.lerp(n.current.scale.x,t,.1),n.current.scale.y=qm.lerp(n.current.scale.y,t,.1),n.current.scale.z
5041=qm.lerp(n.current.scale.z,t,.1),n.current.position.y=qm.lerp(n.current.position.y,r,.1)}}),(0,K.jsxs)(`group`,{onClick:t,children:[(0,K.jsx)(QN,{speed:2,rotationIntensity:.2,floatIntensity:.2,children:(0,K.jsxs)(`group`,{ref:n,children:[(0,K.jsx)(UN,{args:[2.5,1,2.5],radius:.2,smoothness:4,children:(0,K.jsx)(`meshStandardMaterial`,{color:e?ZI.secondary:ZI.primary,roughness:.3,metalness:.8,emissive:e?ZI.secondary:ZI.primary,emissiveIntensity:e?.5:.1})}),(0,K.jsx)(AN,{position:[0,.51,0],rotation:[-Math.PI/2,0,0],fontSize:.35,color:`white`,anchorX:`center`,anchorY:`middle`,children:`<CODE />`})]})}),(0,K.jsxs)(`mesh`,{position:[0,-.8,0],receiveShadow:!0,children:[(0,K.jsx)(`boxGeometry`,{args:[3,.2,3]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#111`})]}),(0,K.jsx)(FP,{position:[0,-1.5,0],opacity:.6,scale:10,blur:2.5,far:4})]})}function nL(){let[e,t]=(0,S.useState)(0),[n,r]=(0,S.useState)(0),[i,a]=(0,S.useState)(1),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)({}),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)([]),m=YI.slice().reverse().find(e=>n>=e.minXp)||YI[0],h=YI.find(e=>e.minXp>n),g=h?(n-m.minXp)/(h.minXp-m.minXp)*100:100;(0,S.useEffect)(()=>{if(o===0)return;let e=setInterval(()=>{t(e=>e+o)},1e3);return()=>clearInterval(e)},[o]);let _=(0,S.useCallback)(()=>{t(e=>e+i),r(e=>e+i),$I(`click`);let e=Date.now()+Math.random(),n=(Math.random()-.5)*100,a=(Math.random()-.5)*50;p(t=>[...t,{id:e,val:i,x:n,y:a}]),d(!0),setTimeout(()=>d(!1),100),setTimeout(()=>{p(t=>t.filter(t=>t.id!==e))},800)},[i]),v=n=>{let r=c[n.id]||0,i=Math.floor(n.baseCost*n.costMult**+r);e>=i&&(t(e=>e-i),l(e=>({...e,[n.id]:r+1})),n.type===`click`&&a(e=>e+n.value),n.type===`passive`&&s(e=>e+n.value),$I(`buy`))};return(0,K.jsxs)(`div`,{className:`relative w-full h-full bg-[#1e1e1e] overflow-hidden select-none font-mono text-white`,children:[(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10 pointer-events-none flex flex-col justify-between p-6`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-start`,children:[(0,K.jsxs)(`div`,{className:`bg-black/40 backdrop-blur-md p-4 rounded-xl border border-white/10 shadow-2xl pointer-events-auto`,children:[(0,K.jsxs)(`h1`,{className:`text-4xl font-black tracking-tighter text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-cyan-300`,children:[`$`,Math.floor(e).toLocaleString()]}),(0,K.jsxs)(`div`,{className:`flex gap-4 text-xs text-gray-400 mt-2`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(bd,{size:12,className:`text-yellow-400`}),` `,i,`/click`]}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(pd,{size:12,className:`text-green-400`}),` `,o,`/sec`]})]})]}),(0,K.jsxs)(`div`,{className:`text-right`,children:[(0,K.jsx)(`div`,{className:`text-2xl font-bold text-white`,children:m.title}),(0,K.jsxs)(`div`,{className:`text-xs text-gray-500 mb-1`,children:[`XP: `,Math.floor(n).toLocaleString()]}),(0,K.jsx)(`div`,{className:`w-48 h-2 bg-gray-800 rounded-full overflow-hidden ml-auto`,children:(0,K.jsx)(`div`,{className:`h-full bg-blue-500 transition-all duration-300`,style:{width:`${g}%`}})})]})]}),(0,K.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center pointer-events-none`,children:f.map(e=>(0,K.jsxs)(`div`,{className:`absolute text-2xl font-bold text-green-400 animate-out fade-out slide-out-to-top duration-700`,style:{transform:`translate(${e.x}px, ${e.y-100}px)`},children:[`+$`,e.val]},e.id))}),(0,K.jsx)(`div`,{className:`pointer-events-auto w-full max-w-4xl mx-auto bg-black/80 backdrop-blur-xl border-t border-white/10 rounded-t-2xl max-h-[35vh] overflow-y-auto scrollbar-thin scrollbar-thumb-blue-600`,children:(0,K.jsx)(`div`,{className:`p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:XI.map(t=>{let n=c[t.id]||0,r=Math.floor(t.baseCost*t.costMult**+n),i=e>=r;return(0,K.jsxs)(`button`,{onClick:()=>v(t),disabled:!i,className:` 5042 relative flex items-center gap-3 p-3 rounded-lg border transition-all duration-200 group 5043 ${i?`bg-white/5 border-white/10 hover:bg-blue-500/20 hover:border-blue-500`:`bg-black/40 border-transparent opacity-50 grayscale cursor-not-allowed`} 5044 `,children:[(0,K.jsx)(`div`,{className:`p-2 rounded bg-black/50 ${i?`text-blue-400`:`text-gray-600`}`,children:(0,K.jsx)(t.icon,{size:20})}),(0,K.jsxs)(`div`,{className:`text-left flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,K.jsx)(`span`,{className:`font-bold text-sm text-gray-200`,children:t.name}),(0,K.jsxs)(`span`,{className:`text-xs text-gray-500 bg-white/10 px-1 rounded`,children:[`Lvl `,n]})]}),(0,K.jsx)(`div`,{className:`text-[10px] text-gray-400 leading-tight my-0.5`,children:t.desc}),(0,K.jsxs)(`div`,{className:`text-xs font-mono font-bold mt-1 ${i?`text-green-400`:`text-red-400`}
5044`,children:[`$`,r.toLocaleString()]})]})]},t.id)})})})]}),(0,K.jsx)(`div`,{className:`absolute inset-0 z-0`,onPointerDown:_,children:(0,K.jsxs)($A,{shadows:!0,dpr:[1,2],camera:{position:[0,5,8],fov:45},children:[(0,K.jsx)(`ambientLight`,{intensity:.4}),(0,K.jsx)(`spotLight`,{position:[10,10,5],angle:.5,penumbra:1,intensity:2,castShadow:!0,color:`#007acc`}),(0,K.jsx)(`pointLight`,{position:[-10,-5,-5],intensity:1,color:`#ff0055`}),(0,K.jsx)(PP,{preset:`city`,blur:.8}),(0,K.jsx)(GP,{intensity:.5,environment:null,adjustCamera:!1,children:(0,K.jsx)(tL,{active:u,onClick:e=>{e.stopPropagation(),_()}})}),(0,K.jsx)(eL,{count:30}),(0,K.jsxs)(bI,{disableNormalPass:!0,children:[(0,K.jsx)(wI,{luminanceThreshold:.4,mipmapBlur:!0,intensity:1.2,radius:.6}),(0,K.jsx)(DI,{eskil:!1,offset:.1,darkness:1}),(0,K.jsx)(TI,{offset:[.001,.001]})]})]})})]})}function rL({url:e}){let t=Bd(),n=(0,S.useRef)(!1);return(0,S.useEffect)(()=>{!n.current&&t&&t.openLink&&e&&(t.openLink(e),n.current=!0)},[e,t]),null}const iL=[{id:1,url:`/assets/wallpaper-w8dlGcC2.jpg`,name:`aqadilOS Default`},{id:2,url:`https://images.unsplash.com/photo-1477346611705-65d1883cee1e?auto=format&fit=crop&w=1920&q=80`,name:`Dark Mountains`},{id:3,url:`https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1920&q=80`,name:`Orbital View`},{id:4,url:`https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=1920&q=80`,name:`Abstract Liquid`},{id:5,url:`https://images.unsplash.com/photo-1550684848-fac1c5b4e853?auto=format&fit=crop&w=1920&q=80`,name:`Cyberpunk City`}];var aL=(0,S.createContext)(null);const oL=()=>(0,S.useContext)(aL),sL=({children:e})=>{let[t,n]=(0,S.useState)(iL[0]),r={wallpaper:t,setWallpaper:n};return(0,K.jsx)(aL.Provider,{value:r,children:e})};function cL(){let{wallpaper:e,setWallpaper:t}=oL();return(0,K.jsxs)(`div`,{className:`w-full h-full bg-[#f3f9ff] dark:bg-[#121212] text-gray-900 dark:text-white flex font-sans`,children:[(0,K.jsxs)(`div`,{className:`w-64 bg-gray-50 dark:bg-[#1a1a1a] border-r border-gray-200 dark:border-white/5 p-4`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-bold mb-6 px-2`,children:`Personalization`}),(0,K.jsxs)(`div`,{className:`bg-blue-500/10 text-blue-600 dark:text-blue-400 px-4 py-2 rounded-lg text-sm font-medium flex items-center gap-2`,children:[(0,K.jsx)(Ku,{size:16}),`Background`]})]}),(0,K.jsxs)(`div`,{className:`flex-1 p-8 overflow-y-auto`,children:[(0,K.jsxs)(`div`,{className:`mb-8`,children:[(0,K.jsx)(`h3`,{className:`text-lg font-semibold mb-4`,children:`Select Theme`}),(0,K.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:iL.map(n=>(0,K.jsxs)(`button`,{onClick:()=>t(n),className:`relative aspect-video rounded-xl overflow-hidden border-4 transition-all ${e.id===n.id?`border-blue-500 shadow-lg`:`border-transparent hover:border-gray-300 dark:hover:border-white/20`}`,children:[(0,K.jsx)(`img`,{src:n.url,className:`w-full h-full object-cover`,alt:n.name}),e.id===n.id&&(0,K.jsx)(`div`,{className:`absolute top-2 right-2 bg-blue-500 text-white rounded-full p-1`,children:(0,K.jsx)(ru,{size:12})})]},n.id))})]}),(0,K.jsx)(`div`,{className:`h-px bg-gray-200 dark:bg-white/10 mb-8`})]})]})}var lL=60,uL=60,dL=100,fL=[{id:`phone`,name:`Phone`,icon:Zu,actionLabel:`+7 776 234 9535`,url:`tel:+77762349535`,cardClass:`bg-green-500`,buttonClass:`bg-green-700 hover:bg-green-800`},{id:`whatsapp`,name:`WhatsApp`,icon:Wu,actionLabel:`wa.me/77762349535`,url:`https://wa.me/77762349535`,cardClass:`bg-emerald-500`,buttonClass:`bg-emerald-700 hover:bg-emerald-800`},{id:`email`,name:`Email`,icon:Bu,actionLabel:`[email protected]`,url:`mailto:[email protected]`,cardClass:`bg-red-600`,buttonClass:`bg-red-800 hover:bg-red-900`},{id:`instagram`,name:`Instagram`,icon:Mu,actionLabel:`@aqdlsh`,url:`https://instagram.com/aqdlsh`,cardClass:`bg-pink-500`,buttonClass:`bg-pink-700 hover:bg-pink-800`},{id:`telegram`,name:`Telegram`,icon:rd,actionLabel:`@wellpussy`,url:`https://t.me/wellpussy`,cardClass:`bg-sky-500`,buttonClass:`bg-sky-700 hover:bg-sky-800`},{id:`linkedin`,name:`LinkedIn`,icon:Fu,actionLabel:`akadil-alish`,url:`https://www.linkedin.com/in/akadil-alish-3a9113353/`,cardClass:`bg-blue-700`,buttonClass:`bg-blue-900 hover:bg-blue-950`}],pL=lL+uL*(fL.length-1);function mL({card:e,index:t,isRaised:n,onToggle:r,onHoverStart:i,onHoverEnd:a}){let o=t*uL,s=t*10;return(0,K.jsx)(Hl.div,{className:`absolute left-1/2 -translate-x-1/2 cursor-pointer`,style:{to
5044p:o},initial:!1,animate:{y:n?-dL:0,zIndex:n?50:s},transition:{type:`spring`,stiffness:520,damping:30},onClick:t=>{t.stopPropagation(),r(e.id)},onHoverStart:i,onHoverEnd:a,children:(0,K.jsxs)(`div`,{className:`w-[90vw] sm:w-96 h-64 rounded-2xl shadow-2xl border border-black flex flex-col overflow-hidden `+e.cardClass,children:[(0,K.jsxs)(`div`,{className:`h-[60px] flex items-center justify-between px-4 sm:px-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-white flex items-center justify-center`,children:(0,K.jsx)(e.icon,{size:20,className:`text-black`})}),(0,K.jsx)(`span`,{className:`font-semibold text-white text-sm tracking-wide`,children:e.name})]}),(0,K.jsx)(`span`,{className:`text-[11px] font-mono text-white`,children:e.id.toUpperCase()})]}),(0,K.jsxs)(`div`,{className:`flex-1 px-4 sm:px-5 pb-4 sm:pb-5 pt-2 sm:pt-3 flex flex-col justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-white text-base font-semibold mb-1`,children:e.actionLabel}),(0,K.jsx)(`div`,{className:`text-white text-xs`,children:`Ready to connect`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`mt-4 w-full py-2.5 rounded-xl text-sm font-semibold text-white transition-transform duration-150 active:scale-95 `+e.buttonClass,onClick:t=>{t.stopPropagation(),e.url&&window.open(e.url,`_blank`)},children:[`Open `,e.name]})]})]})})}function hL(){let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(null),i=e=>{t(t=>t===e?null:e)};return(0,K.jsx)(`div`,{className:`w-full h-full bg-slate-950 text-white flex items-center justify-center overflow-y-auto`,onClick:()=>{t(null),r(null)},children:(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-5 px-4 py-6`,children:[(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`h1`,{className:`text-2xl sm:text-3xl font-black`,children:`Contact Wallet`}),(0,K.jsx)(`p`,{className:`text-xs sm:text-sm text-slate-300 mt-1`,children:`Hover or tap a card's header to pull it out of the stack.`})]}),(0,K.jsx)(`div`,{className:`relative w-full flex justify-center`,style:{height:pL+dL},children:(0,K.jsx)(`div`,{className:`relative w-[90vw] sm:w-96`,children:fL.map((t,a)=>(0,K.jsx)(mL,{card:t,index:a,isRaised:e===t.id||n===t.id,onToggle:i,onHoverStart:()=>r(t.id),onHoverEnd:()=>r(e=>e===t.id?null:e)},t.id))})})]})})}var gL=({type:e,number:t,expiry:n,color:r,gradient:i,logo:a,isActive:o})=>(0,K.jsxs)(`div`,{className:`relative w-full h-64 rounded-2xl p-6 transition-all duration-300 transform ${o?`scale-105 shadow-2xl`:`scale-95 opacity-70`}`,style:{background:i},children:[(0,K.jsx)(`div`,{className:`absolute top-4 right-4`,children:a}),(0,K.jsxs)(`div`,{className:`flex flex-col h-full justify-between text-white`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-wider opacity-80 mb-2`,children:e}),(0,K.jsx)(`div`,{className:`text-2xl font-mono tracking-wider`,children:(e=>e.replace(/(\d{4})(\d{4})(\d{4})(\d{4})/,`$1 $2 $3 $4`))(t)})]}),(0,K.jsxs)(`div`,{className:`flex justify-between items-end`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-wider opacity-80`,children:`Valid Thru`}),(0,K.jsx)(`div`,{className:`text-lg font-mono`,children:n})]}),(0,K.jsx)(`div`,{className:`w-12 h-8 bg-white/20 rounded-lg flex items-center justify-center`,children:(0,K.jsx)(`div`,{className:`w-8 h-6 bg-white rounded-sm`})})]})]})]}),_L=()=>{let[e,t]=(0,S.useState)(0),[n,r]=(0,S.useState)(!1),i=[{type:`Kaspi Gold`,number:`4400430301729460`,expiry:`11/28`,gradient:`linear-gradient(135deg, #FFD700 0%, #FFA500 100%)`,logo:(0,K.jsx)(`div`,{className:`text-white font-bold text-xl`,children:`KASPI`})},{type:`Halyk Bank`,number:`5522042707770152`,expiry:`09/30`,gradient:`linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%)`,logo:(0,K.jsx)(`div`,{className:`text-white font-bold text-xl`,children:`HALYK`})},{type:`Freedom Bank`,number:`4002890020742254`,expiry:`03/28`,gradient:`linear-gradient(135deg, #DC2626 0%, #F87171 100%)`,logo:(0,K.jsx)(`div`,{className:`text-white font-bold text-xl`,children:`FREEDOM`})}];return n?(0,K.jsxs)(`div`,{className:`w-full h-full relative overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`absolute top-4 left-4 z-10`,children:(0,K.jsx)(`button`,{onClick:()=>r(!1),className:`bg-black/60 text-white px-3 py-1.5 rounded-lg text-sm backdrop-blur-sm hover:bg-black/80 transition-colors`,children:`â Back to Cards`})}),(0,K.jsx)(`iframe`,{src:`https://app.sloyd.ai/embed/6103um76?width=800&height=600&fullscreen=true&mode=live&autoplay=true`,width:`800`,height:`600`,sandbox:`allow-scripts allow-same-origin allow-forms`,allow:`auto
5044play; fullscreen; xr-spatial-tracking; execution-while-out-of-viewport; execution-while-not-rendered`,allowFullScreen:!0,referrerPolicy:`no-referrer`,style:{border:`none`,position:`absolute`,inset:0,width:`calc(100% + 260px)`,height:`100%`,transform:`translateX(-260px)`,pointerEvents:`none`},title:`Kaspi Gold 3D Model`})]}):(0,K.jsxs)(`div`,{className:`w-full h-full flex flex-col p-6 bg-gradient-to-br from-slate-900 to-slate-800`,children:[(0,K.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,K.jsxs)(`div`,{className:`relative w-full max-w-md`,children:[(0,K.jsx)(`div`,{className:`relative h-64`,children:i.map((t,n)=>{let r=n-e,i=n===e;return(0,K.jsx)(`div`,{className:`absolute inset-0 transition-all duration-500 ease-out ${i?`z-10`:`z-0`}`,style:{transform:`translateX(${r===0?0:r>0?100:-100}%)`,opacity:Math.abs(r)>1?0:1},children:(0,K.jsx)(gL,{...t,isActive:i})},n)})}),(0,K.jsxs)(`div`,{className:`flex justify-between items-center mt-8`,children:[(0,K.jsx)(`button`,{onClick:()=>{t(e=>(e-1+i.length)%i.length)},className:`p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors`,children:(0,K.jsx)(au,{className:`text-white`,size:20})}),(0,K.jsx)(`div`,{className:`flex gap-2`,children:i.map((t,n)=>(0,K.jsx)(`div`,{className:`w-2 h-2 rounded-full transition-all duration-300 ${n===e?`bg-white w-8`:`bg-white/40`}`},n))}),(0,K.jsx)(`button`,{onClick:()=>{t(e=>(e+1)%i.length)},className:`p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors`,children:(0,K.jsx)(ou,{className:`text-white`,size:20})})]})]})}),(0,K.jsx)(`div`,{className:`flex justify-center mt-6`,children:(0,K.jsxs)(`button`,{onClick:()=>r(!0),className:`flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-purple-600 to-blue-600 hover:from-purple-700 hover:to-blue-700 text-white rounded-lg transition-all duration-200 transform hover:scale-105`,children:[(0,K.jsx)(eu,{size:20}),(0,K.jsx)(`span`,{children:`View 3D Model`})]})})]})};function vL(){return(0,K.jsxs)(`div`,{className:`w-full h-full bg-slate-950 text-slate-50 flex flex-col font-sans overflow-hidden`,children:[(0,K.jsxs)(`header`,{className:`flex items-center justify-between px-4 md:px-6 py-3 md:py-4 border-b border-slate-800`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(ku,{size:20,className:`text-pink-500`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-base md:text-lg font-bold leading-tight`,children:`Support / Donate`}),(0,K.jsx)(`p`,{className:`text-xs text-slate-400`,children:`Bank Cards`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-slate-400`,children:[(0,K.jsx)(mu,{size:16,className:`text-sky-400`}),(0,K.jsx)(`span`,{className:`hidden md:inline`,children:`Secure Payment`})]})]}),(0,K.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,K.jsx)(_L,{})})]})}var yL=JI,bL={strokeWidth:1.5},xL=(e={})=>(0,K.jsx)(jd,{...e}),SL=(e={})=>(0,K.jsx)(Pd,{...e}),CL=(e={})=>(0,K.jsx)(Fd,{...e}),wL=(e={})=>(0,K.jsx)(Id,{...e}),TL=e=>(0,K.jsx)(rL,{url:e}),EL=(e={})=>(0,K.jsx)(Gd,{...e}),DL=({size:e,className:t})=>(0,K.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,className:t,xmlns:`http://www.w3.org/2000/svg`,children:[(0,K.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,stroke:`currentColor`,strokeWidth:`2`}),(0,K.jsx)(`rect`,{x:`5`,y:`6`,width:`14`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`5`,y:`10`,width:`3`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`10`,y:`10`,width:`3`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`15`,y:`10`,width:`3`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`5`,y:`14`,width:`3`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`10`,y:`14`,width:`3`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`15`,y:`14`,width:`3`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`5`,y:`18`,width:`3`,height:`2`,fill:`currentColor`}),(0,K.jsx)(`rect`,{x:`10`,y:`18`,width:`8`,height:`2`,fill:`currentColor`})]});const OL={notepad:{id:`notepad`,title:`Resume.txt`,icon:(0,K.jsx)(bu,{...bL,className:`text-blue-400`}),component:(0,K.jsx)(wd,{}),defaultSize:{width:800,height:600}
5044,mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},explorer:{id:`explorer`,title:`Project Files`,icon:(0,K.jsx)(xu,{...bL,fill:`currentColor`,className:`text-yellow-500`}),component:xL(),defaultSize:{width:900,height:550},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},terminal:{id:`terminal`,title:`Terminal`,icon:(0,K.jsx)(pd,{...bL,className:`text-gray-100`}),component:(0,K.jsx)(Nd,{}),defaultSize:{width:700,height:450},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},calculator:{id:`calculator`,title:`Calculator`,icon:(0,K.jsx)(DL,{size:16,className:`text-blue-400`}),component:SL(),defaultSize:{width:320,height:520},mobileSize:{width:320,height:`80vh`},isExternal:!1},calendar:{id:`calendar`,title:`Calendar`,icon:(0,K.jsx)(nu,{...bL,className:`text-purple-400`}),component:CL(),defaultSize:{width:800,height:520},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},musicplayer:{id:`musicplayer`,title:`Music Player`,icon:(0,K.jsx)(Ju,{...bL,className:`text-green-400`}),component:wL(),defaultSize:{width:850,height:500},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},browser:{id:`browser`,title:`Akadilium Browser`,icon:(0,K.jsx)(Eu,{...bL,className:`text-blue-400`}),component:EL(),defaultSize:{width:900,height:600},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},neonDrift:{id:`neonDrift`,title:`Neon Drift`,icon:(0,K.jsx)(`img`,{src:`/neon-drift.png`,style:{width:50,height:50},alt:`Neon Drift`}),component:(0,K.jsx)(II,{}),defaultSize:{width:900,height:600},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},systemOverride:{id:`systemOverride`,title:`Cyber Lock`,icon:(0,K.jsx)(`img`,{src:`/cyber-lock.png`,style:{width:50,height:50},alt:`Cyber Lock`}),component:(0,K.jsx)(yL,{}),defaultSize:{width:900,height:650},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},devTycoon:{id:`devTycoon`,title:`Dev Tycoon Pro`,icon:(0,K.jsx)(`img`,{src:`/dev-tycoon.png`,style:{width:50,height:50},alt:`Dev Tycoon Pro`}),component:(0,K.jsx)(nL,{}),defaultSize:{width:1200,height:700},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},github:{id:`github`,title:`GitHub`,icon:(0,K.jsx)(Tu,{...bL,className:`text-white`}),component:TL(`https://github.com/aqadil`),defaultSize:{width:500,height:300},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!0},telegram:{id:`telegram`,title:`Telegram`,icon:(0,K.jsx)(rd,{...bL,className:`text-blue-500`}),component:TL(`https://t.me/wellpussy`),defaultSize:{width:500,height:300},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!0},akadiledu:{id:`akadiledu`,title:`AkadilEDU`,icon:(0,K.jsx)(`img`,{src:`/logo.png`,style:{width:50,height:50},alt:`AkadilEDU`}),component:TL(`https://akadiledu.com`),defaultSize:{width:500,height:300},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!0},settings:{id:`settings`,title:`Settings`,icon:(0,K.jsx)(ad,{...bL,className:`text-blue-400`}),component:(0,K.jsx)(cL,{}),defaultSize:{width:960,height:620},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},contact:{id:`contact`,title:`Contact Me`,icon:(0,K.jsx)(mu,{...bL,className:`text-emerald-400`}),component:(0,K.jsx)(hL,{}),defaultSize:{width:800,height:600},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1},donate:{id:`donate`,title:`Support / Donate`,icon:(0,K.jsx)(ku,{...bL,className:`text-pink-500`}),component:(0,K.jsx)(vL,{}),defaultSize:{width:720,height:520},mobileSize:{width:`95vw`,height:`80vh`},isExternal:!1}},kL=()=>{let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(null),i=e=>{r(e),t(t=>{let n=t.find(t=>t.id===e);return n?[...t.filter(t=>t.id!==e),n]:t})};return{windows:e,activeWindowId:n,openApp:n=>{let r=window.innerWidth<768,a=window.visualViewport||window,o=a.height-48;if(typeof n==`object`){let r={id:n.id,config:{id:n.id,title:n.title,icon:n.icon,component:null,defaultSize:{width:900,height:600},isExternal:!1},minimized:!1,position:{x:100+e.length*30,y:50+e.length*30},size:{width:900,height:600},customComponent:n.component,customProps:n.props||{}};t(e=>{let t=e.find(e=>e.id===n.id);return t?t.minimized?e.map(e=>e.id===n.id?{...e,minimized:!1}:e):e:[...e,r]}),i(n.id);return}let s=OL[n],c=n===`donate`||r,l={width:a.width,height:o},u=s.mobileSize||{width:`95vw`,height:`80vh`};t(e=>{let t=e.find(e=>e.id===n);if(t)return t.minimized?e.map(e=>e.id===n?{...e,minimized:!1}:e):e;let i={id:n,config:s,minimized:!1,position:c?{x:0,y:0}:{x:100+e.length*30,y:50+e.length*30},size:c?l:r?u:s.defaultSize,maximized:c};return[...e,i]}),i(n)},closeWindow:e=>{t(t=>t.filter(t=>t.id!==e)),n===e&&r(null)},toggleMinimize:e=>{t(t=>t.map(t=>{if(t.id===e){let n=!t.minimized;return n||r(e),{...t,minimized:n}}return t}))},focusWindow:i,setWindows:t}};var AL=[`AqadilOS Kernel v2.5.0-generic #42 SMP PREEMPT Thu Dec 16 20:55:32 UTC 2025`,`Initializing hardware...`,`Loading kernel modules...`,`Starting system services...`,`Mounting file systems...`,`Checking system integrity...`,`Network interfaces: eth0 up, wlan0 scanning...`,`System clock synchronized.`,`AqadilOS v2.5.0 ready.`,``,`[SYSTEM] Press F11 for maximum experience...`,`[F11 STATUS] >>> WAITING FOR INPUT <<<`],jL=()=>/Mac|iMac|Macintosh|MacIntel|MacPPC|Mac68K/i.test(navigator.platform)||/Mac/i.test(navigator.userAgent),ML=()=>{let e=[...AL],t=e.findIndex(e=>e.includes(`[F11 STATUS]`));if(jL()){let n=e.findIndex(e=>e.includes(`Press F11 for maximum experience`));n!==-1&&(e[n]=`[SYSTEM] macOS auto-activating fullscreen...`),e.splice(t,0,`[SYSTEM] macOS fullscreen mode ready`)}return e};function NL({onComplete:e}){let[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(0),[a,o]=(0,S.useState)(!0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let e=ML();if(r<e.length){let t=setTimeout(()=>{n(t=>[...t,e[r]]),i(e=>e+1),r===e.length-1&&u(!0)},Math.random()*800+200);return()=>clearTimeout(t)}},[r]),(0,S.useEffect)(()=>{let e=setInterval(()=>{o(e=>!e)},500);return()=>clearInterval(e)},[]);let d=()=>window.innerWidth<768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),f=e=>{!l||s||(jL()?(e.metaKey&&e.ctrlKey&&e.key===`f`||e.key===`f`&&e.altKey)&&(e.preventDefault(),p()):e.key===`F11`&&p())},p=()=>{c(!0),n(e=>{let t=[...e],n=t.findIndex(e=>e.includes(`[F11 STATUS]`));return n!==-1&&(t[n]=`[F11 STATUS] >>> ACTIVATED (${jL()?`MAC`:`PC`}) <<<`),t}),console.log(`[F11 PROTOCOL] MAXIMUM EXPERIENCE ACTIVATED (${jL()?`MAC`:`PC`})`),setTimeout(e,1e3)};return(0,S.useEffect)(()=>
5044{if(l&&!s&&(d()||jL())){c(!0),n(e=>{let t=[...e],n=t.findIndex(e=>e.includes(`[F11 STATUS]`));if(n!==-1){let e;e=d()?jL()?`MAC-MOBILE`:`MOBILE`:jL()?`MAC`:`PC`,t[n]=`[F11 STATUS] >>> AUTO-ACTIVATED (${e}) <<<`}return t});let t;t=d()?jL()?`MAC-MOBILE`:`MOBILE`:jL()?`MAC`:`PC`,console.log(`[F11 PROTOCOL] MAXIMUM EXPERIENCE AUTO-ACTIVATED (${t})`),setTimeout(e,1e3)}},[l,s]),(0,S.useEffect)(()=>(window.addEventListener(`keydown`,f),()=>window.removeEventListener(`keydown`,f)),[l,s,e]),(0,K.jsx)(`div`,{className:`h-screen w-screen bg-black flex items-center justify-center p-4`,children:(0,K.jsxs)(`div`,{className:`boot-text text-sm md:text-base max-w-2xl mx-auto p-4 md:p-8`,children:[t.map((e,t)=>(0,K.jsx)(`div`,{className:`mb-1 animate-boot-line ${e.includes(`[SYSTEM]`)?`text-cyan-400 font-bold`:e.includes(`[F11 STATUS]`)?s?`text-green-400 font-bold`:`text-red-400 font-bold animate-pulse`:``}`,children:e||(0,K.jsx)(`span`,{children:`\xA0`})},t)),r<ML().length&&(0,K.jsx)(`span`,{className:`inline-block w-2 h-4 bg-green-400 ml-1 ${a?`opacity-100`:`opacity-0`} ${l?`bg-red-400`:``}`})]})})}var PL=new Set([`settings`,`contact`,`donate`]),FL=({config:e,onClick:t})=>(0,K.jsxs)(`button`,{onDoubleClick:t,className:`desktop-icon group flex flex-col items-center`,children:[(0,K.jsx)(`div`,{className:`w-14 h-14 rounded-2xl flex items-center justify-center shadow-lg group-hover:scale-105 transition-transform bg-black/15 border border-white/10`,children:S.cloneElement(e.icon,{size:36,className:`text-white drop-shadow-[0_0_4px_rgba(0,0,0,0.85)]`})}),(0,K.jsx)(`span`,{className:`mt-1 text-xs leading-tight font-medium text-center px-1 max-w-[104px] break-words`,style:{color:`#ffffff`,WebkitTextStroke:`0.5px rgba(0,0,0,0.9)`,textShadow:`0 1px 2px rgba(0,0,0,0.9)`},children:e.title})]});function IL({onOpenApp:e}){return(0,K.jsx)(`div`,{className:`absolute inset-0 p-6 flex flex-col flex-wrap content-start gap-4 z-0`,children:Object.values(OL).filter(e=>!e.isExternal&&!PL.has(e.id)).map(t=>(0,K.jsx)(FL,{config:t,onClick:()=>e(t.id)},t.id))})}const LL=6048e5,RL=3600*24;RL*7,RL*365.2425;const zL=Symbol.for(`constructDateFrom`);function BL(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&zL in e?e[zL](t):e instanceof Date?new e.constructor(t):new Date(t)}function VL(e,t){return BL(t||e,e)}var HL={};function UL(){return HL}function WL(e,t){let n=UL(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=VL(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function GL(e,t){return WL(e,{...t,weekStartsOn:1})}function KL(e,t){let n=VL(e,t?.in),r=n.getFullYear(),i=BL(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=GL(i),o=BL(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=GL(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function qL(e){let t=VL(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function JL(e,...t){let n=BL.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function YL(e,t){let n=VL(e,t?.in);return n.setHours(0,0,0,0),n}function XL(e,t,n){let[r,i]=JL(n?.in,e,t),a=YL(r),o=YL(i),s=+a-qL(a),c=+o-qL(o);return Math.round((s-c)/864e5)}function ZL(e,t){let n=KL(e,t),r=BL(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),GL(r)}function QL(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function $L(e){return!(!QL(e)&&typeof e!=`number`||isNaN(+VL(e)))}function eR(e,t){let n=VL(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}var tR={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}};const nR=(e,t,n)=>{let r,i=tR[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function rR(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const iR={date:rR({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:rR({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:rR({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})};var aR={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`};const oR=(e,t,n,r)=>aR[e];function sR(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const cR={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:sR({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:sR({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:sR({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:sR({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:sR({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function lR(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?dR(s,e=>e.test(o)):uR(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}
vendor: 6,525 bytes, line 5044
5044}function uR(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function dR(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function fR(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const pR={code:`en-US`,formatDistance:nR,formatLong:iR,formatRelative:oR,localize:cR,match:{ordinalNumber:fR({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:lR({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:lR({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:lR({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:lR({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:lR({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function mR(e,t){let n=VL(e,t?.in);return XL(n,eR(n))+1}function hR(e,t){let n=VL(e,t?.in),r=GL(n)-+ZL(n);return Math.round(r/LL)+1}function gR(e,t){let n=VL(e,t?.in),r=n.getFullYear(),i=UL(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=BL(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=WL(o,t),c=BL(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=WL(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function _R(e,t){let n=UL(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=gR(e,t),a=BL(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),WL(a,t)}function vR(e,t){let n=VL(e,t?.in),r=WL(n,t)-+_R(n,t);return Math.round(r/LL)+1}function yR(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}const bR={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return yR(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):yR(n+1,2)},d(e,t){return yR(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return yR(e.getHours()%12||12,t.length)},H(e,t){return yR(e.getHours(),t.length)},m(e,t){return yR(e.getMinutes(),t.length)},s(e,t){return yR(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return yR(Math.trunc(r*10**(n-3)),t.length)}};var xR={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`};const SR={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return bR.y(e,t)},Y:function(e,t,n,r){let i=gR(e,r),a=i>0?i:1-i;return t===`YY`?yR(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):yR(a,t.length)},R:function(e,t){return yR(KL(e),t.length)},u:function(e,t){return yR(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return yR(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return yR(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return bR.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return yR(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=vR(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):yR(i,t.length)},I:function(e,t,n){let r=hR(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):yR(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):bR.d(e,t)},D:function(e,t,n){let r=mR(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):yR(r,t.length)},E:function(e,t,n){let r=e.getDay();
vendor: 5,448 bytes, line 5044
5044switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return yR(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return yR(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return yR(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?xR.noon:r===0?xR.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?xR.evening:r>=12?xR.afternoon:r>=4?xR.morning:xR.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return bR.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):bR.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):yR(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):yR(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):bR.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):bR.s(e,t)},S:function(e,t){return bR.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return wR(r);case`XXXX`:case`XX`:return TR(r);case`XXXXX`:case`XXX`:default:return TR(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return wR(r);case`xxxx`:case`xx`:return TR(r);case`xxxxx`:case`xxx`:default:return TR(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+CR(r,`:`);case`OOOO`:default:return`GMT`+TR(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+CR(r,`:`);case`zzzz`:default:return`GMT`+TR(r,`:`)}},t:function(e,t,n){return yR(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return yR(+e,t.length)}};function CR(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+yR(a,2)}function wR(e,t){return e%60==0?(e>0?`-`:`+`)+yR(Math.abs(e)/60,2):TR(e,t)}function TR(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=yR(Math.trunc(r/60),2),a=yR(r%60,2);return n+i+t+a}var ER=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},DR=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}};const OR={p:DR,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return ER(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,ER(r,t)).replace(`{{time}}`,DR(i,t))}};var kR=/^D+$/,AR=/^Y+$/,jR=[`D`,`DD`,`YY`,`YYYY`];function MR(e){return kR.test(e)}function NR(e){return AR.test(e)}function PR(e,t,n){let r=FR(e,t,n);if(console.warn(r),jR.includes(e))throw RangeError(r)}
5044function FR(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var IR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,LR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RR=/^'([^]*?)'?$/,zR=/''/g,BR=/[a-zA-Z]/;function VR(e,t,n){let r=UL(),i=n?.locale??r.locale??pR,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=VL(e,n?.in);if(!$L(s))throw RangeError(`Invalid time value`);let c=t.match(LR).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=OR[t];return n(e,i.formatLong)}return e}).join(``).match(IR).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:HR(e)};if(SR[t])return{isToken:!0,value:e};if(t.match(BR))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&NR(a)||!n?.useAdditionalDayOfYearTokens&&MR(a))&&PR(a,t,String(e));let o=SR[a[0]];return o(s,a,i.localize,l)}).join(``)}function HR(e){let t=e.match(RR);return t?t[1].replace(zR,`'`):e}var UR=[{id:`systemOverride`,name:`Cyber Lock`,appId:`systemOverride`},{id:`devTycoon`,name:`Dev Tycoon Pro`,appId:`devTycoon`},{id:`neonDrift`,name:`Neon Drift`,appId:`neonDrift`},{id:`coming-soon`,name:`More Games`,disabled:!0}],WR=e=>{try{let t=new(window.AudioContext||window.webkitAudioContext),n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.connect(i),i.connect(t.destination),e===`open`?(r.type=`sine`,r.frequency.setValueAtTime(300,n),r.frequency.exponentialRampToValueAtTime(800,n+.1),i.gain.setValueAtTime(0,n),i.gain.linearRampToValueAtTime(.2,n+.05),i.gain.linearRampToValueAtTime(0,n+.2),r.start(n),r.stop(n+.2)):e===`click`&&(r.type=`square`,r.frequency.setValueAtTime(1e3,n),i.gain.setValueAtTime(.1,n),i.gain.exponentialRampToValueAtTime(.01,n+.05),r.start(n),r.stop(n+.05))}catch(e){console.log(`Sound error:`,e)}};function GR({isOpen:e,onClose:t,onOpenApp:n,position:r}){console.log(`GamesFolder render, isOpen:`,e);let i=e=>{if(console.log(`Game clicked:`,e),e.disabled){WR(`click`);return}WR(`click`),e.appId&&(console.log(`Opening app with ID:`,e.appId),n(e.appId),t())};return(0,K.jsx)(Ai,{children:e&&(0,K.jsx)(Hl.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:20},className:`fixed inset-0 bg-black/20 backdrop-blur-sm z-[999]`,onClick:t,children:(0,K.jsx)(`div`,{className:`absolute flex items-center justify-center`,style:{top:r?.top||`50%`,left:r?.left||`50%`,transform:r?`translate(0, -50%)`:`translate(-50%, -50%)`},children:(0,K.jsxs)(Hl.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:`bg-white/80 backdrop-blur-xl border border-white/20 rounded-xl p-5 max-w-lg w-full mx-4 shadow-2xl`,onClick:e=>e.stopPropagation(),children:[(0,K.jsxs)(`div`,{className:`flex justify-between items-center mb-5`,children:[(0,K.jsxs)(`h2`,{className:`text-xl font-bold text-slate-800 flex items-center gap-2`,children:[(0,K.jsx)(Cu,{size:20,className:`text-purple-500`}),`Games`]}),(0,K.jsx)(`button`,{onClick:t,className:`p-2 bg-slate-100 rounded-lg hover:bg-slate-200 transition-colors text-slate-600`,children:`Ã`})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-3`,children:UR.map((e,t)=>{let n=OL[e.appId];return(0,K.jsxs)(Hl.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.1},onClick:()=>i(e),className:` 5045 relative group overflow-hidden bg-white border border-slate-200 rounded-xl p-4 5046 hover:bg-slate-50 hover:border-slate-300 transition-all duration-200 cursor-pointer 5047 ${e.disabled?`opacity-50 cursor-not-allowed`:`hover:scale-105`} 5048 `,children:[(0,K.jsx)(`div`,{className:`flex items-center justify-center w-14 h-14 roun
5048ded-xl mb-3 bg-white border border-slate-200 shadow-sm`,children:e.disabled?(0,K.jsx)(Cu,{size:24,className:`text-slate-400`}):n?.icon||(0,K.jsx)(Cu,{size:24,className:`text-slate-600`})}),(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`h3`,{className:`text-slate-800 font-semibold text-sm mb-1`,children:e.disabled?e.name:n?.title||e.name}),e.disabled&&(0,K.jsx)(`p`,{className:`text-slate-500 text-xs`,children:`Coming Soon`})]}),!e.disabled&&(0,K.jsx)(`div`,{className:`absolute inset-0 bg-purple-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-200 rounded-xl`})]},e.id)})}),(0,K.jsx)(`div`,{className:`text-center mt-5 text-slate-500 text-sm`,children:`Click any game to launch`})]})})})})}var KR=new Set([`settings`,`contact`,`donate`]);function qR({onClose:e,onOpenApp:t}){let n=Object.values(OL).filter(e=>![`systemOverride`,`devTycoon`,`neonDrift`].includes(e.id)&&!KR.has(e.id)),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(null),s=(0,S.useRef)(null),[c,l]=(0,S.useState)(!1);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`fixed inset-0 z-[90]`,onClick:e}),(0,K.jsxs)(Hl.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{type:`spring`,damping:20,stiffness:300},className:`fixed bottom-16 left-4 w-[400px] md:w-[640px] bg-white/80 backdrop-blur-xl border border-white/20 rounded-xl shadow-2xl z-[100] overflow-hidden flex flex-col`,style:{height:`min(600px, 80vh)`},children:[(0,K.jsx)(`div`,{className:`p-6 pb-2`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3 bg-slate-100 border border-slate-200 rounded-lg px-4 py-3 text-slate-800 focus-within:border-slate-400 transition-colors`,children:[(0,K.jsx)(nd,{size:20,className:`text-slate-500`}),(0,K.jsx)(`input`,{type:`text`,placeholder:`Search for apps, settings, and documents`,className:`bg-transparent outline-none flex-1 placeholder:text-slate-500 text-slate-800`})]})}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-auto p-6 pt-2 flex flex-col gap-6`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-4 px-2`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-slate-800`,children:`Pinned`}),(0,K.jsx)(`button`,{className:`text-xs text-slate-500 hover:bg-slate-100 px-2 py-1 rounded transition-colors`,children:`All apps`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-4 md:grid-cols-6 gap-2`,children:[(0,K.jsxs)(`button`,{ref:s,onClick:()=>{if(s.current){let e=s.current.getBoundingClientRect();o({top:e.top,left:e.right+8,width:320})}i(!0)},className:`flex flex-col items-center gap-2 p-3 rounded-xl hover:bg-white/10 transition-colors group`,children:[(0,K.jsx)(`div`,{className:`w-12 h-12 flex items-center justify-center bg-gradient-to-br from-purple-500 to-pink-500 rounded-xl shadow-sm group-hover:scale-105 transition-transform`,children:(0,K.jsx)(Cu,{size:28,className:`text-white`})}),(0,K.jsx)(`span`,{className:`text-xs text-slate-700 truncate w-full text-center font-medium`,children:`Games`})]},`games-folder`),n.map(n=>(0,K.jsxs)(`button`,{onClick:()=>{t(n.id),e()},className:`flex flex-col items-center gap-2 p-3 rounded-xl hover:bg-slate-50 transition-colors group`,children:[(0,K.jsx)(`div`,{className:`w-12 h-12 flex items-center justify-center rounded-xl shadow-sm group-hover:scale-105 transition-transform ${[`terminal`,`github`,`telegram`].includes(n.id)?`bg-white border-2 border-slate-300`:`bg-white border border-slate-200`}`,children:S.cloneElement(n.icon,{size:28,className:[`terminal`,`github`,`telegram`].includes(n.id)?`text-slate-700`:``})}),(0,K.jsx)(`span`,{className:`text-xs text-slate-700 truncate w-full text-center font-medium`,children:n.title})]},n.id))]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-4 px-2`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-slate-800`,children:`Recommended`}),(0,K.jsx)(`button`,{className:`text-xs text-slate-500 hover:bg-slate-100 px-2 py-1 rounded transition-colors`,children:`More`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 p-3 rounded-xl hover:bg-slate-50 transition-colors cursor-pointer`,children:[(0,K.jsx)(`div`,{className:`w-10 h-10 bg-blue-100 text-blue-600 rounded-lg flex items-center justify-center`,children:(0,K.jsx)(bu,{size:20})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-slate-800`,children:`Latest Resume Version.pdf`}),(0,K.jsx)(`div`,{className:`text-xs text-slate-500`,children:`Opened 5 min ago`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 p-3 rounded-xl hover:bg-slate-50 transition-colors cursor-pointer`,children:[(0,K.jsx)(`div`,{className:`w-10 h-10 bg-yellow-100 text-yellow-600 rounded-lg flex items-center justify-center`,children:(0,K.jsx)(uu,{size:20})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-slate-800`,children:`AkadilEDU_Project_Final`}),(0,K.jsx)(`div`,{className:`text-xs text-slate-500`,children:`Recently added`})]})]})]})]})]}),(0,K.jsxs)(`div`,{className:`bg-slate-50/80 p-4 border-t border-slate-200 flex items-center justify-between relative`,children:[(0,K.jsx)(Ai,{children:c&&(0,K.jsxs)(Hl.div,{initial:{opacity:0,y:10,scale:.95}
5048,animate:{opacity:1,y:-10,scale:1},exit:{opacity:0,y:10,scale:.95},transition:{type:`spring`,damping:20,stiffness:260},className:`absolute bottom-full left-2 w-64 bg-[#f9f9f9]/95 backdrop-blur-xl border border-slate-200 shadow-2xl rounded-xl p-1 overflow-hidden z-[120] mb-2`,children:[(0,K.jsx)(`div`,{className:`p-2 border-b border-slate-200`,children:(0,K.jsx)(`p`,{className:`text-[10px] font-bold text-slate-400 uppercase tracking-widest px-2`,children:`User options`})}),(0,K.jsxs)(`button`,{onClick:()=>{t(`settings`),l(!1),e()},className:`w-full text-left flex items-center gap-3 px-3 py-2.5 text-sm text-slate-700 hover:bg-blue-500 hover:text-white rounded-lg transition-colors`,children:[(0,K.jsx)(ad,{size:16}),(0,K.jsx)(`span`,{children:`Settings & Personalization`})]}),(0,K.jsxs)(`button`,{onClick:()=>{t(`contact`),l(!1),e()},className:`w-full text-left flex items-center gap-3 px-3 py-2.5 text-sm text-slate-700 hover:bg-blue-500 hover:text-white rounded-lg transition-colors`,children:[(0,K.jsx)(hd,{size:16}),(0,K.jsx)(`span`,{children:`Contact Me`})]}),(0,K.jsxs)(`button`,{onClick:()=>{t(`donate`),l(!1),e()},className:`w-full text-left flex items-center gap-3 px-3 py-2.5 text-sm text-slate-700 hover:bg-pink-500 hover:text-white rounded-lg transition-colors`,children:[(0,K.jsx)(ku,{size:16}),(0,K.jsx)(`span`,{children:`Support / Donate`})]})]})}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`flex items-center gap-3 px-2 py-2 rounded-lg transition-all ${c?`bg-black/5`:`hover:bg-black/5`}`,children:[(0,K.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-gradient-to-tr from-cyan-500 to-blue-600 flex items-center justify-center text-white font-bold text-xs shadow-md`,children:`AA`}),(0,K.jsxs)(`div`,{className:`text-left`,children:[(0,K.jsx)(`span`,{className:`block text-sm font-semibold text-slate-800 leading-none`,children:Td.header.name}),(0,K.jsx)(`span`,{className:`text-[10px] text-slate-500`,children:`Administrator`})]}),(0,K.jsx)(su,{size:14,className:`text-slate-400 transition-transform ${c?`rotate-180`:``}`})]}),(0,K.jsx)(`button`,{className:`p-2 hover:bg-red-500 hover:text-white rounded-lg transition-colors text-slate-500`,children:(0,K.jsx)(zu,{size:18})})]})]}),(0,K.jsx)(GR,{isOpen:r,onClose:()=>i(!1),onOpenApp:n=>{t(n),e()},position:a})]})}var JR=({icon:e,title:t,isOpen:n,isActive:r,onClick:i})=>(0,K.jsxs)(`button`,{onClick:i,className:`relative p-1.5 md:p-2.5 rounded-md transition-all duration-200 group hover:bg-gray-100 flex items-center justify-center ${r?`bg-gray-100`:``}`,children:[(0,K.jsx)(`div`,{className:`transition-transform duration-200 ${r?`scale-110`:`group-hover:scale-105`}`,children:S.cloneElement(e,{size:window.innerWidth<768?18:24,className:`text-black`,style:e.type===`img`?{width:window.innerWidth<768?18:26,height:window.innerWidth<768?18:26}:{}})}),n&&(0,K.jsx)(Hl.div,{layoutId:`activeIndicator`,className:`absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full ${r?`bg-os-accent w-3 md:w-5`:`bg-gray-400`}`})]});function YR({windows:e,activeId:t,onToggleMinimize:n,onOpenApp:r}){let[i,a]=(0,S.useState)(new Date),[o,s]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let e=setInterval(()=>a(new Date),1e3);return()=>clearInterval(e)},[]);let c=[...new Set([...[`notepad`,`explorer`,`terminal`,`github`,`telegram`],...e.map(e=>e.id)])];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ai,{children:o&&(0,K.jsx)(qR,{onClose:()=>s(!1),onOpenApp:r})}),(0,K.jsxs)(`div`,{className:`taskbar flex items-center justify-between px-2 md:px-4 z-[100] h-10 md:h-12`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 md:gap-2`,children:[(0,K.jsx)(`button`,{onClick:()=>s(!o),className:`p-1.5 md:p-2 rounded-md transition-colors hover:bg-gray-100 ${o?`bg-gray-100`:``}`,children:(0,K.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 88 88`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`text-blue-400 md:w-6 md:h-6`,children:[(0,K.jsx)(`path`,{d:`M0 12.4096L35.2 7.61377V42.5369H0V12.4096Z`,fill:`currentColor`}),(0,K.jsx)(`path`,{d:`M88 0L40.9067 6.676V42.5369H88V0Z`,fill:`currentColor`}),(0,K.jsx)(`path`,{d:`M0 46.9585H35.2V81.229L0 76.5262V46.9585Z`,fill:`currentColor`}),(0,K.jsx)(`path`,{d:`M88 46.9585H40.9067V88L88 81.324V46.9585Z`,fill:`currentColor`})]})}),(0,K.jsxs)(`div`,{className:`hidden md:flex items-center gap-2 bg-gray-100 px-4 py-1.5 rounded-full border border-gray-200 text-sm text-black w-64`,children:[(0,K.jsx)(nd,{size:16,className:`text-black`}),(0,K.jsx)(`span`,{className:`text-black`,children:`Type here to search...`})]})]}),(0,K.jsx)(`div`,{className:`absolute left-1/2 -translate-x-1/2 flex items-center gap-0.5 md:gap-1 h-full overflow-x-auto max-w-[60%]`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitScrollbar:`n
5048one`},children:c.map(i=>{let a=OL[i],o=e.find(e=>e.id===i),s=!!o,c=t===i&&!o?.minimized,l=a?.icon||o?.config?.icon,u=a?.title||o?.config?.title;return l?(0,K.jsx)(JR,{icon:l,title:u,isOpen:s,isActive:c,onClick:()=>s?n(i):r(i)},i):null})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 md:gap-4 text-black text-xs`,children:[(0,K.jsxs)(`div`,{className:`hidden md:flex items-center gap-3 hover:bg-gray-100 px-3 py-2 rounded-md transition-colors cursor-default`,children:[(0,K.jsx)(vd,{size:16,className:`text-black`}),(0,K.jsx)(gd,{size:16,className:`text-black`}),(0,K.jsx)($l,{size:16,className:`text-black`})]}),(0,K.jsxs)(`div`,{className:`text-right hover:bg-gray-100 px-2 md:px-3 py-1 rounded-md transition-colors cursor-default`,children:[(0,K.jsx)(`div`,{className:`font-medium text-black text-xs md:text-sm`,children:VR(i,`HH:mm`)}),(0,K.jsx)(`div`,{className:`text-black text-xs hidden md:block`,children:VR(i,`dd/MM/yyyy`)})]})]})]})]})}var XR=({icon:e,onClick:t,isDanger:n})=>(0,K.jsx)(`button`,{onClick:e=>{e.stopPropagation(),t()},className:`p-2 rounded-md transition-colors window-control-btn ${n?`hover:bg-red-500/80`:`hover:bg-white/10`}`,children:(0,K.jsx)(e,{size:14})}),ZR=({visible:e})=>e?(0,K.jsxs)(`div`,{className:`absolute top-full right-0 mt-1 bg-gray-900 text-white text-xs px-2 py-1 rounded shadow-lg border border-gray-700 whitespace-nowrap z-50`,children:[`For the best experience, open window in fullscreen`,(0,K.jsx)(`div`,{className:`absolute -top-1 right-2 w-2 h-2 bg-gray-900 border-l border-t border-gray-700 transform rotate-45`})]}):null;function QR({windowData:e,onClose:t,onMinimize:n,onFocus:r,isActive:i,updateWindowState:a,onOpenApp:o}){let{id:s,config:c,position:l,size:u,customComponent:d,customProps:f}=e,[p,m]=(0,S.useState)(!!e.maximized),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(!1),y=(0,S.useRef)(null),b=(0,S.useRef)(null),x=[`neonDrift`,`systemOverride`,`devTycoon`].includes(s);(0,S.useEffect)(()=>{if(c.id===`github`||c.id===`telegram`||c.id===`akadiledu`){let e=setTimeout(()=>{t(s)},100);return()=>clearTimeout(e)}},[s,c.id,t]),(0,S.useEffect)(()=>{if(x&&!p){v(!0);let e=setTimeout(()=>{v(!1)},4e3);return()=>clearTimeout(e)}},[x,p]),(0,S.useEffect)(()=>{let e=b.current;if(!e)return;let t=t=>{let n=t.clientX-e.getBoundingClientRect().left,r=t.clientY-e.getBoundingClientRect().top;n>300&&r>200&&a(e=>e.map(e=>e.id===s?{...e,size:{width:n,height:r}}:e))},n=()=>{document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,n),document.body.style.cursor=`default`},r=e=>{e.stopPropagation(),document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,n),document.body.style.cursor=`nwse-resize`},i=e.querySelector(`.resizer-handle`);if(i)return i.addEventListener(`mousedown`,r),()=>i.removeEventListener(`mousedown`,r)},[s,a]);let C=()=>{v(!1),p?a(h?e=>e.map(e=>e.id===s?{...e,position:h.pos,size:h.size}:e):e=>e.map(e=>e.id===s?{...e,position:l,size:u}:e)):(g({pos:l,size:u}),a(e=>e.map(e=>e.id===s?{...e,position:{x:0,y:0},size:{width:window.innerWidth,height:window.innerHeight-48}}:e))),m(!p),r(s)};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{ref:y,className:`fixed inset-0 pointer-events-none z-0`}),(0,K.jsxs)(Hl.div,{ref:b,drag:!p,dragConstraints:y,dragMomentum:!1,dragElastic:0,dragListener:!1,dragPropagation:!1,initial:l,animate:{...l,width:u.width,height:u.height,scale:1,opacity:1},exit:{scale:.9,opacity:0,transition:{duration:.15}},transition:{x:{type:`tween`,duration:0},y:{type:`tween`,duration:0},width:{type:`spring`,stiffness:260,damping:30},height:{type:`spring`,stiffness:260,damping:30},default:{type:`tween`,duration:0}},onMouseDown:()=>r(s),className:`absolute flex flex-col overflow-hidden rounded-lg backdrop-blur-2xl bg-os-glass border transition-shadow duration-200 ${i?`border-os-accent/50 shadow-win-active z-10`:`border-os-border shadow-win-inactive z-0`} window-frame`,"data-component-name":`WindowFrame`,style:{width:u.width,height:u.height,touchAction:`none`},children:[(0,K.jsxs)(`div`,{className:`h-10 flex items-center justify-between px-3 select-none bg-white/5 border-b border-os-border`,onDoubleClick:C,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 text-sm font-medium text-black flex-1 titlebar-drag-area cursor-grab active:cursor-grabbing`,onMouseDown:e=>{if(!p){e.stopPropagation();let t=e.clientX-l.x,n=e.clientY-l.y,r=e=>
5048{let r=e.clientX-t,i=e.clientY-n,o=window.visualViewport||window,c=o.width-u.width,l=o.height-u.height-48;a(e=>e.map(e=>e.id===s?{...e,position:{x:Math.max(0,Math.min(r,c)),y:Math.max(0,Math.min(i,l))}}:e))},i=e=>{if(e.touches.length>0){let r=e.touches[0],i=r.clientX-t,o=r.clientY-n,c=window.visualViewport||window,l=c.width-u.width,d=c.height-u.height-48;a(e=>e.map(e=>e.id===s?{...e,position:{x:Math.max(0,Math.min(i,l)),y:Math.max(0,Math.min(o,d))}}:e))}},o=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)},c=()=>{document.removeEventListener(`touchmove`,i),document.removeEventListener(`touchend`,c)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),document.addEventListener(`touchmove`,i),document.addEventListener(`touchend`,c)}},children:[S.cloneElement(c.icon,{size:16,style:c.icon.type===`img`?{width:21,height:21}:{}}),(0,K.jsx)(`span`,{children:c.title})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 relative`,children:[(0,K.jsx)(XR,{icon:Gu,onClick:()=>n(s)}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(XR,{icon:p?dd:Hu,onClick:C}),(0,K.jsx)(ZR,{visible:_})]}),(0,K.jsx)(XR,{icon:yd,onClick:()=>t(s),isDanger:!0})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-auto bg-[#121212]/90 text-os-text cursor-default relative`,children:[d?S.isValidElement(d)?d:S.cloneElement(d,{onOpenApp:o,onClose:()=>t(s),...f}):c.id===`explorer`?(0,K.jsx)(jd,{onOpenApp:o}):c.id===`browser`?(0,K.jsx)(Gd,{onOpenApp:o}):c.component,!p&&(0,K.jsx)(`div`,{className:`resizer-handle absolute bottom-0 right-0 w-6 h-6 cursor-nwse-resize z-20 bg-transparent hover:bg-white/10 rounded-tl-lg`})]})]})]})}var $R=e=>{(0,S.useEffect)(()=>{if(e){let e=new Audio(`/music/audio/win11-startup.mp3`);e.volume=.7,e.play().catch(e=>console.log(`Startup sound play failed:`,e))}},[e])},ez=()=>{(0,S.useEffect)(()=>{let e=!1,t=0,n=0,r=null,i=()=>{let e=document.createElement(`div`);return e.style.position=`fixed`,e.style.border=`1px dashed #4a90e2`,e.style.backgroundColor=`rgba(74, 144, 226, 0.2)`,e.style.pointerEvents=`none`,e.style.zIndex=`9999`,e.style.display=`none`,document.body.appendChild(e),e},a=(e,t,n,i)=>{if(!r)return;let a=Math.min(e,n),o=Math.min(t,i),s=Math.abs(n-e),c=Math.abs(i-t);r.style.left=`${a}px`,r.style.top=`${o}px`,r.style.width=`${s}px`,r.style.height=`${c}px`,r.style.display=`block`},o=o=>{o.button===0&&!o.target.closest(`button, input, a, [role="button"], .window-frame, [data-component-name="WindowFrame"]`)&&(e=!0,t=o.clientX,n=o.clientY,r||=i(),a(t,n,t,n))},s=r=>{e&&a(t,n,r.clientX,r.clientY)},c=()=>{e&&r&&(r.style.display=`none`),e=!1};return document.addEventListener(`mousedown`,o),document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c),()=>{document.removeEventListener(`mousedown`,o),document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c),r&&r.parentNode&&r.parentNode.removeChild(r)}},[])},tz=()=>{(0,S.useEffect)(()=>{let e=e=>(e.preventDefault(),!1),t=e=>{if(e.ctrlKey&&e.shiftKey&&e.key===`I`||e.key===`F12`||e.ctrlKey&&e.key===`u`)return e.preventDefault(),!1};return document.addEventListener(`contextmenu`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`contextmenu`,e),document.removeEventListener(`keydown`,t)}},[])};function nz(){return(0,K.jsx)(sL,{children:(0,K.jsx)(Vd,{children:(0,K.jsx)(rz,{})})})}function rz(){let[e,t]=(0,S.useState)(!1),{windows:n,activeWindowId:r,openApp:i,closeWindow:a,toggleMinimize:o,focusWindow:s,setWindows:c}=kL(),{wallpaper:l}=oL();return $R(e),tz(),ez(),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ai,{children:!e&&(0,K.jsx)(NL,{onComplete:()=>t(!0)})}),e&&(0,K.jsxs)(`div`,{className:`h-screen w-screen overflow-hidden relative`,style:{backgroundImage:l?`url(${l.url})`:`none`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`},children:[(0,K.jsx)(IL,{onOpenApp:i}),(0,K.jsx)(Ai,{children:n.map(e=>!e.minimized&&(0,K.jsx)(QR,{windowData:e,onClose:a,onMinimize:o,onFocus:s,isActive:r===e.id,updateWindowState:c,onOpenApp:i}
5048,e.id))}),(0,K.jsx)(YR,{windows:n,activeId:r,onToggleMinimize:o,onOpenApp:i})]})]})}var iz=nz;(0,y.createRoot)(document.getElementById(`root`)).render((0,K.jsx)(iz,{}));
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.