var e=Object.defineProperty,t=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r);import{q as n}from"./base-CrjORGlF.js";function r(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o={exports:{}},s={},l=Symbol.for("react.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),_=Symbol.iterator;var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function M(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}function w(){}function E(e,t,n){this.props=e,this.context=t,this.refs=S,this.updater=n||b}M.prototype.isReactComponent={},M.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): 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")},M.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=M.prototype;var T=E.prototype=new w;T.constructor=E,x(T,M.prototype),T.isPureReactComponent=!0;var A=Array.isArray,C=Object.prototype.hasOwnProperty,R={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function L(e,t,n){var r,i={},a=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(a=""+t.key),t)C.call(t,r)&&!P.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:l,type:e,key:a,ref:o,props:i,_owner:R.current}}function I(e){return"object"==typeof e&&null!==e&&e.$$typeof===l}var N=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function D(e,t,n,r,i){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var o=!1;if(null===e)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case l:case c:o=!0}}if(o)return i=i(o=e),e=""===r?"."+O(o,0):r,A(i)?(n="",null!=e&&(n=e.replace(N,"$&/")+"/"),D(i,t,n,"",(function(e){return e}))):null!=i&&(I(i)&&(i=function(e,t){return{$$typeof:l,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(N,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=""===r?".":r+":",A(e))for(var s=0;s<e.length;s++){var u=r+O(a=e[s],s);o+=D(a,t,n,u,i)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=_&&e[_]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),s=0;!(a=e.next()).done;)o+=D(a=a.value,t,n,u=r+O(a,s++),i);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function U(e,t,n){if(null==e)return e;var r=[],i=0;return D(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function k(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var F={current:null},z={transition:null},B={ReactCurrentDispatcher:F,ReactCurrentBatchConfig:z,ReactCurrentOwner:R};function H(){throw Error("act(...) is not supported in production builds of React.")}s.Children={map:U,forEach:function(e,t,n){U(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return U(e,(function(){t++})),t},toArray:function(e){return U(e,(function(e){return e}))||[]},only:function(e){if(!I(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},s.Component=M,s.Fragment=u,s.Profiler=d,s.PureComponent=E,s.StrictMode=h,s.Suspense=g,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,s.act=H,s.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=x({},e.props),i=e.key,a=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,o=R.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(c in t)C.call(t,c)&&!P.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==s?s[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=n;else if(1<c){s=Array(c);for(var u=0;u<c;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:l,type:e.type,key:i,ref:a,props:r,_owner:o}},s.createContext=function(e){return(e={$$typeof:p,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:f,_context:e},e.Consumer=e},s.createElement=L,s.createFactory=function(e){var t=L.bind(null,e);return t.type=e,t},s.createRef=function(){return{current:null}},s.forwardRef=function(e){return{$$typeof:m,render:e}},s.isValidElement=I,s.lazy=function(e){return{$$typeof:y,_payload:{_status:-1,_result:e},_init:k}},s.memo=function(e,t){return{$$typeof:v,type:e,compare:void 0===t?null:t}},s.startTransition=function(e){var t=z.transition;z.transition={};try{e()}finally{z.transition=t}},s.unstable_act=H,s.useCallback=function(e,t){return F.current.useCallback(e,t)},s.useContext=function(e){return F.current.useContext(e)},s.useDebugValue=function(){},s.useDeferredValue=function(e){return F.current.useDeferredValue(e)},s.useEffect=function(e,t){return F.current.useEffect(e,t)},s.useId=function(){return F.current.useId()},s.useImperativeHandle=function(e,t,n){return F.current.useImperativeHandle(e,t,n)},s.useInsertionEffect=function(e,t){return F.current.useInsertionEffect(e,t)},s.useLayoutEffect=function(e,t){return F.current.useLayoutEffect(e,t)},s.useMemo=function(e,t){return F.current.useMemo(e,t)},s.useReducer=function(e,t,n){return F.current.useReducer(e,t,n)},s.useRef=function(e){return F.current.useRef(e)},s.useState=function(e){return F.current.useState(e)},s.useSyncExternalStore=function(e,t,n){return F.current.useSyncExternalStore(e,t,n)},s.useTransition=function(){return F.current.useTransition()},s.version="18.3.1",o.exports=s;var V=o.exports;const j=a(V),G=r({__proto__:null,default:j},[V]);function W(){return W=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},W.apply(null,arguments)}function X(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function $(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,t){return(q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Y(e){if(Array.isArray(e))return e}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Z(e,t){if(e){if("string"==typeof e)return K(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}function J(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q(e,t){return Y(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||Z(e,t)||J()}function ee(e){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function te(e){var t=function(e,t){if("object"!=ee(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ee(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ee(t)?t:t+""}function ne(e,t,n){return(t=te(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function re(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ie(e){return function(e){if(Array.isArray(e))return K(e)}(e)||re(e)||Z(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){ne(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}function le(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function ce(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var ue="data-rc-order",he="data-rc-priority",de=new Map;function fe(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return e?e.startsWith("data-")?e:"data-".concat(e):"rc-util-key"}function pe(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function me(e){return Array.from((de.get(e)||e).children).filter((function(e){return"STYLE"===e.tagName}))}function ge(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!le())return null;var n=t.csp,r=t.prepend,i=t.priority,a=void 0===i?0:i,o=function(e){return"queue"===e?"prependQueue":e?"prepend":"append"}(r),s="prependQueue"===o,l=document.createElement("style");l.setAttribute(ue,o),s&&a&&l.setAttribute(he,"".concat(a)),null!=n&&n.nonce&&(l.nonce=null==n?void 0:n.nonce),l.innerHTML=e;var c=pe(t),u=c.firstChild;if(r){if(s){var h=(t.styles||me(c)).filter((function(e){if(!["prepend","prependQueue"].includes(e.getAttribute(ue)))return!1;var t=Number(e.getAttribute(he)||0);return a>=t}));if(h.length)return c.insertBefore(l,h[h.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=pe(t);return(t.styles||me(n)).find((function(n){return n.getAttribute(fe(t))===e}))}function ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ve(e,t);n&&pe(t).removeChild(n)}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=pe(n),i=me(r),a=oe(oe({},n),{},{styles:i});!function(e,t){var n=de.get(e);if(!n||!ce(document,n)){var r=ge("",t),i=r.parentNode;de.set(e,i),e.removeChild(r)}}(r,a);var o=ve(t,a);if(o){var s,l,c;if(null!==(s=a.csp)&&void 0!==s&&s.nonce&&o.nonce!==(null===(l=a.csp)||void 0===l?void 0:l.nonce))o.nonce=null===(c=a.csp)||void 0===c?void 0:c.nonce;return o.innerHTML!==e&&(o.innerHTML=e),o}var u=ge(e,a);return u.setAttribute(fe(a),t),u}function be(e,t){if(null==e)return{};var n,r,i=X(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xe(e,t,n){var r=V.useRef({});return"value"in r.current&&!n(r.current.condition,t)||(r.current.value=e(),r.current.condition=t),r.current.value}var Se={};function Me(e,t){}function we(e,t){}function Ee(e,t,n){t||Se[n]||(e(!1,n),Se[n]=!0)}function Te(e,t){Ee(Me,e,t)}function Ae(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;return function e(t,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=r.has(t);if(Te(!o,"Warning: There may be circular references"),o)return!1;if(t===i)return!0;if(n&&a>1)return!1;r.add(t);var s=a+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var l=0;l<t.length;l++)if(!e(t[l],i[l],s))return!1;return!0}if(t&&i&&"object"===ee(t)&&"object"===ee(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every((function(n){return e(t[n],i[n],s)}))}return!1}(e,t)}function Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Re(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,te(r.key),r)}}function Pe(e,t,n){return t&&Re(e.prototype,t),n&&Re(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Te.preMessage=function(e){},Te.resetWarned=function(){Se={}},Te.noteOnce=function(e,t){Ee(we,e,t)};function Le(e){return e.join("%")}var Ie=function(){function e(t){Ce(this,e),ne(this,"instanceId",void 0),ne(this,"cache",new Map),this.instanceId=t}return Pe(e,[{key:"get",value:function(e){return this.opGet(Le(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(Le(e),t)}},{key:"opUpdate",value:function(e,t){var n=t(this.cache.get(e));null===n?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),Ne="data-token-hash",Oe="data-css-hash",De="__cssinjs_instance__";var Ue=V.createContext({hashPriority:"low",cache:function(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(Oe,"]"))||[],n=document.head.firstChild;Array.from(t).forEach((function(t){t[De]=t[De]||e,t[De]===e&&document.head.insertBefore(t,n)}));var r={};Array.from(document.querySelectorAll("style[".concat(Oe,"]"))).forEach((function(t){var n,i=t.getAttribute(Oe);r[i]?t[De]===e&&(null===(n=t.parentNode)||void 0===n||n.removeChild(t)):r[i]=!0}))}return new Ie(e)}(),defaultCache:!0});function ke(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}function Fe(e){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ze=function(){return!!e})()}function Be(e){var t=ze();return function(){var n,r=Fe(e);if(t){var i=Fe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==ee(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $(e)}(this,n)}}var He=function(){function e(){Ce(this,e),ne(this,"cache",void 0),ne(this,"keys",void 0),ne(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Pe(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={map:this.cache};return e.forEach((function(e){var t;i?i=null===(t=i)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e):i=void 0})),null!==(t=i)&&void 0!==t&&t.value&&r&&(i.value[1]=this.cacheCallTimes++),null===(n=i)||void 0===n?void 0:n.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var i=this.keys.reduce((function(e,t){var n=Q(e,2)[1];return r.internalGet(t)[1]<n?[t,r.internalGet(t)[1]]:e}),[this.keys[0],this.cacheCallTimes]),a=Q(i,1)[0];this.delete(a)}this.keys.push(t)}var o=this.cache;t.forEach((function(e,i){if(i===t.length-1)o.set(e,{value:[n,r.cacheCallTimes++]});else{var a=o.get(e);a?a.map||(a.map=new Map):o.set(e,{map:new Map}),o=o.get(e).map}}))}},{key:"deleteByPath",value:function(e,t){var n,r=e.get(t[0]);if(1===t.length)return r.map?e.set(t[0],{map:r.map}):e.delete(t[0]),null===(n=r.value)||void 0===n?void 0:n[0];var i=this.deleteByPath(r.map,t.slice(1));return r.map&&0!==r.map.size||r.value||e.delete(t[0]),i}},{key:"delete",value:function(e){if(this.has(e))return this.keys=this.keys.filter((function(t){return!function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,e)})),this.deleteByPath(this.cache,e)}}]),e}();ne(He,"MAX_CACHE_SIZE",20),ne(He,"MAX_CACHE_OFFSET",5);var Ve=0,je=function(){function e(t){Ce(this,e),ne(this,"derivatives",void 0),ne(this,"id",void 0),this.derivatives=Array.isArray(t)?t:[t],this.id=Ve,0===t.length&&t.length,Ve+=1}return Pe(e,[{key:"getDerivativeToken",value:function(e){return this.derivatives.reduce((function(t,n){return n(e,t)}),void 0)}}]),e}(),Ge=new He;function We(e){var t=Array.isArray(e)?e:[e];return Ge.has(t)||Ge.set(t,new je(t)),Ge.get(t)}var Xe=new WeakMap,$e={};var qe=new WeakMap;function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=qe.get(e)||"";return n||(Object.keys(e).forEach((function(r){var i=e[r];n+=r,i instanceof je?n+=i.id:i&&"object"===ee(i)?n+=Ye(i,t):n+=i})),t&&(n=se(n)),qe.set(e,n)),n}function Ke(e,t){return se("".concat(t,"_").concat(Ye(e,!0)))}var Ze=le();function Je(e){return"number"==typeof e?"".concat(e,"px"):e}function Qe(e,t,n){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4])return e;var r=oe(oe({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},ne(ne({},Ne,t),Oe,n)),i=Object.keys(r).map((function(e){var t=r[e];return t?"".concat(e,'="').concat(t,'"'):null})).filter((function(e){return e})).join(" ");return"<style ".concat(i,">").concat(e,"</style>")}var et=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},tt=function(e,t,n){return Object.keys(e).length?".".concat(t).concat(null!=n&&n.scope?".".concat(n.scope):"","{").concat(Object.entries(e).map((function(e){var t=Q(e,2),n=t[0],r=t[1];return"".concat(n,":").concat(r,";")})).join(""),"}"):""},nt=function(e,t,n){var r={},i={};return Object.entries(e).forEach((function(e){var t,a,o=Q(e,2),s=o[0],l=o[1];if(null!=n&&null!==(t=n.preserve)&&void 0!==t&&t[s])i[s]=l;else if(!("string"!=typeof l&&"number"!=typeof l||null!=n&&null!==(a=n.ignore)&&void 0!==a&&a[s])){var c,u=et(s,null==n?void 0:n.prefix);r[u]="number"!=typeof l||null!=n&&null!==(c=n.unitless)&&void 0!==c&&c[s]?String(l):"".concat(l,"px"),i[s]="var(".concat(u,")")}})),[i,tt(r,t,{scope:null==n?void 0:n.scope})]},rt=le()?V.useLayoutEffect:V.useEffect,it=function(e,t){var n=V.useRef(!0);rt((function(){return e(n.current)}),t),rt((function(){return n.current=!1,function(){n.current=!0}}),[])},at=function(e,t){it((function(t){if(!t)return e()}),t)},ot=oe({},G).useInsertionEffect,st=ot?function(e,t,n){return ot((function(){return e(),t()}),n)}:function(e,t,n){V.useMemo(e,n),it((function(){return t(!0)}),n)},lt=void 0!==oe({},G).useInsertionEffect?function(e){var t=[],n=!1;return V.useEffect((function(){return n=!1,function(){n=!0,t.length&&t.forEach((function(e){return e()}))}}),e),function(e){n||t.push(e)}}:function(){return function(e){e()}};function ct(e,t,n,r,i){var a=V.useContext(Ue).cache,o=Le([e].concat(ie(t))),s=lt([o]),l=function(e){a.opUpdate(o,(function(t){var r=Q(t||[void 0,void 0],2),i=r[0],a=[void 0===i?0:i,r[1]||n()];return e?e(a):a}))};V.useMemo((function(){l()}),[o]);var c=a.opGet(o)[1];return st((function(){null==i||i(c)}),(function(e){return l((function(t){var n=Q(t,2),r=n[0],a=n[1];return e&&0===r&&(null==i||i(c)),[r+1,a]})),function(){a.opUpdate(o,(function(t){var n=Q(t||[],2),i=n[0],l=void 0===i?0:i,c=n[1];return 0===l-1?(s((function(){!e&&a.opGet(o)||null==r||r(c,!1)})),null):[l-1,c]}))}}),[o]),c}var ut={},ht=new Map;function dt(e,t){ht.set(e,(ht.get(e)||0)-1);var n=Array.from(ht.keys()),r=n.filter((function(e){return(ht.get(e)||0)<=0}));n.length-r.length>0&&r.forEach((function(e){!function(e,t){"undefined"!=typeof document&&document.querySelectorAll("style[".concat(Ne,'="').concat(e,'"]')).forEach((function(e){var n;e[De]===t&&(null===(n=e.parentNode)||void 0===n||n.removeChild(e))}))}(e,t),ht.delete(e)}))}var ft="token";function pt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=V.useContext(Ue),i=r.cache.instanceId,a=r.container,o=n.salt,s=void 0===o?"":o,l=n.override,c=void 0===l?ut:l,u=n.formatToken,h=n.getComputedToken,d=n.cssVar,f=function(e,t){for(var n=Xe,r=0;r<t.length;r+=1){var i=t[r];n.has(i)||n.set(i,new WeakMap),n=n.get(i)}return n.has($e)||n.set($e,e()),n.get($e)}((function(){return Object.assign.apply(Object,[{}].concat(ie(t)))}),t),p=Ye(f),m=Ye(c),g=d?Ye(d):"",v=ct(ft,[s,e.id,p,m,g],(function(){var t,n=h?h(f,c,e):function(e,t,n,r){var i=oe(oe({},n.getDerivativeToken(e)),t);return r&&(i=r(i)),i}(f,c,e,u),r=oe({},n),i="";if(d){var a=Q(nt(n,d.key,{prefix:d.prefix,ignore:d.ignore,unitless:d.unitless,preserve:d.preserve}),2);n=a[0],i=a[1]}var o=Ke(n,s);n._tokenKey=o,r._tokenKey=Ke(r,s);var l=null!==(t=null==d?void 0:d.key)&&void 0!==t?t:o;n._themeKey=l,function(e){ht.set(e,(ht.get(e)||0)+1)}(l);var p="".concat("css","-").concat(se(o));return n._hashId=p,[n,p,r,i,(null==d?void 0:d.key)||""]}),(function(e){dt(e[0]._themeKey,i)}),(function(e){var t=Q(e,4),n=t[0],r=t[3];if(d&&r){var o=_e(r,se("css-variables-".concat(n._themeKey)),{mark:Oe,prepend:"queue",attachTo:a,priority:-999});o[De]=i,o.setAttribute(Ne,n._themeKey)}}));return v}var mt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gt="comm",vt="rule",yt="decl",_t=Math.abs,bt=String.fromCharCode;function xt(e){return e.trim()}function St(e,t,n){return e.replace(t,n)}function Mt(e,t,n){return e.indexOf(t,n)}function wt(e,t){return 0|e.charCodeAt(t)}function Et(e,t,n){return e.slice(t,n)}function Tt(e){return e.length}function At(e,t){return t.push(e),e}var Ct=1,Rt=1,Pt=0,Lt=0,It=0,Nt="";function Ot(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Ct,column:Rt,length:o,return:"",siblings:s}}function Dt(){return It=Lt<Pt?wt(Nt,Lt++):0,Rt++,10===It&&(Rt=1,Ct++),It}function Ut(){return wt(Nt,Lt)}function kt(){return Lt}function Ft(e,t){return Et(Nt,e,t)}function zt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Bt(e){return xt(Ft(Lt-1,jt(91===e?e+2:40===e?e+1:e)))}function Ht(e){for(;(It=Ut())&&It<33;)Dt();return zt(e)>2||zt(It)>3?"":" "}function Vt(e,t){for(;--t&&Dt()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return Ft(e,kt()+(t<6&&32==Ut()&&32==Dt()))}function jt(e){for(;Dt();)switch(It){case e:return Lt;case 34:case 39:34!==e&&39!==e&&jt(It);break;case 40:41===e&&jt(e);break;case 92:Dt()}return Lt}function Gt(e,t){for(;Dt()&&e+It!==57&&(e+It!==84||47!==Ut()););return"/*"+Ft(t,Lt-1)+"*"+bt(47===e?e:Dt())}function Wt(e){for(;!zt(Ut());)Dt();return Ft(e,Lt)}function Xt(e){return function(e){return Nt="",e}($t("",null,null,null,[""],e=function(e){return Ct=Rt=1,Pt=Tt(Nt=e),Lt=0,[]}(e),0,[0],e))}function $t(e,t,n,r,i,a,o,s,l){for(var c=0,u=0,h=o,d=0,f=0,p=0,m=1,g=1,v=1,y=0,_="",b=i,x=a,S=r,M=_;g;)switch(p=y,y=Dt()){case 40:if(108!=p&&58==wt(M,h-1)){-1!=Mt(M+=St(Bt(y),"&","&\f"),"&\f",_t(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:M+=Bt(y);break;case 9:case 10:case 13:case 32:M+=Ht(p);break;case 92:M+=Vt(kt()-1,7);continue;case 47:switch(Ut()){case 42:case 47:At(Yt(Gt(Dt(),kt()),t,n,l),l),5!=zt(p||1)&&5!=zt(Ut()||1)||!Tt(M)||" "===Et(M,-1,void 0)||(M+=" ");break;default:M+="/"}break;case 123*m:s[c++]=Tt(M)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(M=St(M,/\f/g,"")),f>0&&(Tt(M)-h||0===m&&47===p)&&At(f>32?Kt(M+";",r,n,h-1,l):Kt(St(M," ","")+";",r,n,h-2,l),l);break;case 59:M+=";";default:if(At(S=qt(M,t,n,c,u,i,s,_,b=[],x=[],h,a),a),123===y)if(0===u)$t(M,t,S,S,b,a,h,s,x);else switch(99===d&&110===wt(M,3)?100:d){case 100:case 108:case 109:case 115:$t(e,S,S,r&&At(qt(e,S,S,0,0,i,s,_,i,b=[],h,x),x),i,x,h,s,r?b:x);break;default:$t(M,S,S,S,[""],x,0,s,x)}}c=u=f=0,m=v=1,_=M="",h=o;break;case 58:h=1+Tt(M),f=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==(It=Lt>0?wt(Nt,--Lt):0,Rt--,10===It&&(Rt=1,Ct--),It))continue;switch(M+=bt(y),y*m){case 38:v=u>0?1:(M+="\f",-1);break;case 44:s[c++]=(Tt(M)-1)*v,v=1;break;case 64:45===Ut()&&(M+=Bt(Dt())),d=Ut(),u=h=Tt(_=M+=Wt(kt())),y++;break;case 45:45===p&&2==Tt(M)&&(m=0)}}return a}function qt(e,t,n,r,i,a,o,s,l,c,u,h){for(var d=i-1,f=0===i?a:[""],p=function(e){return e.length}(f),m=0,g=0,v=0;m<r;++m)for(var y=0,_=Et(e,d+1,d=_t(g=o[m])),b=e;y<p;++y)(b=xt(g>0?f[y]+" "+_:St(_,/&\f/g,f[y])))&&(l[v++]=b);return Ot(e,t,n,0===i?vt:s,l,c,u,h)}function Yt(e,t,n,r){return Ot(e,t,n,gt,bt(It),Et(e,2,-2),0,r)}function Kt(e,t,n,r,i){return Ot(e,t,n,yt,Et(e,0,r),Et(e,r+1,-1),r,i)}function Zt(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Jt(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case yt:return e.return=e.return||e.value;case gt:return"";case"@keyframes":return e.return=e.value+"{"+Zt(e.children,r)+"}";case vt:if(!Tt(e.value=e.props.join(",")))return""}return Tt(n=Zt(e.children,r))?e.return=e.value+"{"+n+"}":""}var Qt,en="data-ant-cssinjs-cache-path",tn="_FILE_STYLE__",nn=!0;function rn(e){return function(){if(!Qt&&(Qt={},le())){var e=document.createElement("div");e.className=en,e.style.position="fixed",e.style.visibility="hidden",e.style.top="-9999px",document.body.appendChild(e);var t=getComputedStyle(e).content||"";(t=t.replace(/^"/,"").replace(/"$/,"")).split(";").forEach((function(e){var t=Q(e.split(":"),2),n=t[0],r=t[1];Qt[n]=r}));var n,r=document.querySelector("style[".concat(en,"]"));r&&(nn=!1,null===(n=r.parentNode)||void 0===n||n.removeChild(r)),document.body.removeChild(e)}}(),!!Qt[e]}var an="_multi_value_";function on(e){return Zt(Xt(e),Jt).replace(/\{%%%\:[^;];}/g,";")}function sn(e,t,n){if(!t)return e;var r=".".concat(t),i="low"===n?":where(".concat(r,")"):r;return e.split(",").map((function(e){var t,n=e.trim().split(/\s+/),r=n[0]||"",a=(null===(t=r.match(/^\w+/))||void 0===t?void 0:t[0])||"";return[r="".concat(a).concat(i).concat(r.slice(a.length))].concat(ie(n.slice(1))).join(" ")})).join(",")}var ln=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,a=r.injectHash,o=r.parentSelectors,s=n.hashId,l=n.layer;n.path;var c=n.hashPriority,u=n.transformers,h=void 0===u?[]:u;n.linters;var d="",f={};function p(t){var r=t.getName(s);if(!f[r]){var i=Q(e(t.style,n,{root:!1,parentSelectors:o}),1)[0];f[r]="@keyframes ".concat(t.getName(s)).concat(i)}}var m=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.forEach((function(t){Array.isArray(t)?e(t,n):t&&n.push(t)})),n}(Array.isArray(t)?t:[t]);return m.forEach((function(t){var r="string"!=typeof t||i?t:{};if("string"==typeof r)d+="".concat(r,"\n");else if(r._keyframe)p(r);else{var l=h.reduce((function(e,t){var n;return(null==t||null===(n=t.visit)||void 0===n?void 0:n.call(t,e))||e}),r);Object.keys(l).forEach((function(t){var r=l[t];if("object"!==ee(r)||!r||"animationName"===t&&r._keyframe||function(e){return"object"===ee(e)&&e&&("_skip_check_"in e||an in e)}(r)){let e=function(e,t){var n=e.replace(/[A-Z]/g,(function(e){return"-".concat(e.toLowerCase())})),r=t;mt[e]||"number"!=typeof r||0===r||(r="".concat(r,"px")),"animationName"===e&&null!=t&&t._keyframe&&(p(t),r=t.getName(s)),d+="".concat(n,":").concat(r,";")};var u,h=null!==(u=null==r?void 0:r.value)&&void 0!==u?u:r;"object"===ee(r)&&null!=r&&r[an]&&Array.isArray(h)?h.forEach((function(n){e(t,n)})):e(t,h)}else{var m=!1,g=t.trim(),v=!1;(i||a)&&s?g.startsWith("@")?m=!0:g=sn("&"===g?"":t,s,c):!i||s||"&"!==g&&""!==g||(g="",v=!0);var y=Q(e(r,n,{root:v,injectHash:m,parentSelectors:[].concat(ie(o),[g])}),2),_=y[0],b=y[1];f=oe(oe({},f),b),d+="".concat(g).concat(_)}}))}})),i?l&&(d="@layer ".concat(l.name," {").concat(d,"}"),l.dependencies&&(f["@layer ".concat(l.name)]=l.dependencies.map((function(e){return"@layer ".concat(e,", ").concat(l.name,";")})).join("\n"))):d="{".concat(d,"}"),[d,f]};function cn(e,t){return se("".concat(e.join("%")).concat(t))}function un(){return null}var hn="style";function dn(e,t){var n=e.token,r=e.path,i=e.hashId,a=e.layer,o=e.nonce,s=e.clientOnly,l=e.order,c=void 0===l?0:l,u=V.useContext(Ue),h=u.autoClear;u.mock;var d=u.defaultCache,f=u.hashPriority,p=u.container,m=u.ssrInline,g=u.transformers,v=u.linters,y=u.cache,_=u.layer,b=n._tokenKey,x=[b];_&&x.push("layer"),x.push.apply(x,ie(r));var S=Ze,M=ct(hn,x,(function(){var e=x.join("|");if(rn(e)){var n=function(e){var t=Qt[e],n=null;if(t&&le())if(nn)n=tn;else{var r=document.querySelector("style[".concat(Oe,'="').concat(Qt[e],'"]'));r?n=r.innerHTML:delete Qt[e]}return[n,t]}(e),o=Q(n,2),l=o[0],u=o[1];if(l)return[l,b,u,{},s,c]}var h=t(),d=Q(ln(h,{hashId:i,hashPriority:f,layer:_?a:void 0,path:r.join("-"),transformers:g,linters:v}),2),p=d[0],m=d[1],y=on(p),S=cn(x,y);return[y,b,S,m,s,c]}),(function(e,t){var n=Q(e,3)[2];(t||h)&&Ze&&ye(n,{mark:Oe})}),(function(e){var t=Q(e,4),n=t[0];t[1];var r=t[2],i=t[3];if(S&&n!==tn){var a={mark:Oe,prepend:!_&&"queue",attachTo:p,priority:c},s="function"==typeof o?o():o;s&&(a.csp={nonce:s});var l=[],u=[];Object.keys(i).forEach((function(e){e.startsWith("@layer")?l.push(e):u.push(e)})),l.forEach((function(e){_e(on(i[e]),"_layer-".concat(e),oe(oe({},a),{},{prepend:!0}))}));var h=_e(n,r,a);h[De]=y.instanceId,h.setAttribute(Ne,b),u.forEach((function(e){_e(on(i[e]),"_effect-".concat(e),a)}))}})),w=Q(M,3),E=w[0],T=w[1],A=w[2];return function(e){var t;return t=m&&!S&&d?V.createElement("style",W({},ne(ne({},Ne,T),Oe,A),{dangerouslySetInnerHTML:{__html:E}})):V.createElement(un,null),V.createElement(V.Fragment,null,t,e)}}var fn="cssVar";ne(ne(ne({},hn,(function(e,t,n){var r=Q(e,6),i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],c=r[5],u=(n||{}).plain;if(l)return null;var h=i,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(c)};return h=Qe(i,a,o,d,u),s&&Object.keys(s).forEach((function(e){if(!t[e]){t[e]=!0;var n=Qe(on(s[e]),a,"_effect-".concat(e),d,u);e.startsWith("@layer")?h=n+h:h+=n}})),[c,o,h]})),ft,(function(e,t,n){var r=Q(e,5),i=r[2],a=r[3],o=r[4],s=(n||{}).plain;if(!a)return null;var l=i._tokenKey;return[-999,l,Qe(a,o,l,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]})),fn,(function(e,t,n){var r=Q(e,4),i=r[1],a=r[2],o=r[3],s=(n||{}).plain;if(!i)return null;return[-999,a,Qe(i,o,a,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]}));var pn=function(){function e(t,n){Ce(this,e),ne(this,"name",void 0),ne(this,"style",void 0),ne(this,"_keyframe",!0),this.name=t,this.style=n}return Pe(e,[{key:"getName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?"".concat(e,"-").concat(this.name):this.name}}]),e}();function mn(e){return e.notSplit=!0,e}mn(["borderTop","borderBottom"]),mn(["borderTop"]),mn(["borderBottom"]),mn(["borderLeft","borderRight"]),mn(["borderLeft"]),mn(["borderRight"]);const gn={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},vn=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}},yn=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),_n=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),bn=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),xn=e=>({outline:`${Je(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),Sn=e=>({"&:focus-visible":Object.assign({},xn(e))}),Mn=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none"},Sn(e)),{"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}});var wn=Pe((function e(){Ce(this,e)})),En="CALC_UNIT",Tn=new RegExp(En,"g");function An(e){return"number"==typeof e?"".concat(e).concat(En):e}var Cn=function(){ke(t,wn);var e=Be(t);function t(n,r){var i;Ce(this,t),ne($(i=e.call(this)),"result",""),ne($(i),"unitlessCssVar",void 0),ne($(i),"lowPriority",void 0);var a=ee(n);return i.unitlessCssVar=r,n instanceof t?i.result="(".concat(n.result,")"):"number"===a?i.result=An(n):"string"===a&&(i.result=n),i}return Pe(t,[{key:"add",value:function(e){return e instanceof t?this.result="".concat(this.result," + ").concat(e.getResult()):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," + ").concat(An(e))),this.lowPriority=!0,this}},{key:"sub",value:function(e){return e instanceof t?this.result="".concat(this.result," - ").concat(e.getResult()):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," - ").concat(An(e))),this.lowPriority=!0,this}},{key:"mul",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," * ").concat(e.getResult(!0)):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," * ").concat(e)),this.lowPriority=!1,this}},{key:"div",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof t?this.result="".concat(this.result," / ").concat(e.getResult(!0)):"number"!=typeof e&&"string"!=typeof e||(this.result="".concat(this.result," / ").concat(e)),this.lowPriority=!1,this}},{key:"getResult",value:function(e){return this.lowPriority||e?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(e){var t=this,n=(e||{}).unit,r=!0;return"boolean"==typeof n?r=n:Array.from(this.unitlessCssVar).some((function(e){return t.result.includes(e)}))&&(r=!1),this.result=this.result.replace(Tn,r?"px":""),void 0!==this.lowPriority?"calc(".concat(this.result,")"):this.result}}]),t}(),Rn=function(){ke(t,wn);var e=Be(t);function t(n){var r;return Ce(this,t),ne($(r=e.call(this)),"result",0),n instanceof t?r.result=n.result:"number"==typeof n&&(r.result=n),r}return Pe(t,[{key:"add",value:function(e){return e instanceof t?this.result+=e.result:"number"==typeof e&&(this.result+=e),this}},{key:"sub",value:function(e){return e instanceof t?this.result-=e.result:"number"==typeof e&&(this.result-=e),this}},{key:"mul",value:function(e){return e instanceof t?this.result*=e.result:"number"==typeof e&&(this.result*=e),this}},{key:"div",value:function(e){return e instanceof t?this.result/=e.result:"number"==typeof e&&(this.result/=e),this}},{key:"equal",value:function(){return this.result}}]),t}(),Pn=function(e,t){return"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function Ln(e){var t=V.useRef();t.current=e;var n=V.useCallback((function(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return null===(e=t.current)||void 0===e?void 0:e.call.apply(e,[t].concat(r))}),[]);return n}function In(e){var t=V.useRef(!1),n=Q(V.useState(e),2),r=n[0],i=n[1];return V.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[r,function(e,n){n&&t.current||i(e)}]}var Nn,On={exports:{}},Dn={},Un=Symbol.for("react.element"),kn=Symbol.for("react.portal"),Fn=Symbol.for("react.fragment"),zn=Symbol.for("react.strict_mode"),Bn=Symbol.for("react.profiler"),Hn=Symbol.for("react.provider"),Vn=Symbol.for("react.context"),jn=Symbol.for("react.server_context"),Gn=Symbol.for("react.forward_ref"),Wn=Symbol.for("react.suspense"),Xn=Symbol.for("react.suspense_list"),$n=Symbol.for("react.memo"),qn=Symbol.for("react.lazy"),Yn=Symbol.for("react.offscreen");function Kn(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Un:switch(e=e.type){case Fn:case Bn:case zn:case Wn:case Xn:return e;default:switch(e=e&&e.$$typeof){case jn:case Vn:case Gn:case qn:case $n:case Hn:return e;default:return t}}case kn:return t}}}Nn=Symbol.for("react.module.reference"),Dn.ContextConsumer=Vn,Dn.ContextProvider=Hn,Dn.Element=Un,Dn.ForwardRef=Gn,Dn.Fragment=Fn,Dn.Lazy=qn,Dn.Memo=$n,Dn.Portal=kn,Dn.Profiler=Bn,Dn.StrictMode=zn,Dn.Suspense=Wn,Dn.SuspenseList=Xn,Dn.isAsyncMode=function(){return!1},Dn.isConcurrentMode=function(){return!1},Dn.isContextConsumer=function(e){return Kn(e)===Vn},Dn.isContextProvider=function(e){return Kn(e)===Hn},Dn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Un},Dn.isForwardRef=function(e){return Kn(e)===Gn},Dn.isFragment=function(e){return Kn(e)===Fn},Dn.isLazy=function(e){return Kn(e)===qn},Dn.isMemo=function(e){return Kn(e)===$n},Dn.isPortal=function(e){return Kn(e)===kn},Dn.isProfiler=function(e){return Kn(e)===Bn},Dn.isStrictMode=function(e){return Kn(e)===zn},Dn.isSuspense=function(e){return Kn(e)===Wn},Dn.isSuspenseList=function(e){return Kn(e)===Xn},Dn.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===Fn||e===Bn||e===zn||e===Wn||e===Xn||e===Yn||"object"==typeof e&&null!==e&&(e.$$typeof===qn||e.$$typeof===$n||e.$$typeof===Hn||e.$$typeof===Vn||e.$$typeof===Gn||e.$$typeof===Nn||void 0!==e.getModuleId)},Dn.typeOf=Kn,On.exports=Dn;var Zn=On.exports,Jn=function(e,t){"function"==typeof e?e(t):"object"===ee(e)&&e&&"current"in e&&(e.current=t)},Qn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(Boolean);return r.length<=1?r[0]:function(e){t.forEach((function(t){Jn(t,e)}))}},er=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return xe((function(){return Qn.apply(void 0,t)}),t,(function(e,t){return e.length!==t.length||e.every((function(e,n){return e!==t[n]}))}))},tr=function(e){var t,n,r=Zn.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===Zn.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===Zn.ForwardRef)};function nr(e){return V.isValidElement(e)&&!Zn.isFragment(e)}var rr=function(e){return nr(e)&&tr(e)};function ir(e,t){for(var n=e,r=0;r<t.length;r+=1){if(null==n)return;n=n[t[r]]}return n}function ar(e){return Y(e)||re(e)||Z(e)||J()}function or(e,t,n,r){if(!t.length)return n;var i,a=ar(t),o=a[0],s=a.slice(1);return i=e||"number"!=typeof o?Array.isArray(e)?ie(e):oe({},e):[],r&&void 0===n&&1===s.length?delete i[o][s[0]]:i[o]=or(i[o],s,n,r),i}function sr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.length&&r&&void 0===n&&!ir(e,t.slice(0,-1))?e:or(e,t,n,r)}function lr(e){return Array.isArray(e)?[]:{}}Number(V.version.split(".")[0]);var cr="undefined"==typeof Reflect?Object.keys:Reflect.ownKeys;function ur(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=lr(t[0]);return t.forEach((function(e){!function t(n,i){var a,o=new Set(i),s=ir(e,n),l=Array.isArray(s);if(l||"object"===ee(a=s)&&null!==a&&Object.getPrototypeOf(a)===Object.prototype){if(!o.has(s)){o.add(s);var c=ir(r,n);l?r=sr(r,n,[]):c&&"object"===ee(c)||(r=sr(r,n,lr(s))),cr(s).forEach((function(e){t([].concat(ie(n),[e]),o)}))}}else r=sr(r,n,s)}([])})),r}function hr(e,t,n,r){var i=oe({},t[e]);null!=r&&r.deprecatedTokens&&r.deprecatedTokens.forEach((function(e){var t,n=Q(e,2),r=n[0],a=n[1];(null!=i&&i[r]||null!=i&&i[a])&&(null!==(t=i[a])&&void 0!==t||(i[a]=null==i?void 0:i[r]))}));var a=oe(oe({},n),i);return Object.keys(a).forEach((function(e){a[e]===t[e]&&delete a[e]})),a}var dr="undefined"!=typeof CSSINJS_STATISTIC,fr=!0;function pr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!dr)return Object.assign.apply(Object,[{}].concat(t));fr=!1;var r={};return t.forEach((function(e){"object"===ee(e)&&Object.keys(e).forEach((function(t){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return e[t]}})}))})),fr=!0,r}var mr={};function gr(){}function vr(e,t,n){var r;return"function"==typeof n?n(pr(t,null!==(r=t[e])&&void 0!==r?r:{})):null!=n?n:{}}var yr=function(){function e(){Ce(this,e),ne(this,"map",new Map),ne(this,"objectIDMap",new WeakMap),ne(this,"nextID",0),ne(this,"lastAccessBeat",new Map),ne(this,"accessBeat",0)}return Pe(e,[{key:"set",value:function(e,t){this.clear();var n=this.getCompositeKey(e);this.map.set(n,t),this.lastAccessBeat.set(n,Date.now())}},{key:"get",value:function(e){var t=this.getCompositeKey(e),n=this.map.get(t);return this.lastAccessBeat.set(t,Date.now()),this.accessBeat+=1,n}},{key:"getCompositeKey",value:function(e){var t=this;return e.map((function(e){return e&&"object"===ee(e)?"obj_".concat(t.getObjectID(e)):"".concat(ee(e),"_").concat(e)})).join("|")}},{key:"getObjectID",value:function(e){if(this.objectIDMap.has(e))return this.objectIDMap.get(e);var t=this.nextID;return this.objectIDMap.set(e,t),this.nextID+=1,t}},{key:"clear",value:function(){var e=this;if(this.accessBeat>1e4){var t=Date.now();this.lastAccessBeat.forEach((function(n,r){t-n>6e5&&(e.map.delete(r),e.lastAccessBeat.delete(r))})),this.accessBeat=0}}}]),e}(),_r=new yr;var br=function(){return{}};function xr(e){return(e+8)/e}function Sr(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function Mr(e){return Math.min(1,Math.max(0,e))}function wr(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Er(e){return e<=1?"".concat(100*Number(e),"%"):e}function Tr(e){return 1===e.length?"0"+e:String(e)}function Ar(e,t,n){e=Sr(e,255),t=Sr(t,255),n=Sr(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=0,s=(r+i)/2;if(r===i)o=0,a=0;else{var l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4}a/=6}return{h:a,s:o,l:s}}function Cr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Rr(e,t,n){e=Sr(e,255),t=Sr(t,255),n=Sr(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,l=0===r?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}a/=6}return{h:a,s:l,v:o}}function Pr(e,t,n,r){var i=[Tr(Math.round(e).toString(16)),Tr(Math.round(t).toString(16)),Tr(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Lr(e){return Ir(e)/255}function Ir(e){return parseInt(e,16)}var Nr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Or(e){var t,n,r,i={r:0,g:0,b:0},a=1,o=null,s=null,l=null,c=!1,u=!1;return"string"==typeof e&&(e=function(e){if(e=e.trim().toLowerCase(),0===e.length)return!1;var t=!1;if(Nr[e])e=Nr[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=Fr.rgb.exec(e);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=Fr.rgba.exec(e),n)return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=Fr.hsl.exec(e),n)return{h:n[1],s:n[2],l:n[3]};if(n=Fr.hsla.exec(e),n)return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=Fr.hsv.exec(e),n)return{h:n[1],s:n[2],v:n[3]};if(n=Fr.hsva.exec(e),n)return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=Fr.hex8.exec(e),n)return{r:Ir(n[1]),g:Ir(n[2]),b:Ir(n[3]),a:Lr(n[4]),format:t?"name":"hex8"};if(n=Fr.hex6.exec(e),n)return{r:Ir(n[1]),g:Ir(n[2]),b:Ir(n[3]),format:t?"name":"hex"};if(n=Fr.hex4.exec(e),n)return{r:Ir(n[1]+n[1]),g:Ir(n[2]+n[2]),b:Ir(n[3]+n[3]),a:Lr(n[4]+n[4]),format:t?"name":"hex8"};if(n=Fr.hex3.exec(e),n)return{r:Ir(n[1]+n[1]),g:Ir(n[2]+n[2]),b:Ir(n[3]+n[3]),format:t?"name":"hex"};return!1}(e)),"object"==typeof e&&(zr(e.r)&&zr(e.g)&&zr(e.b)?(t=e.r,n=e.g,r=e.b,i={r:255*Sr(t,255),g:255*Sr(n,255),b:255*Sr(r,255)},c=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):zr(e.h)&&zr(e.s)&&zr(e.v)?(o=Er(e.s),s=Er(e.v),i=function(e,t,n){e=6*Sr(e,360),t=Sr(t,100),n=Sr(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),l=r%6;return{r:255*[n,o,a,a,s,n][l],g:255*[s,n,n,o,a,a][l],b:255*[a,a,s,n,n,o][l]}}(e.h,o,s),c=!0,u="hsv"):zr(e.h)&&zr(e.s)&&zr(e.l)&&(o=Er(e.s),l=Er(e.l),i=function(e,t,n){var r,i,a;if(e=Sr(e,360),t=Sr(t,100),n=Sr(n,100),0===t)i=n,a=n,r=n;else{var o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=Cr(s,o,e+1/3),i=Cr(s,o,e),a=Cr(s,o,e-1/3)}return{r:255*r,g:255*i,b:255*a}}(e.h,o,l),c=!0,u="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(a=e.a)),a=wr(a),{ok:c,format:e.format||u,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:a}}var Dr="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),Ur="[\\s|\\(]+(".concat(Dr,")[,|\\s]+(").concat(Dr,")[,|\\s]+(").concat(Dr,")\\s*\\)?"),kr="[\\s|\\(]+(".concat(Dr,")[,|\\s]+(").concat(Dr,")[,|\\s]+(").concat(Dr,")[,|\\s]+(").concat(Dr,")\\s*\\)?"),Fr={CSS_UNIT:new RegExp(Dr),rgb:new RegExp("rgb"+Ur),rgba:new RegExp("rgba"+kr),hsl:new RegExp("hsl"+Ur),hsla:new RegExp("hsla"+kr),hsv:new RegExp("hsv"+Ur),hsva:new RegExp("hsva"+kr),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function zr(e){return Boolean(Fr.CSS_UNIT.exec(String(e)))}var Br=function(){function e(t,n){var r;if(void 0===t&&(t=""),void 0===n&&(n={}),t instanceof e)return t;"number"==typeof t&&(t=function(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var i=Or(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=wr(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=Rr(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=Rr(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=Ar(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=Ar(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Pr(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,r,i){var a,o=[Tr(Math.round(e).toString(16)),Tr(Math.round(t).toString(16)),Tr(Math.round(n).toString(16)),Tr((a=r,Math.round(255*parseFloat(a)).toString(16)))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*Sr(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*Sr(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Pr(this.r,this.g,this.b,!1),t=0,n=Object.entries(Nr);t<n.length;t++){var r=n[t],i=r[0];if(e===r[1])return i}return!1},e.prototype.toString=function(e){var t=Boolean(e);e=null!=e?e:this.format;var n=!1,r=this.a<1&&this.a>=0;return t||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Mr(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Mr(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Mr(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Mr(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),a=n/100;return new e({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],a=360/t,o=1;o<t;o++)i.push(new e({h:(r+o*a)%360,s:n.s,l:n.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}(),Hr=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Vr(e){var t=Rr(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function jr(e){var t=e.r,n=e.g,r=e.b;return"#".concat(Pr(t,n,r,!1))}function Gr(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function Wr(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function Xr(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function $r(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Or(e),i=5;i>0;i-=1){var a=Vr(r),o=jr(Or({h:Gr(a,i,!0),s:Wr(a,i,!0),v:Xr(a,i,!0)}));n.push(o)}n.push(jr(r));for(var s=1;s<=4;s+=1){var l=Vr(r),c=jr(Or({h:Gr(l,s),s:Wr(l,s),v:Xr(l,s)}));n.push(c)}return"dark"===t.theme?Hr.map((function(e){var r,i,a,o=e.index,s=e.opacity;return jr((r=Or(t.backgroundColor||"#141414"),i=Or(n[o]),a=100*s/100,{r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b}))})):n}var qr={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Yr=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];Yr.primary=Yr[5];var Kr=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];Kr.primary=Kr[5];var Zr=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];Zr.primary=Zr[5];var Jr=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];Jr.primary=Jr[5];var Qr=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];Qr.primary=Qr[5];var ei=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];ei.primary=ei[5];var ti=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];ti.primary=ti[5];var ni=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];ni.primary=ni[5];var ri=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];ri.primary=ri[5];var ii=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];ii.primary=ii[5];var ai=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];ai.primary=ai[5];var oi=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];oi.primary=oi[5];var si=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];si.primary=si[5];var li={red:Yr,volcano:Kr,orange:Zr,gold:Jr,yellow:Qr,lime:ei,green:ti,cyan:ni,blue:ri,geekblue:ii,purple:ai,magenta:oi,grey:si};const ci={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},ui=Object.assign(Object.assign({},ci),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'",fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});const hi=e=>{const t=function(e){const t=new Array(10).fill(null).map(((t,n)=>{const r=n-1,i=e*Math.pow(Math.E,r/5),a=n>1?Math.floor(i):Math.ceil(i);return 2*Math.floor(a/2)}));return t[1]=e,t.map((e=>({size:e,lineHeight:xr(e)})))}(e),n=t.map((e=>e.size)),r=t.map((e=>e.lineHeight)),i=n[1],a=n[0],o=n[2],s=r[1],l=r[0],c=r[2];return{fontSizeSM:a,fontSize:i,fontSizeLG:o,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:s,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(s*i),fontHeightLG:Math.round(c*o),fontHeightSM:Math.round(l*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};const di=(e,t)=>new Br(e).setAlpha(t).toRgbString(),fi=(e,t)=>new Br(e).darken(t).toHexString(),pi=e=>{const t=$r(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},mi=(e,t)=>{const n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:di(r,.88),colorTextSecondary:di(r,.65),colorTextTertiary:di(r,.45),colorTextQuaternary:di(r,.25),colorFill:di(r,.15),colorFillSecondary:di(r,.06),colorFillTertiary:di(r,.04),colorFillQuaternary:di(r,.02),colorBgSolid:di(r,1),colorBgSolidHover:di(r,.75),colorBgSolidActive:di(r,.95),colorBgLayout:fi(n,4),colorBgContainer:fi(n,0),colorBgElevated:fi(n,0),colorBgSpotlight:di(r,.85),colorBgBlur:"transparent",colorBorder:fi(n,15),colorBorderSecondary:fi(n,6)}};const gi=We((function(e){qr.pink=qr.magenta,li.pink=li.magenta;const t=Object.keys(ci).map((t=>{const n=e[t]===qr[t]?li[t]:$r(e[t]);return new Array(10).fill(1).reduce(((e,r,i)=>(e[`${t}-${i+1}`]=n[i],e[`${t}${i+1}`]=n[i],e)),{})})).reduce(((e,t)=>e=Object.assign(Object.assign({},e),t)),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),function(e,t){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=t;const{colorSuccess:i,colorWarning:a,colorError:o,colorInfo:s,colorPrimary:l,colorBgBase:c,colorTextBase:u}=e,h=n(l),d=n(i),f=n(a),p=n(o),m=n(s),g=r(c,u),v=n(e.colorLink||e.colorInfo),y=new Br(p[1]).mix(new Br(p[3]),50).toHexString();return Object.assign(Object.assign({},g),{colorPrimaryBg:h[1],colorPrimaryBgHover:h[2],colorPrimaryBorder:h[3],colorPrimaryBorderHover:h[4],colorPrimaryHover:h[5],colorPrimary:h[6],colorPrimaryActive:h[7],colorPrimaryTextHover:h[8],colorPrimaryText:h[9],colorPrimaryTextActive:h[10],colorSuccessBg:d[1],colorSuccessBgHover:d[2],colorSuccessBorder:d[3],colorSuccessBorderHover:d[4],colorSuccessHover:d[4],colorSuccess:d[6],colorSuccessActive:d[7],colorSuccessTextHover:d[8],colorSuccessText:d[9],colorSuccessTextActive:d[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBgFilledHover:y,colorErrorBgActive:p[3],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:m[1],colorInfoBgHover:m[2],colorInfoBorder:m[3],colorInfoBorderHover:m[4],colorInfoHover:m[4],colorInfo:m[6],colorInfoActive:m[7],colorInfoTextHover:m[8],colorInfoText:m[9],colorInfoTextActive:m[10],colorLinkHover:v[4],colorLink:v[6],colorLinkActive:v[7],colorBgMask:new Br("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}(e,{generateColorPalettes:pi,generateNeutralColorPalettes:mi})),hi(e.fontSize)),function(e){const{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}(e)),(e=>{const{controlHeight:t}=e;return{controlHeightSM:.75*t,controlHeightXS:.5*t,controlHeightLG:1.25*t}})(e)),function(e){const{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:i}=e;return Object.assign({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+2*t).toFixed(1)}s`,motionDurationSlow:`${(n+3*t).toFixed(1)}s`,lineWidthBold:i+1},(e=>{let t=e,n=e,r=e,i=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?i=4:e>=8&&(i=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:i}})(r))}(e))})),vi={token:ui,override:{override:ui},hashed:!0},yi=j.createContext(vi);function _i(e){return e>=0&&e<=255}function bi(e,t){const{r:n,g:r,b:i,a:a}=new Br(e).toRgb();if(a<1)return e;const{r:o,g:s,b:l}=new Br(t).toRgb();for(let c=.01;c<=1;c+=.01){const e=Math.round((n-o*(1-c))/c),t=Math.round((r-s*(1-c))/c),a=Math.round((i-l*(1-c))/c);if(_i(e)&&_i(t)&&_i(a))return new Br({r:e,g:t,b:a,a:Math.round(100*c)/100}).toRgbString()}return new Br({r:n,g:r,b:i,a:1}).toRgbString()}function xi(e){const{override:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["override"]),r=Object.assign({},t);Object.keys(ui).forEach((e=>{delete r[e]}));const i=Object.assign(Object.assign({},n),r),a=1200,o=1600;if(!1===i.motion){const e="0s";i.motionDurationFast=e,i.motionDurationMid=e,i.motionDurationSlow=e}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:bi(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:bi(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:bi(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:3*i.lineWidth,lineWidth:i.lineWidth,controlOutlineWidth:2*i.lineWidth,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:bi(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:"\n      0 6px 16px 0 rgba(0, 0, 0, 0.08),\n      0 3px 6px -4px rgba(0, 0, 0, 0.12),\n      0 9px 28px 8px rgba(0, 0, 0, 0.05)\n    ",boxShadowSecondary:"\n      0 6px 16px 0 rgba(0, 0, 0, 0.08),\n      0 3px 6px -4px rgba(0, 0, 0, 0.12),\n      0 9px 28px 8px rgba(0, 0, 0, 0.05)\n    ",boxShadowTertiary:"\n      0 1px 2px 0 rgba(0, 0, 0, 0.03),\n      0 1px 6px -1px rgba(0, 0, 0, 0.02),\n      0 2px 4px 0 rgba(0, 0, 0, 0.02)\n    ",screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:a,screenXLMin:a,screenXLMax:1599,screenXXL:o,screenXXLMin:o,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`\n      0 1px 2px -2px ${new Br("rgba(0, 0, 0, 0.16)").toRgbString()},\n      0 3px 6px 0 ${new Br("rgba(0, 0, 0, 0.12)").toRgbString()},\n      0 5px 12px 4px ${new Br("rgba(0, 0, 0, 0.09)").toRgbString()}\n    `,boxShadowDrawerRight:"\n      -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n      -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n      -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n    ",boxShadowDrawerLeft:"\n      6px 0 16px 0 rgba(0, 0, 0, 0.08),\n      3px 0 6px -4px rgba(0, 0, 0, 0.12),\n      9px 0 28px 8px rgba(0, 0, 0, 0.05)\n    ",boxShadowDrawerUp:"\n      0 6px 16px 0 rgba(0, 0, 0, 0.08),\n      0 3px 6px -4px rgba(0, 0, 0, 0.12),\n      0 9px 28px 8px rgba(0, 0, 0, 0.05)\n    ",boxShadowDrawerDown:"\n      0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n      0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n      0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n    ",boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var Si=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Mi={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},wi={size:!0,sizeSM:!0,sizeLG:!0,sizeMD:!0,sizeXS:!0,sizeXXS:!0,sizeMS:!0,sizeXL:!0,sizeXXL:!0,sizeUnit:!0,sizeStep:!0,motionBase:!0,motionUnit:!0},Ei={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},Ti=(e,t,n)=>{const r=n.getDerivativeToken(e),{override:i}=t,a=Si(t,["override"]);let o=Object.assign(Object.assign({},r),{override:i});return o=xi(o),a&&Object.entries(a).forEach((e=>{let[t,n]=e;const{theme:r}=n,i=Si(n,["theme"]);let a=i;r&&(a=Ti(Object.assign(Object.assign({},o),i),{override:i},r)),o[t]=a})),o};function Ai(){const{token:e,hashed:t,theme:n,override:r,cssVar:i}=j.useContext(yi),a=`5.21.2-${t||""}`,o=n||gi,[s,l,c]=pt(o,[ui,e],{salt:a,override:r,getComputedToken:Ti,formatToken:xi,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:Mi,ignore:wi,preserve:Ei}});return[o,c,t?l:"",s,i]}const Ci="ant",Ri="anticon",Pi=["outlined","borderless","filled"],Li=V.createContext({getPrefixCls:(e,t)=>t||(e?`${Ci}-${e}`:Ci),iconPrefixCls:Ri}),Ii=(e,t)=>{const[n,r]=Ai();return dn({theme:n,token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce,layer:{name:"antd"}},(()=>[{[`.${e}`]:Object.assign(Object.assign({},{display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),{[`.${e} .${e}-icon`]:{display:"block"}})}]))},{genStyleHooks:Ni,genComponentStyleHook:Oi,genSubStyleComponent:Di}=function(e){var t=e.useCSP,n=void 0===t?br:t,r=e.useToken,i=e.usePrefix,a=e.getResetStyles,o=e.getCommonStyle,s=e.getCompUnitless;function l(t,s,l){var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=Array.isArray(t)?t:[t,t],h=Q(u,1)[0],d=u.join("-"),f=e.layer||{name:"antd"};return function(e){var t,u,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,m=r(),g=m.theme,v=m.realToken,y=m.hashId,_=m.token,b=m.cssVar,x=i(),S=x.rootPrefixCls,M=x.iconPrefixCls,w=n(),E=b?"css":"js",T=(t=function(){var e=new Set;return b&&Object.keys(c.unitless||{}).forEach((function(t){e.add(et(t,b.prefix)),e.add(et(t,Pn(h,b.prefix)))})),function(e,t){var n="css"===e?Cn:Rn;return function(e){return new n(e,t)}}(E,e)},u=[E,h,null==b?void 0:b.prefix],j.useMemo((function(){var e=_r.get(u);if(e)return e;var n=t();return _r.set(u,n),n}),u)),A=function(e){return"js"===e?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"max(".concat(t.map((function(e){return Je(e)})).join(","),")")},min:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"min(".concat(t.map((function(e){return Je(e)})).join(","),")")}}}(E),C=A.max,R=A.min,P={theme:g,token:_,hashId:y,nonce:function(){return w.nonce},clientOnly:c.clientOnly,layer:f,order:c.order||-999};dn(oe(oe({},P),{},{clientOnly:!1,path:["Shared",S]}),(function(){return"function"==typeof a?a(_):[]}));var L=dn(oe(oe({},P),{},{path:[d,e,M]}),(function(){if(!1===c.injectStyle)return[];var t=function(e){var t,n=e,r=gr;return dr&&"undefined"!=typeof Proxy&&(t=new Set,n=new Proxy(e,{get:function(e,n){var r;return fr&&(null===(r=t)||void 0===r||r.add(n)),e[n]}}),r=function(e,n){var r;mr[e]={global:Array.from(t),component:oe(oe({},null===(r=mr[e])||void 0===r?void 0:r.component),n)}}),{token:n,keys:t,flush:r}}(_),n=t.token,r=t.flush,i=vr(h,v,l),a=".".concat(e),u=hr(h,v,i,{deprecatedTokens:c.deprecatedTokens});b&&i&&"object"===ee(i)&&Object.keys(i).forEach((function(e){i[e]="var(".concat(et(e,Pn(h,b.prefix)),")")}));var d=pr(n,{componentCls:a,prefixCls:e,iconCls:".".concat(M),antCls:".".concat(S),calc:T,max:C,min:R},b?i:u),f=s(d,{hashId:y,prefixCls:e,rootPrefixCls:S,iconPrefixCls:M});r(h,u);var m="function"==typeof o?o(d,e,p,c.resetFont):null;return[!1===c.resetStyle?null:m,f]}));return[L,y]}}return{genStyleHooks:function(e,t,n,i){var a=Array.isArray(e)?e[0]:e;function o(e){return"".concat(String(a)).concat(e.slice(0,1).toUpperCase()).concat(e.slice(1))}var c=(null==i?void 0:i.unitless)||{},u=oe(oe({},"function"==typeof s?s(e):{}),{},ne({},o("zIndexPopup"),!0));Object.keys(c).forEach((function(e){u[o(e)]=c[e]}));var h=oe(oe({},i),{},{unitless:u,prefixToken:o}),d=l(e,t,n,h),f=function(e,t,n){var i=n.unitless,a=n.injectStyle,o=void 0===a||a,s=n.prefixToken,l=n.ignore,c=function(a){var o=a.rootCls,c=a.cssVar,u=void 0===c?{}:c,h=r().realToken;return function(e,t){var n=e.key,r=e.prefix,i=e.unitless,a=e.ignore,o=e.token,s=e.scope,l=void 0===s?"":s,c=V.useContext(Ue),u=c.cache.instanceId,h=c.container,d=o._tokenKey,f=[].concat(ie(e.path),[n,l,d]);ct(fn,f,(function(){var e=t(),o=Q(nt(e,n,{prefix:r,unitless:i,ignore:a,scope:l}),2),s=o[0],c=o[1];return[s,c,cn(f,c),n]}),(function(e){var t=Q(e,3)[2];Ze&&ye(t,{mark:Oe})}),(function(e){var t=Q(e,3),r=t[1],i=t[2];if(r){var a=_e(r,i,{mark:Oe,prepend:"queue",attachTo:h,priority:-999});a[De]=u,a.setAttribute(Ne,n)}}))}({path:[e],prefix:u.prefix,key:u.key,unitless:i,ignore:l,token:h,scope:o},(function(){var r=vr(e,h,t),i=hr(e,h,r,{deprecatedTokens:null==n?void 0:n.deprecatedTokens});return Object.keys(r).forEach((function(e){i[s(e)]=i[e],delete i[e]})),i})),null},u=function(t){var n=r().cssVar;return[function(r){return o&&n?j.createElement(j.Fragment,null,j.createElement(c,{rootCls:t,cssVar:n,component:e}),r):r},null==n?void 0:n.key]};return u}(a,n,h);return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=Q(d(e,t),2)[1],r=Q(f(t),2);return[r[0],n,r[1]]}},genSubStyleComponent:function(e,t,n){var r=l(e,t,n,oe({resetStyle:!1,order:-998},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}));return function(e){var t=e.prefixCls,n=e.rootCls;return r(t,void 0===n?t:n),null}},genComponentStyleHook:l}}({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=V.useContext(Li);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,n,r,i]=Ai();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:e,iconPrefixCls:t}=V.useContext(Li);return Ii(t,e),null!=e?e:{}},getResetStyles:e=>[{"&":bn(e)}],getCommonStyle:(e,t,n,r)=>{const i=`[class^="${t}"], [class*=" ${t}"]`,a=n?`.${n}`:i,o={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let s={};return!1!==r&&(s={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},s),o),{[i]:o})}},getCompUnitless:()=>Mi});function Ui(){Ui=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(I){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),s=new P(r||[]);return i(o,"_invoke",{value:T(e,n,s)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}t.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function _(){}var b={};c(b,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==n&&r.call(S,o)&&(b=S);var M=_.prototype=v.prototype=Object.create(b);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,o,s){var l=h(e[i],e,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==ee(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(u).then((function(e){c.value=e,o(c)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}})}function T(t,n,r){var i=d;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var l=A(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var c=h(t,n,r);if("normal"===c.type){if(i=r.done?m:f,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=m,r.method="throw",r.arg=c.arg)}}}function A(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=h(i,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ee(t)+" is not iterable")}return y.prototype=_,i(M,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:y,configurable:!0}),y.displayName=c(_,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,l,"GeneratorFunction")),e.prototype=Object.create(M),e},t.awrap=function(e){return{__await:e}},w(E.prototype),c(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(u(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},w(M),c(M,l,"Generator"),c(M,o,(function(){return this})),c(M,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function ki(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function Fi(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){ki(a,r,i,o,s,"next",e)}function s(e){ki(a,r,i,o,s,"throw",e)}o(void 0)}))}}var zi={exports:{}},Bi={},Hi={exports:{}},Vi={};
/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<a&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<a&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){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 l=[],c=[],u=1,h=null,d=3,f=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function b(e){if(m=!1,_(e),!p)if(null!==n(l))p=!0,I(x);else{var t=n(c);null!==t&&N(b,t.startTime-e)}}function x(t,i){p=!1,m&&(m=!1,v(E),E=-1),f=!0;var a=d;try{for(_(i),h=n(l);null!==h&&(!(h.expirationTime>i)||t&&!C());){var o=h.callback;if("function"==typeof o){h.callback=null,d=h.priorityLevel;var s=o(h.expirationTime<=i);i=e.unstable_now(),"function"==typeof s?h.callback=s:h===n(l)&&r(l),_(i)}else r(l);h=n(l)}if(null!==h)var u=!0;else{var g=n(c);null!==g&&N(b,g.startTime-i),u=!1}return u}finally{h=null,d=a,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,M=!1,w=null,E=-1,T=5,A=-1;function C(){return!(e.unstable_now()-A<T)}function R(){if(null!==w){var t=e.unstable_now();A=t;var n=!0;try{n=w(!0,t)}finally{n?S():(M=!1,w=null)}}else M=!1}if("function"==typeof y)S=function(){y(R)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,L=P.port2;P.port1.onmessage=R,S=function(){L.postMessage(null)}}else S=function(){g(R,0)};function I(e){w=e,M||(M=!0,S())}function N(t,n){E=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(){p||f||(p=!0,I(x))},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"):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(d){case 1:case 2:case 3:var t=3;break;default:t=d}var n=d;d=t;try{return e()}finally{d=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=d;d=e;try{return t()}finally{d=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&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 r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(r.sortIndex=a,t(c,r),null===n(l)&&r===n(c)&&(m?(v(E),E=-1):m=!0,N(b,a-o))):(r.sortIndex=s,t(l,r),p||f||(p=!0,I(x))),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=d;return function(){var n=d;d=t;try{return e.apply(this,arguments)}finally{d=n}}}}(Vi),Hi.exports=Vi;var ji=Hi.exports,Gi=V,Wi=ji;
/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */function Xi(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var $i=new Set,qi={};function Yi(e,t){Ki(e,t),Ki(e+"Capture",t)}function Ki(e,t){for(qi[e]=t,e=0;e<t.length;e++)$i.add(t[e])}var Zi=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Ji=Object.prototype.hasOwnProperty,Qi=/^[: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]*$/,ea={},ta={};function na(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var ra={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){ra[e]=new na(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];ra[t]=new na(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){ra[e]=new na(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){ra[e]=new na(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){ra[e]=new na(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){ra[e]=new na(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){ra[e]=new na(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){ra[e]=new na(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){ra[e]=new na(e,5,!1,e.toLowerCase(),null,!1,!1)}));var ia=/[\-:]([a-z])/g;function aa(e){return e[1].toUpperCase()}function oa(e,t,n,r){var i=ra.hasOwnProperty(t)?ra[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!Ji.call(ta,e)||!Ji.call(ea,e)&&(Qi.test(e)?ta[e]=!0:(ea[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(ia,aa);ra[t]=new na(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(ia,aa);ra[t]=new na(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(ia,aa);ra[t]=new na(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){ra[e]=new na(e,1,!1,e.toLowerCase(),null,!1,!1)})),ra.xlinkHref=new na("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){ra[e]=new na(e,1,!1,e.toLowerCase(),null,!0,!0)}));var sa=Gi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,la=Symbol.for("react.element"),ca=Symbol.for("react.portal"),ua=Symbol.for("react.fragment"),ha=Symbol.for("react.strict_mode"),da=Symbol.for("react.profiler"),fa=Symbol.for("react.provider"),pa=Symbol.for("react.context"),ma=Symbol.for("react.forward_ref"),ga=Symbol.for("react.suspense"),va=Symbol.for("react.suspense_list"),ya=Symbol.for("react.memo"),_a=Symbol.for("react.lazy"),ba=Symbol.for("react.offscreen"),xa=Symbol.iterator;function Sa(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=xa&&e[xa]||e["@@iterator"])?e:null}var Ma,wa=Object.assign;function Ea(e){if(void 0===Ma)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ma=t&&t[1]||""}return"\n"+Ma+e}var Ta=!1;function Aa(e,t){if(!e||Ta)return"";Ta=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"==typeof c.stack){for(var i=c.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=o&&0<=s);break}}}finally{Ta=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ea(e):""}function Ca(e){switch(e.tag){case 5:return Ea(e.type);case 16:return Ea("Lazy");case 13:return Ea("Suspense");case 19:return Ea("SuspenseList");case 0:case 2:case 15:return e=Aa(e.type,!1);case 11:return e=Aa(e.type.render,!1);case 1:return e=Aa(e.type,!0);default:return""}}function Ra(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ua:return"Fragment";case ca:return"Portal";case da:return"Profiler";case ha:return"StrictMode";case ga:return"Suspense";case va:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case pa:return(e.displayName||"Context")+".Consumer";case fa:return(e._context.displayName||"Context")+".Provider";case ma:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case ya:return null!==(t=e.displayName||null)?t:Ra(e.type)||"Memo";case _a:t=e._payload,e=e._init;try{return Ra(e(t))}catch(n){}}return null}function Pa(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ra(t);case 8:return t===ha?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function La(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function Ia(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Na(e){e._valueTracker||(e._valueTracker=function(e){var t=Ia(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Oa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ia(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Da(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Ua(e,t){var n=t.checked;return wa({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ka(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=La(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Fa(e,t){null!=(t=t.checked)&&oa(e,"checked",t,!1)}function za(e,t){Fa(e,t);var n=La(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Ha(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ha(e,t.type,La(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Ba(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Ha(e,t,n){"number"===t&&Da(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Va=Array.isArray;function ja(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=""+La(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function Ga(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(Xi(91));return wa({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wa(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(Xi(92));if(Va(n)){if(1<n.length)throw Error(Xi(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:La(n)}}function Xa(e,t){var n=La(t.value),r=La(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function $a(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function qa(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ya(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?qa(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Ka,Za,Ja=(Za=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((Ka=Ka||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ka.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return Za(e,t)}))}:Za);function Qa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var eo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},to=["Webkit","ms","Moz","O"];function no(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||eo.hasOwnProperty(e)&&eo[e]?(""+t).trim():t+"px"}function ro(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=no(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(eo).forEach((function(e){to.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),eo[t]=eo[e]}))}));var io=wa({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ao(e,t){if(t){if(io[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Xi(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Xi(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(Xi(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(Xi(62))}}function oo(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;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 so=null;function lo(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var co=null,uo=null,ho=null;function fo(e){if(e=ou(e)){if("function"!=typeof co)throw Error(Xi(280));var t=e.stateNode;t&&(t=lu(t),co(e.stateNode,e.type,t))}}function po(e){uo?ho?ho.push(e):ho=[e]:uo=e}function mo(){if(uo){var e=uo,t=ho;if(ho=uo=null,fo(e),t)for(e=0;e<t.length;e++)fo(t[e])}}function go(e,t){return e(t)}function vo(){}var yo=!1;function _o(e,t,n){if(yo)return e(t,n);yo=!0;try{return go(e,t,n)}finally{yo=!1,(null!==uo||null!==ho)&&(vo(),mo())}}function bo(e,t){var n=e.stateNode;if(null===n)return null;var r=lu(n);if(null===r)return null;n=r[t];e: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)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Xi(231,t,typeof n));return n}var xo=!1;if(Zi)try{var So={};Object.defineProperty(So,"passive",{get:function(){xo=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch(Za){xo=!1}function Mo(e,t,n,r,i,a,o,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var wo=!1,Eo=null,To=!1,Ao=null,Co={onError:function(e){wo=!0,Eo=e}};function Ro(e,t,n,r,i,a,o,s,l){wo=!1,Eo=null,Mo.apply(Co,arguments)}function Po(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Lo(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Io(e){if(Po(e)!==e)throw Error(Xi(188))}function No(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Po(e)))throw Error(Xi(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Io(i),e;if(a===r)return Io(i),t;a=a.sibling}throw Error(Xi(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o)throw Error(Xi(189))}}if(n.alternate!==r)throw Error(Xi(190))}if(3!==n.tag)throw Error(Xi(188));return n.stateNode.current===n?e:t}(e))?Oo(e):null}function Oo(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Oo(e);if(null!==t)return t;e=e.sibling}return null}var Do=Wi.unstable_scheduleCallback,Uo=Wi.unstable_cancelCallback,ko=Wi.unstable_shouldYield,Fo=Wi.unstable_requestPaint,zo=Wi.unstable_now,Bo=Wi.unstable_getCurrentPriorityLevel,Ho=Wi.unstable_ImmediatePriority,Vo=Wi.unstable_UserBlockingPriority,jo=Wi.unstable_NormalPriority,Go=Wi.unstable_LowPriority,Wo=Wi.unstable_IdlePriority,Xo=null,$o=null;var qo=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(Yo(e)/Ko|0)|0},Yo=Math.log,Ko=Math.LN2;var Zo=64,Jo=4194304;function Qo(e){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: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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function es(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=Qo(s):0!==(a&=o)&&(r=Qo(a))}else 0!==(o=n&~i)?r=Qo(o):0!==a&&(r=Qo(a));if(0===r)return 0;if(0!==t&&t!==r&&!(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&4194240&a))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-qo(t)),r|=e[n],t&=~i;return r}function ts(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8: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;default:return-1}}function ns(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function rs(){var e=Zo;return!(4194240&(Zo<<=1))&&(Zo=64),e}function is(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function as(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-qo(t)]=n}function os(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qo(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ss=0;function ls(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var cs,us,hs,ds,fs,ps=!1,ms=[],gs=null,vs=null,ys=null,_s=new Map,bs=new Map,xs=[],Ss="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 submit".split(" ");function Ms(e,t){switch(e){case"focusin":case"focusout":gs=null;break;case"dragenter":case"dragleave":vs=null;break;case"mouseover":case"mouseout":ys=null;break;case"pointerover":case"pointerout":_s.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bs.delete(t.pointerId)}}function ws(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=ou(t))&&us(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Es(e){var t=au(e.target);if(null!==t){var n=Po(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Lo(n)))return e.blockedOn=t,void fs(e.priority,(function(){hs(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ts(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=ks(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ou(n))&&us(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);so=r,n.target.dispatchEvent(r),so=null,t.shift()}return!0}function As(e,t,n){Ts(e)&&n.delete(t)}function Cs(){ps=!1,null!==gs&&Ts(gs)&&(gs=null),null!==vs&&Ts(vs)&&(vs=null),null!==ys&&Ts(ys)&&(ys=null),_s.forEach(As),bs.forEach(As)}function Rs(e,t){e.blockedOn===t&&(e.blockedOn=null,ps||(ps=!0,Wi.unstable_scheduleCallback(Wi.unstable_NormalPriority,Cs)))}function Ps(e){function t(t){return Rs(t,e)}if(0<ms.length){Rs(ms[0],e);for(var n=1;n<ms.length;n++){var r=ms[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==gs&&Rs(gs,e),null!==vs&&Rs(vs,e),null!==ys&&Rs(ys,e),_s.forEach(t),bs.forEach(t),n=0;n<xs.length;n++)(r=xs[n]).blockedOn===e&&(r.blockedOn=null);for(;0<xs.length&&null===(n=xs[0]).blockedOn;)Es(n),null===n.blockedOn&&xs.shift()}var Ls=sa.ReactCurrentBatchConfig,Is=!0;function Ns(e,t,n,r){var i=ss,a=Ls.transition;Ls.transition=null;try{ss=1,Ds(e,t,n,r)}finally{ss=i,Ls.transition=a}}function Os(e,t,n,r){var i=ss,a=Ls.transition;Ls.transition=null;try{ss=4,Ds(e,t,n,r)}finally{ss=i,Ls.transition=a}}function Ds(e,t,n,r){if(Is){var i=ks(e,t,n,r);if(null===i)Lc(e,t,r,Us,n),Ms(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return gs=ws(gs,e,t,n,r,i),!0;case"dragenter":return vs=ws(vs,e,t,n,r,i),!0;case"mouseover":return ys=ws(ys,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return _s.set(a,ws(_s.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,bs.set(a,ws(bs.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Ms(e,r),4&t&&-1<Ss.indexOf(e)){for(;null!==i;){var a=ou(i);if(null!==a&&cs(a),null===(a=ks(e,t,n,r))&&Lc(e,t,r,Us,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else Lc(e,t,r,null,n)}}var Us=null;function ks(e,t,n,r){if(Us=null,null!==(e=au(e=lo(r))))if(null===(t=Po(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Lo(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Us=e,null}function Fs(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bo()){case Ho:return 1;case Vo:return 4;case jo:case Go:return 16;case Wo:return 536870912;default:return 16}default:return 16}}var zs=null,Bs=null,Hs=null;function Vs(){if(Hs)return Hs;var e,t,n=Bs,r=n.length,i="value"in zs?zs.value:zs.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Hs=i.slice(e,1<t?1-t:void 0)}function js(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Gs(){return!0}function Ws(){return!1}function Xs(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=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Gs:Ws,this.isPropagationStopped=Ws,this}return wa(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Gs)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Gs)},persist:function(){},isPersistent:Gs}),t}var $s,qs,Ys,Ks={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zs=Xs(Ks),Js=wa({},Ks,{view:0,detail:0}),Qs=Xs(Js),el=wa({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dl,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ys&&(Ys&&"mousemove"===e.type?($s=e.screenX-Ys.screenX,qs=e.screenY-Ys.screenY):qs=$s=0,Ys=e),$s)},movementY:function(e){return"movementY"in e?e.movementY:qs}}),tl=Xs(el),nl=Xs(wa({},el,{dataTransfer:0})),rl=Xs(wa({},Js,{relatedTarget:0})),il=Xs(wa({},Ks,{animationName:0,elapsedTime:0,pseudoElement:0})),al=wa({},Ks,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ol=Xs(al),sl=Xs(wa({},Ks,{data:0})),ll={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cl={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ul={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hl(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=ul[e])&&!!t[e]}function dl(){return hl}var fl=wa({},Js,{key:function(e){if(e.key){var t=ll[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=js(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?cl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dl,charCode:function(e){return"keypress"===e.type?js(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?js(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),pl=Xs(fl),ml=Xs(wa({},el,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),gl=Xs(wa({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dl})),vl=Xs(wa({},Ks,{propertyName:0,elapsedTime:0,pseudoElement:0})),yl=wa({},el,{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}),_l=Xs(yl),bl=[9,13,27,32],xl=Zi&&"CompositionEvent"in window,Sl=null;Zi&&"documentMode"in document&&(Sl=document.documentMode);var Ml=Zi&&"TextEvent"in window&&!Sl,wl=Zi&&(!xl||Sl&&8<Sl&&11>=Sl),El=String.fromCharCode(32),Tl=!1;function Al(e,t){switch(e){case"keyup":return-1!==bl.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cl(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Rl=!1;var Pl={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 Ll(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Pl[e.type]:"textarea"===t}function Il(e,t,n,r){po(r),0<(t=Nc(t,"onChange")).length&&(n=new Zs("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Nl=null,Ol=null;function Dl(e){Ec(e,0)}function Ul(e){if(Oa(su(e)))return e}function kl(e,t){if("change"===e)return t}var Fl=!1;if(Zi){var zl;if(Zi){var Bl="oninput"in document;if(!Bl){var Hl=document.createElement("div");Hl.setAttribute("oninput","return;"),Bl="function"==typeof Hl.oninput}zl=Bl}else zl=!1;Fl=zl&&(!document.documentMode||9<document.documentMode)}function Vl(){Nl&&(Nl.detachEvent("onpropertychange",jl),Ol=Nl=null)}function jl(e){if("value"===e.propertyName&&Ul(Ol)){var t=[];Il(t,Ol,e,lo(e)),_o(Dl,t)}}function Gl(e,t,n){"focusin"===e?(Vl(),Ol=n,(Nl=t).attachEvent("onpropertychange",jl)):"focusout"===e&&Vl()}function Wl(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Ul(Ol)}function Xl(e,t){if("click"===e)return Ul(t)}function $l(e,t){if("input"===e||"change"===e)return Ul(t)}var ql="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function Yl(e,t){if(ql(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===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(!Ji.call(t,i)||!ql(e[i],t[i]))return!1}return!0}function Kl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zl(e,t){var n,r=Kl(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Kl(r)}}function Jl(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Jl(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ql(){for(var e=window,t=Da();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Da((e=t.contentWindow).document)}return t}function ec(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function tc(e){var t=Ql(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Jl(n.ownerDocument.documentElement,n)){if(null!==r&&ec(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=void 0===r.end?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Zl(n,a);var o=Zl(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var nc=Zi&&"documentMode"in document&&11>=document.documentMode,rc=null,ic=null,ac=null,oc=!1;function sc(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;oc||null==rc||rc!==Da(r)||("selectionStart"in(r=rc)&&ec(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ac&&Yl(ac,r)||(ac=r,0<(r=Nc(ic,"onSelect")).length&&(t=new Zs("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=rc)))}function lc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var cc={animationend:lc("Animation","AnimationEnd"),animationiteration:lc("Animation","AnimationIteration"),animationstart:lc("Animation","AnimationStart"),transitionend:lc("Transition","TransitionEnd")},uc={},hc={};function dc(e){if(uc[e])return uc[e];if(!cc[e])return e;var t,n=cc[e];for(t in n)if(n.hasOwnProperty(t)&&t in hc)return uc[e]=n[t];return e}Zi&&(hc=document.createElement("div").style,"AnimationEvent"in window||(delete cc.animationend.animation,delete cc.animationiteration.animation,delete cc.animationstart.animation),"TransitionEvent"in window||delete cc.transitionend.transition);var fc=dc("animationend"),pc=dc("animationiteration"),mc=dc("animationstart"),gc=dc("transitionend"),vc=new Map,yc="abort auxClick 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(" ");function _c(e,t){vc.set(e,t),Yi(t,[e])}for(var bc=0;bc<yc.length;bc++){var xc=yc[bc];_c(xc.toLowerCase(),"on"+(xc[0].toUpperCase()+xc.slice(1)))}_c(fc,"onAnimationEnd"),_c(pc,"onAnimationIteration"),_c(mc,"onAnimationStart"),_c("dblclick","onDoubleClick"),_c("focusin","onFocus"),_c("focusout","onBlur"),_c(gc,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),Yi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sc="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(" "),Mc=new Set("cancel close invalid load scroll toggle".split(" ").concat(Sc));function wc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,a,o,s,l){if(Ro.apply(this,arguments),wo){if(!wo)throw Error(Xi(198));var c=Eo;wo=!1,Eo=null,To||(To=!0,Ao=c)}}(r,t,void 0,e),e.currentTarget=null}function Ec(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;wc(i,s,c),a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;wc(i,s,c),a=l}}}if(To)throw e=Ao,To=!1,Ao=null,e}function Tc(e,t){var n=t[nu];void 0===n&&(n=t[nu]=new Set);var r=e+"__bubble";n.has(r)||(Pc(t,e,2,!1),n.add(r))}function Ac(e,t,n){var r=0;t&&(r|=4),Pc(n,e,r,t)}var Cc="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[Cc]){e[Cc]=!0,$i.forEach((function(t){"selectionchange"!==t&&(Mc.has(t)||Ac(t,!1,e),Ac(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Cc]||(t[Cc]=!0,Ac("selectionchange",!1,t))}}function Pc(e,t,n,r){switch(Fs(t)){case 1:var i=Ns;break;case 4:i=Os;break;default:i=Ds}n=i.bind(null,t,n,e),i=void 0,!xo||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Lc(e,t,n,r,i){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=au(s)))return;if(5===(l=o.tag)||6===l){r=a=o;continue e}s=s.parentNode}}r=r.return}_o((function(){var r=a,i=lo(n),o=[];e:{var s=vc.get(e);if(void 0!==s){var l=Zs,c=e;switch(e){case"keypress":if(0===js(n))break e;case"keydown":case"keyup":l=pl;break;case"focusin":c="focus",l=rl;break;case"focusout":c="blur",l=rl;break;case"beforeblur":case"afterblur":l=rl;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=tl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=nl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=gl;break;case fc:case pc:case mc:l=il;break;case gc:l=vl;break;case"scroll":l=Qs;break;case"wheel":l=_l;break;case"copy":case"cut":case"paste":l=ol;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=ml}var u=!!(4&t),h=!u&&"scroll"===e,d=u?null!==s?s+"Capture":null:s;u=[];for(var f,p=r;null!==p;){var m=(f=p).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==d&&(null!=(m=bo(p,d))&&u.push(Ic(p,m,f)))),h)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,i),o.push({event:s,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===so||!(c=n.relatedTarget||n.fromElement)||!au(c)&&!c[tu])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?au(c):null)&&(c!==(h=Po(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=tl,m="onMouseLeave",d="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=ml,m="onPointerLeave",d="onPointerEnter",p="pointer"),h=null==l?s:su(l),f=null==c?s:su(c),(s=new u(m,p+"leave",l,n,i)).target=h,s.relatedTarget=f,m=null,au(i)===r&&((u=new u(d,p+"enter",c,n,i)).target=f,u.relatedTarget=h,m=u),h=m,l&&c)e:{for(d=c,p=0,f=u=l;f;f=Oc(f))p++;for(f=0,m=d;m;m=Oc(m))f++;for(;0<p-f;)u=Oc(u),p--;for(;0<f-p;)d=Oc(d),f--;for(;p--;){if(u===d||null!==d&&u===d.alternate)break e;u=Oc(u),d=Oc(d)}u=null}else u=null;null!==l&&Dc(o,s,l,u,!1),null!==c&&null!==h&&Dc(o,h,c,u,!0)}if("select"===(l=(s=r?su(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=kl;else if(Ll(s))if(Fl)g=$l;else{g=Wl;var v=Gl}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=Xl);switch(g&&(g=g(e,r))?Il(o,g,n,i):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&Ha(s,"number",s.value)),v=r?su(r):window,e){case"focusin":(Ll(v)||"true"===v.contentEditable)&&(rc=v,ic=r,ac=null);break;case"focusout":ac=ic=rc=null;break;case"mousedown":oc=!0;break;case"contextmenu":case"mouseup":case"dragend":oc=!1,sc(o,n,i);break;case"selectionchange":if(nc)break;case"keydown":case"keyup":sc(o,n,i)}var y;if(xl)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Rl?Al(e,n)&&(_="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(_="onCompositionStart");_&&(wl&&"ko"!==n.locale&&(Rl||"onCompositionStart"!==_?"onCompositionEnd"===_&&Rl&&(y=Vs()):(Bs="value"in(zs=i)?zs.value:zs.textContent,Rl=!0)),0<(v=Nc(r,_)).length&&(_=new sl(_,e,null,n,i),o.push({event:_,listeners:v}),y?_.data=y:null!==(y=Cl(n))&&(_.data=y))),(y=Ml?function(e,t){switch(e){case"compositionend":return Cl(t);case"keypress":return 32!==t.which?null:(Tl=!0,El);case"textInput":return(e=t.data)===El&&Tl?null:e;default:return null}}(e,n):function(e,t){if(Rl)return"compositionend"===e||!xl&&Al(e,t)?(e=Vs(),Hs=Bs=zs=null,Rl=!1,e):null;switch(e){case"paste":default: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 wl&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Nc(r,"onBeforeInput")).length&&(i=new sl("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=y))}Ec(o,t)}))}function Ic(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nc(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=bo(e,n))&&r.unshift(Ic(e,a,i)),null!=(a=bo(e,t))&&r.push(Ic(e,a,i))),e=e.return}return r}function Oc(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Dc(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,i?null!=(l=bo(n,a))&&o.unshift(Ic(n,l,s)):i||null!=(l=bo(n,a))&&o.push(Ic(n,l,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var Uc=/\r\n?/g,kc=/\u0000|\uFFFD/g;function Fc(e){return("string"==typeof e?e:""+e).replace(Uc,"\n").replace(kc,"")}function zc(e,t,n){if(t=Fc(t),Fc(e)!==t&&n)throw Error(Xi(425))}function Bc(){}var Hc=null,Vc=null;function jc(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Gc="function"==typeof setTimeout?setTimeout:void 0,Wc="function"==typeof clearTimeout?clearTimeout:void 0,Xc="function"==typeof Promise?Promise:void 0,$c="function"==typeof queueMicrotask?queueMicrotask:void 0!==Xc?function(e){return Xc.resolve(null).then(e).catch(qc)}:Gc;function qc(e){setTimeout((function(){throw e}))}function Yc(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void Ps(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);Ps(t)}function Kc(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function Zc(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Jc=Math.random().toString(36).slice(2),Qc="__reactFiber$"+Jc,eu="__reactProps$"+Jc,tu="__reactContainer$"+Jc,nu="__reactEvents$"+Jc,ru="__reactListeners$"+Jc,iu="__reactHandles$"+Jc;function au(e){var t=e[Qc];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tu]||n[Qc]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Zc(e);null!==e;){if(n=e[Qc])return n;e=Zc(e)}return t}n=(e=n).parentNode}return null}function ou(e){return!(e=e[Qc]||e[tu])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function su(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Xi(33))}function lu(e){return e[eu]||null}var cu=[],uu=-1;function hu(e){return{current:e}}function du(e){0>uu||(e.current=cu[uu],cu[uu]=null,uu--)}function fu(e,t){uu++,cu[uu]=e.current,e.current=t}var pu={},mu=hu(pu),gu=hu(!1),vu=pu;function yu(e,t){var n=e.type.contextTypes;if(!n)return pu;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function _u(e){return null!=(e=e.childContextTypes)}function bu(){du(gu),du(mu)}function xu(e,t,n){if(mu.current!==pu)throw Error(Xi(168));fu(mu,t),fu(gu,n)}function Su(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(Xi(108,Pa(e)||"Unknown",i));return wa({},n,r)}function Mu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pu,vu=mu.current,fu(mu,e),fu(gu,gu.current),!0}function wu(e,t,n){var r=e.stateNode;if(!r)throw Error(Xi(169));n?(e=Su(e,t,vu),r.__reactInternalMemoizedMergedChildContext=e,du(gu),du(mu),fu(mu,e)):du(gu),fu(gu,n)}var Eu=null,Tu=!1,Au=!1;function Cu(e){null===Eu?Eu=[e]:Eu.push(e)}function Ru(){if(!Au&&null!==Eu){Au=!0;var e=0,t=ss;try{var n=Eu;for(ss=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Eu=null,Tu=!1}catch(i){throw null!==Eu&&(Eu=Eu.slice(e+1)),Do(Ho,Ru),i}finally{ss=t,Au=!1}}return null}var Pu=[],Lu=0,Iu=null,Nu=0,Ou=[],Du=0,Uu=null,ku=1,Fu="";function zu(e,t){Pu[Lu++]=Nu,Pu[Lu++]=Iu,Iu=e,Nu=t}function Bu(e,t,n){Ou[Du++]=ku,Ou[Du++]=Fu,Ou[Du++]=Uu,Uu=e;var r=ku;e=Fu;var i=32-qo(r)-1;r&=~(1<<i),n+=1;var a=32-qo(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ku=1<<32-qo(t)+i|n<<i|r,Fu=a+e}else ku=1<<a|n<<i|r,Fu=e}function Hu(e){null!==e.return&&(zu(e,1),Bu(e,1,0))}function Vu(e){for(;e===Iu;)Iu=Pu[--Lu],Pu[Lu]=null,Nu=Pu[--Lu],Pu[Lu]=null;for(;e===Uu;)Uu=Ou[--Du],Ou[Du]=null,Fu=Ou[--Du],Ou[Du]=null,ku=Ou[--Du],Ou[Du]=null}var ju=null,Gu=null,Wu=!1,Xu=null;function $u(e,t){var n=ym(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function qu(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ju=e,Gu=Kc(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ju=e,Gu=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Uu?{id:ku,overflow:Fu}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=ym(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ju=e,Gu=null,!0);default:return!1}}function Yu(e){return!(!(1&e.mode)||128&e.flags)}function Ku(e){if(Wu){var t=Gu;if(t){var n=t;if(!qu(e,t)){if(Yu(e))throw Error(Xi(418));t=Kc(n.nextSibling);var r=ju;t&&qu(e,t)?$u(r,n):(e.flags=-4097&e.flags|2,Wu=!1,ju=e)}}else{if(Yu(e))throw Error(Xi(418));e.flags=-4097&e.flags|2,Wu=!1,ju=e}}}function Zu(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ju=e}function Ju(e){if(e!==ju)return!1;if(!Wu)return Zu(e),Wu=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!jc(e.type,e.memoizedProps)),t&&(t=Gu)){if(Yu(e))throw Qu(),Error(Xi(418));for(;t;)$u(e,t),t=Kc(t.nextSibling)}if(Zu(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(Xi(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Gu=Kc(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Gu=null}}else Gu=ju?Kc(e.stateNode.nextSibling):null;return!0}function Qu(){for(var e=Gu;e;)e=Kc(e.nextSibling)}function eh(){Gu=ju=null,Wu=!1}function th(e){null===Xu?Xu=[e]:Xu.push(e)}var nh=sa.ReactCurrentBatchConfig;function rh(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(Xi(309));var r=n.stateNode}if(!r)throw Error(Xi(147,e));var i=r,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:((t=function(e){var t=i.refs;null===e?delete t[a]:t[a]=e})._stringRef=a,t)}if("string"!=typeof e)throw Error(Xi(284));if(!n._owner)throw Error(Xi(290,e))}return e}function ih(e,t){throw e=Object.prototype.toString.call(t),Error(Xi(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ah(e){return(0,e._init)(e._payload)}function oh(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=bm(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=wm(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function l(e,t,n,r){var a=n.type;return a===ua?u(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===_a&&ah(a)===t.type)?((r=i(t,n.props)).ref=rh(e,t,n),r.return=e,r):((r=xm(n.type,n.key,n.props,null,e.mode,r)).ref=rh(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Em(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function u(e,t,n,r,a){return null===t||7!==t.tag?((t=Sm(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=wm(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case la:return(n=xm(t.type,t.key,t.props,null,e.mode,n)).ref=rh(e,null,t),n.return=e,n;case ca:return(t=Em(t,e.mode,n)).return=e,t;case _a:return h(e,(0,t._init)(t._payload),n)}if(Va(t)||Sa(t))return(t=Sm(t,e.mode,n,null)).return=e,t;ih(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case la:return n.key===i?l(e,t,n,r):null;case ca:return n.key===i?c(e,t,n,r):null;case _a:return d(e,t,(i=n._init)(n._payload),r)}if(Va(n)||Sa(n))return null!==i?null:u(e,t,n,r,null);ih(e,n)}return null}function f(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case la:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case ca:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case _a:return f(e,t,n,(0,r._init)(r._payload),i)}if(Va(r)||Sa(r))return u(t,e=e.get(n)||null,r,i,null);ih(t,r)}return null}return function s(l,c,u,p){if("object"==typeof u&&null!==u&&u.type===ua&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case la:e:{for(var m=u.key,g=c;null!==g;){if(g.key===m){if((m=u.type)===ua){if(7===g.tag){n(l,g.sibling),(c=i(g,u.props.children)).return=l,l=c;break e}}else if(g.elementType===m||"object"==typeof m&&null!==m&&m.$$typeof===_a&&ah(m)===g.type){n(l,g.sibling),(c=i(g,u.props)).ref=rh(l,g,u),c.return=l,l=c;break e}n(l,g);break}t(l,g),g=g.sibling}u.type===ua?((c=Sm(u.props.children,l.mode,p,u.key)).return=l,l=c):((p=xm(u.type,u.key,u.props,null,l.mode,p)).ref=rh(l,c,u),p.return=l,l=p)}return o(l);case ca:e:{for(g=u.key;null!==c;){if(c.key===g){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(c=i(c,u.children||[])).return=l,l=c;break e}n(l,c);break}t(l,c),c=c.sibling}(c=Em(u,l.mode,p)).return=l,l=c}return o(l);case _a:return s(l,c,(g=u._init)(u._payload),p)}if(Va(u))return function(i,o,s,l){for(var c=null,u=null,p=o,m=o=0,g=null;null!==p&&m<s.length;m++){p.index>m?(g=p,p=null):g=p.sibling;var v=d(i,p,s[m],l);if(null===v){null===p&&(p=g);break}e&&p&&null===v.alternate&&t(i,p),o=a(v,o,m),null===u?c=v:u.sibling=v,u=v,p=g}if(m===s.length)return n(i,p),Wu&&zu(i,m),c;if(null===p){for(;m<s.length;m++)null!==(p=h(i,s[m],l))&&(o=a(p,o,m),null===u?c=p:u.sibling=p,u=p);return Wu&&zu(i,m),c}for(p=r(i,p);m<s.length;m++)null!==(g=f(p,i,m,s[m],l))&&(e&&null!==g.alternate&&p.delete(null===g.key?m:g.key),o=a(g,o,m),null===u?c=g:u.sibling=g,u=g);return e&&p.forEach((function(e){return t(i,e)})),Wu&&zu(i,m),c}(l,c,u,p);if(Sa(u))return function(i,o,s,l){var c=Sa(s);if("function"!=typeof c)throw Error(Xi(150));if(null==(s=c.call(s)))throw Error(Xi(151));for(var u=c=null,p=o,m=o=0,g=null,v=s.next();null!==p&&!v.done;m++,v=s.next()){p.index>m?(g=p,p=null):g=p.sibling;var y=d(i,p,v.value,l);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(i,p),o=a(y,o,m),null===u?c=y:u.sibling=y,u=y,p=g}if(v.done)return n(i,p),Wu&&zu(i,m),c;if(null===p){for(;!v.done;m++,v=s.next())null!==(v=h(i,v.value,l))&&(o=a(v,o,m),null===u?c=v:u.sibling=v,u=v);return Wu&&zu(i,m),c}for(p=r(i,p);!v.done;m++,v=s.next())null!==(v=f(p,i,m,v.value,l))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),o=a(v,o,m),null===u?c=v:u.sibling=v,u=v);return e&&p.forEach((function(e){return t(i,e)})),Wu&&zu(i,m),c}(l,c,u,p);ih(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(c=i(c,u)).return=l,l=c):(n(l,c),(c=wm(u,l.mode,p)).return=l,l=c),o(l)):n(l,c)}}var sh=oh(!0),lh=oh(!1),ch=hu(null),uh=null,hh=null,dh=null;function fh(){dh=hh=uh=null}function ph(e){var t=ch.current;du(ch),e._currentValue=t}function mh(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function gh(e,t){uh=e,dh=hh=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&t)&&(of=!0),e.firstContext=null)}function vh(e){var t=e._currentValue;if(dh!==e)if(e={context:e,memoizedValue:t,next:null},null===hh){if(null===uh)throw Error(Xi(308));hh=e,uh.dependencies={lanes:0,firstContext:e}}else hh=hh.next=e;return t}var yh=null;function _h(e){null===yh?yh=[e]:yh.push(e)}function bh(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,_h(t)):(n.next=i.next,i.next=n),t.interleaved=n,xh(e,r)}function xh(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Sh=!1;function Mh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Eh(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Th(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&mp){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,xh(e,n)}return null===(i=r.interleaved)?(t.next=t,_h(r)):(t.next=i.next,i.next=t),r.interleaved=t,xh(e,n)}function Ah(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,os(e,n)}}function Ch(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Rh(e,t,n,r){var i=e.updateQueue;Sh=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===o?a=c:o.next=c,o=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==o&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==a){var h=i.baseState;for(o=0,u=c=l=null,s=a;;){var d=s.lane,f=s.eventTime;if((r&d)===d){null!==u&&(u=u.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(d=t,f=n,m.tag){case 1:if("function"==typeof(p=m.payload)){h=p.call(f,h,d);break e}h=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(d="function"==typeof(p=m.payload)?p.call(f,h,d):p))break e;h=wa({},h,d);break e;case 2:Sh=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(d=i.effects)?i.effects=[s]:d.push(s))}else f={eventTime:f,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=f,l=h):u=u.next=f,o|=d;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(d=s).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}if(null===u&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===a&&(i.shared.lanes=0);Mp|=o,e.lanes=o,e.memoizedState=h}}function Ph(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(Xi(191,i));i.call(r)}}}var Lh={},Ih=hu(Lh),Nh=hu(Lh),Oh=hu(Lh);function Dh(e){if(e===Lh)throw Error(Xi(174));return e}function Uh(e,t){switch(fu(Oh,t),fu(Nh,e),fu(Ih,Lh),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ya(null,"");break;default:t=Ya(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}du(Ih),fu(Ih,t)}function kh(){du(Ih),du(Nh),du(Oh)}function Fh(e){Dh(Oh.current);var t=Dh(Ih.current),n=Ya(t,e.type);t!==n&&(fu(Nh,e),fu(Ih,n))}function zh(e){Nh.current===e&&(du(Ih),du(Nh))}var Bh=hu(0);function Hh(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vh=[];function jh(){for(var e=0;e<Vh.length;e++)Vh[e]._workInProgressVersionPrimary=null;Vh.length=0}var Gh=sa.ReactCurrentDispatcher,Wh=sa.ReactCurrentBatchConfig,Xh=0,$h=null,qh=null,Yh=null,Kh=!1,Zh=!1,Jh=0,Qh=0;function ed(){throw Error(Xi(321))}function td(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ql(e[n],t[n]))return!1;return!0}function nd(e,t,n,r,i,a){if(Xh=a,$h=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Gh.current=null===e||null===e.memoizedState?zd:Bd,e=n(r,i),Zh){a=0;do{if(Zh=!1,Jh=0,25<=a)throw Error(Xi(301));a+=1,Yh=qh=null,t.updateQueue=null,Gh.current=Hd,e=n(r,i)}while(Zh)}if(Gh.current=Fd,t=null!==qh&&null!==qh.next,Xh=0,Yh=qh=$h=null,Kh=!1,t)throw Error(Xi(300));return e}function rd(){var e=0!==Jh;return Jh=0,e}function id(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Yh?$h.memoizedState=Yh=e:Yh=Yh.next=e,Yh}function ad(){if(null===qh){var e=$h.alternate;e=null!==e?e.memoizedState:null}else e=qh.next;var t=null===Yh?$h.memoizedState:Yh.next;if(null!==t)Yh=t,qh=e;else{if(null===e)throw Error(Xi(310));e={memoizedState:(qh=e).memoizedState,baseState:qh.baseState,baseQueue:qh.baseQueue,queue:qh.queue,next:null},null===Yh?$h.memoizedState=Yh=e:Yh=Yh.next=e}return Yh}function od(e,t){return"function"==typeof t?t(e):t}function sd(e){var t=ad(),n=t.queue;if(null===n)throw Error(Xi(311));n.lastRenderedReducer=e;var r=qh,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(null!==i){a=i.next,r=r.baseState;var s=o=null,l=null,c=a;do{var u=c.lane;if((Xh&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===l?(s=l=h,o=r):l=l.next=h,$h.lanes|=u,Mp|=u}c=c.next}while(null!==c&&c!==a);null===l?o=r:l.next=s,ql(r,t.memoizedState)||(of=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{a=i.lane,$h.lanes|=a,Mp|=a,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ld(e){var t=ad(),n=t.queue;if(null===n)throw Error(Xi(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var o=i=i.next;do{a=e(a,o.action),o=o.next}while(o!==i);ql(a,t.memoizedState)||(of=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function cd(){}function ud(e,t){var n=$h,r=ad(),i=t(),a=!ql(r.memoizedState,i);if(a&&(r.memoizedState=i,of=!0),r=r.queue,Sd(fd.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==Yh&&1&Yh.memoizedState.tag){if(n.flags|=2048,vd(9,dd.bind(null,n,r,i,t),void 0,null),null===gp)throw Error(Xi(349));30&Xh||hd(n,t,i)}return i}function hd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=$h.updateQueue)?(t={lastEffect:null,stores:null},$h.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function dd(e,t,n,r){t.value=n,t.getSnapshot=r,pd(t)&&md(e)}function fd(e,t,n){return n((function(){pd(t)&&md(e)}))}function pd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ql(e,n)}catch(r){return!0}}function md(e){var t=xh(e,1);null!==t&&jp(t,e,1,-1)}function gd(e){var t=id();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:od,lastRenderedState:e},t.queue=e,e=e.dispatch=Od.bind(null,$h,e),[t.memoizedState,e]}function vd(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=$h.updateQueue)?(t={lastEffect:null,stores:null},$h.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function yd(){return ad().memoizedState}function _d(e,t,n,r){var i=id();$h.flags|=e,i.memoizedState=vd(1|t,n,void 0,void 0===r?null:r)}function bd(e,t,n,r){var i=ad();r=void 0===r?null:r;var a=void 0;if(null!==qh){var o=qh.memoizedState;if(a=o.destroy,null!==r&&td(r,o.deps))return void(i.memoizedState=vd(t,n,a,r))}$h.flags|=e,i.memoizedState=vd(1|t,n,a,r)}function xd(e,t){return _d(8390656,8,e,t)}function Sd(e,t){return bd(2048,8,e,t)}function Md(e,t){return bd(4,2,e,t)}function wd(e,t){return bd(4,4,e,t)}function Ed(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Td(e,t,n){return n=null!=n?n.concat([e]):null,bd(4,4,Ed.bind(null,t,e),n)}function Ad(){}function Cd(e,t){var n=ad();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&td(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Rd(e,t){var n=ad();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&td(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Pd(e,t,n){return 21&Xh?(ql(n,t)||(n=rs(),$h.lanes|=n,Mp|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,of=!0),e.memoizedState=n)}function Ld(e,t){var n=ss;ss=0!==n&&4>n?n:4,e(!0);var r=Wh.transition;Wh.transition={};try{e(!1),t()}finally{ss=n,Wh.transition=r}}function Id(){return ad().memoizedState}function Nd(e,t,n){var r=Vp(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Dd(e))Ud(t,n);else if(null!==(n=bh(e,t,n,r))){jp(n,e,r,Hp()),kd(n,t,r)}}function Od(e,t,n){var r=Vp(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dd(e))Ud(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,ql(s,o)){var l=t.interleaved;return null===l?(i.next=i,_h(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(c){}null!==(n=bh(e,t,i,r))&&(jp(n,e,r,i=Hp()),kd(n,t,r))}}function Dd(e){var t=e.alternate;return e===$h||null!==t&&t===$h}function Ud(e,t){Zh=Kh=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kd(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,os(e,n)}}var Fd={readContext:vh,useCallback:ed,useContext:ed,useEffect:ed,useImperativeHandle:ed,useInsertionEffect:ed,useLayoutEffect:ed,useMemo:ed,useReducer:ed,useRef:ed,useState:ed,useDebugValue:ed,useDeferredValue:ed,useTransition:ed,useMutableSource:ed,useSyncExternalStore:ed,useId:ed,unstable_isNewReconciler:!1},zd={readContext:vh,useCallback:function(e,t){return id().memoizedState=[e,void 0===t?null:t],e},useContext:vh,useEffect:xd,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,_d(4194308,4,Ed.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _d(4194308,4,e,t)},useInsertionEffect:function(e,t){return _d(4,2,e,t)},useMemo:function(e,t){var n=id();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=id();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Nd.bind(null,$h,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},id().memoizedState=e},useState:gd,useDebugValue:Ad,useDeferredValue:function(e){return id().memoizedState=e},useTransition:function(){var e=gd(!1),t=e[0];return e=Ld.bind(null,e[1]),id().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$h,i=id();if(Wu){if(void 0===n)throw Error(Xi(407));n=n()}else{if(n=t(),null===gp)throw Error(Xi(349));30&Xh||hd(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,xd(fd.bind(null,r,a,e),[e]),r.flags|=2048,vd(9,dd.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=id(),t=gp.identifierPrefix;if(Wu){var n=Fu;t=":"+t+"R"+(n=(ku&~(1<<32-qo(ku)-1)).toString(32)+n),0<(n=Jh++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Qh++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Bd={readContext:vh,useCallback:Cd,useContext:vh,useEffect:Sd,useImperativeHandle:Td,useInsertionEffect:Md,useLayoutEffect:wd,useMemo:Rd,useReducer:sd,useRef:yd,useState:function(){return sd(od)},useDebugValue:Ad,useDeferredValue:function(e){return Pd(ad(),qh.memoizedState,e)},useTransition:function(){return[sd(od)[0],ad().memoizedState]},useMutableSource:cd,useSyncExternalStore:ud,useId:Id,unstable_isNewReconciler:!1},Hd={readContext:vh,useCallback:Cd,useContext:vh,useEffect:Sd,useImperativeHandle:Td,useInsertionEffect:Md,useLayoutEffect:wd,useMemo:Rd,useReducer:ld,useRef:yd,useState:function(){return ld(od)},useDebugValue:Ad,useDeferredValue:function(e){var t=ad();return null===qh?t.memoizedState=e:Pd(t,qh.memoizedState,e)},useTransition:function(){return[ld(od)[0],ad().memoizedState]},useMutableSource:cd,useSyncExternalStore:ud,useId:Id,unstable_isNewReconciler:!1};function Vd(e,t){if(e&&e.defaultProps){for(var n in t=wa({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function jd(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:wa({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Gd={isMounted:function(e){return!!(e=e._reactInternals)&&Po(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Hp(),i=Vp(e),a=Eh(r,i);a.payload=t,null!=n&&(a.callback=n),null!==(t=Th(e,a,i))&&(jp(t,e,i,r),Ah(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Hp(),i=Vp(e),a=Eh(r,i);a.tag=1,a.payload=t,null!=n&&(a.callback=n),null!==(t=Th(e,a,i))&&(jp(t,e,i,r),Ah(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Hp(),r=Vp(e),i=Eh(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=Th(e,i,r))&&(jp(t,e,r,n),Ah(t,e,r))}};function Wd(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!Yl(n,r)||!Yl(i,a))}function Xd(e,t,n){var r=!1,i=pu,a=t.contextType;return"object"==typeof a&&null!==a?a=vh(a):(i=_u(t)?vu:mu.current,a=(r=null!=(r=t.contextTypes))?yu(e,i):pu),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Gd,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function $d(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gd.enqueueReplaceState(t,t.state,null)}function qd(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Mh(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=vh(a):(a=_u(t)?vu:mu.current,i.context=yu(e,a)),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(jd(e,t,a,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Gd.enqueueReplaceState(i,i.state,null),Rh(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function Yd(e,t){try{var n="",r=t;do{n+=Ca(r),r=r.return}while(r);var i=n}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i,digest:null}}function Kd(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Zd(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var Jd="function"==typeof WeakMap?WeakMap:Map;function Qd(e,t,n){(n=Eh(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Lp||(Lp=!0,Ip=r),Zd(0,t)},n}function ef(e,t,n){(n=Eh(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Zd(0,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){Zd(0,t),"function"!=typeof r&&(null===Np?Np=new Set([this]):Np.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function tf(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Jd;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=dm.bind(null,e,t,n),t.then(e,e))}function nf(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function rf(e,t,n,r,i){return 1&e.mode?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Eh(-1,1)).tag=2,Th(n,t,1))),n.lanes|=1),e)}var af=sa.ReactCurrentOwner,of=!1;function sf(e,t,n,r){t.child=null===e?lh(t,null,n,r):sh(t,e.child,n,r)}function lf(e,t,n,r,i){n=n.render;var a=t.ref;return gh(t,i),r=nd(e,t,n,r,a,i),n=rd(),null===e||of?(Wu&&n&&Hu(t),t.flags|=1,sf(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Lf(e,t,i))}function cf(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||_m(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=xm(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,uf(e,t,a,r,i))}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:Yl)(o,r)&&e.ref===t.ref)return Lf(e,t,i)}return t.flags|=1,(e=bm(a,r)).ref=t.ref,e.return=t,t.child=e}function uf(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(Yl(a,r)&&e.ref===t.ref){if(of=!1,t.pendingProps=r=a,!(e.lanes&i))return t.lanes=e.lanes,Lf(e,t,i);131072&e.flags&&(of=!0)}}return ff(e,t,n,r,i)}function hf(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fu(bp,_p),_p|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,fu(bp,_p),_p|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fu(bp,_p),_p|=n;else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,fu(bp,_p),_p|=r;return sf(e,t,i,n),t.child}function df(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ff(e,t,n,r,i){var a=_u(n)?vu:mu.current;return a=yu(t,a),gh(t,i),n=nd(e,t,n,r,a,i),r=rd(),null===e||of?(Wu&&r&&Hu(t),t.flags|=1,sf(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Lf(e,t,i))}function pf(e,t,n,r,i){if(_u(n)){var a=!0;Mu(t)}else a=!1;if(gh(t,i),null===t.stateNode)Pf(e,t),Xd(t,n,r),qd(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,c=n.contextType;"object"==typeof c&&null!==c?c=vh(c):c=yu(t,c=_u(n)?vu:mu.current);var u=n.getDerivedStateFromProps,h="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;h||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==r||l!==c)&&$d(t,o,r,c),Sh=!1;var d=t.memoizedState;o.state=d,Rh(t,r,o,i),l=t.memoizedState,s!==r||d!==l||gu.current||Sh?("function"==typeof u&&(jd(t,n,u,r),l=t.memoizedState),(s=Sh||Wd(t,n,s,r,d,l,c))?(h||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=s):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,wh(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Vd(t.type,s),o.props=c,h=t.pendingProps,d=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=vh(l):l=yu(t,l=_u(n)?vu:mu.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==h||d!==l)&&$d(t,o,r,l),Sh=!1,d=t.memoizedState,o.state=d,Rh(t,r,o,i);var p=t.memoizedState;s!==h||d!==p||gu.current||Sh?("function"==typeof f&&(jd(t,n,f,r),p=t.memoizedState),(c=Sh||Wd(t,n,c,r,d,p,l)||!1)?(u||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=l,r=c):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return mf(e,t,n,r,a,i)}function mf(e,t,n,r,i,a){df(e,t);var o=!!(128&t.flags);if(!r&&!o)return i&&wu(t,n,!1),Lf(e,t,a);r=t.stateNode,af.current=t;var s=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=sh(t,e.child,null,a),t.child=sh(t,null,s,a)):sf(e,t,s,a),t.memoizedState=r.state,i&&wu(t,n,!0),t.child}function gf(e){var t=e.stateNode;t.pendingContext?xu(0,t.pendingContext,t.pendingContext!==t.context):t.context&&xu(0,t.context,!1),Uh(e,t.containerInfo)}function vf(e,t,n,r,i){return eh(),th(i),t.flags|=256,sf(e,t,n,r),t.child}var yf,_f,bf,xf,Sf={dehydrated:null,treeContext:null,retryLane:0};function Mf(e){return{baseLanes:e,cachePool:null,transitions:null}}function wf(e,t,n){var r,i=t.pendingProps,a=Bh.current,o=!1,s=!!(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),fu(Bh,1&a),null===e)return Ku(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=i.children,e=i.fallback,o?(i=t.mode,o=t.child,s={mode:"hidden",children:s},1&i||null===o?o=Mm(s,i,0,null):(o.childLanes=0,o.pendingProps=s),e=Sm(e,i,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Mf(n),t.memoizedState=Sf,e):Ef(t,s));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,i,a,o){if(n)return 256&t.flags?(t.flags&=-257,Tf(e,t,o,r=Kd(Error(Xi(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Mm({mode:"visible",children:r.children},i,0,null),(a=Sm(a,i,o,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,1&t.mode&&sh(t,e.child,null,o),t.child.memoizedState=Mf(o),t.memoizedState=Sf,a);if(!(1&t.mode))return Tf(e,t,o,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var s=r.dgst;return r=s,Tf(e,t,o,r=Kd(a=Error(Xi(419)),r,void 0))}if(s=!!(o&e.childLanes),of||s){if(null!==(r=gp)){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=i&(r.suspendedLanes|o)?0:i)&&i!==a.retryLane&&(a.retryLane=i,xh(e,i),jp(r,e,i,-1))}return nm(),Tf(e,t,o,r=Kd(Error(Xi(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=pm.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Gu=Kc(i.nextSibling),ju=t,Wu=!0,Xu=null,null!==e&&(Ou[Du++]=ku,Ou[Du++]=Fu,Ou[Du++]=Uu,ku=e.id,Fu=e.overflow,Uu=t),t=Ef(t,r.children),t.flags|=4096,t)}(e,t,s,i,r,a,n);if(o){o=i.fallback,s=t.mode,r=(a=e.child).sibling;var l={mode:"hidden",children:i.children};return 1&s||t.child===a?(i=bm(a,l)).subtreeFlags=14680064&a.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null),null!==r?o=bm(r,o):(o=Sm(o,s,n,null)).flags|=2,o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,s=null===(s=e.child.memoizedState)?Mf(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=Sf,i}return e=(o=e.child).sibling,i=bm(o,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ef(e,t){return(t=Mm({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Tf(e,t,n,r){return null!==r&&th(r),sh(t,e.child,null,n),(e=Ef(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Af(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),mh(e.return,t,n)}function Cf(e,t,n,r,i){var a=e.memoizedState;null===a?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 Rf(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(sf(e,t,r.children,n),2&(r=Bh.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Af(e,n,t);else if(19===e.tag)Af(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(fu(Bh,r),1&t.mode)switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Hh(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cf(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Hh(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cf(t,!0,n,null,a);break;case"together":Cf(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Pf(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Lf(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Mp|=t.lanes,!(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(Xi(153));if(null!==t.child){for(n=bm(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=bm(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function If(e,t){if(!Wu)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nf(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)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 Of(e,t,n){var r=t.pendingProps;switch(Vu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nf(t),null;case 1:case 17:return _u(t.type)&&bu(),Nf(t),null;case 3:return r=t.stateNode,kh(),du(gu),du(mu),jh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ju(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==Xu&&($p(Xu),Xu=null))),_f(e,t),Nf(t),null;case 5:zh(t);var i=Dh(Oh.current);if(n=t.type,null!==e&&null!=t.stateNode)bf(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(Xi(166));return Nf(t),null}if(e=Dh(Ih.current),Ju(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Qc]=t,r[eu]=a,e=!!(1&t.mode),n){case"dialog":Tc("cancel",r),Tc("close",r);break;case"iframe":case"object":case"embed":Tc("load",r);break;case"video":case"audio":for(i=0;i<Sc.length;i++)Tc(Sc[i],r);break;case"source":Tc("error",r);break;case"img":case"image":case"link":Tc("error",r),Tc("load",r);break;case"details":Tc("toggle",r);break;case"input":ka(r,a),Tc("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Tc("invalid",r);break;case"textarea":Wa(r,a),Tc("invalid",r)}for(var o in ao(n,a),i=null,a)if(a.hasOwnProperty(o)){var s=a[o];"children"===o?"string"==typeof s?r.textContent!==s&&(!0!==a.suppressHydrationWarning&&zc(r.textContent,s,e),i=["children",s]):"number"==typeof s&&r.textContent!==""+s&&(!0!==a.suppressHydrationWarning&&zc(r.textContent,s,e),i=["children",""+s]):qi.hasOwnProperty(o)&&null!=s&&"onScroll"===o&&Tc("scroll",r)}switch(n){case"input":Na(r),Ba(r,a,!0);break;case"textarea":Na(r),$a(r);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(r.onclick=Bc)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{o=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=qa(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=o.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),"select"===n&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Qc]=t,e[eu]=r,yf(e,t,!1,!1),t.stateNode=e;e:{switch(o=oo(n,r),n){case"dialog":Tc("cancel",e),Tc("close",e),i=r;break;case"iframe":case"object":case"embed":Tc("load",e),i=r;break;case"video":case"audio":for(i=0;i<Sc.length;i++)Tc(Sc[i],e);i=r;break;case"source":Tc("error",e),i=r;break;case"img":case"image":case"link":Tc("error",e),Tc("load",e),i=r;break;case"details":Tc("toggle",e),i=r;break;case"input":ka(e,r),i=Ua(e,r),Tc("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=wa({},r,{value:void 0}),Tc("invalid",e);break;case"textarea":Wa(e,r),i=Ga(e,r),Tc("invalid",e)}for(a in ao(n,i),s=i)if(s.hasOwnProperty(a)){var l=s[a];"style"===a?ro(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&Ja(e,l):"children"===a?"string"==typeof l?("textarea"!==n||""!==l)&&Qa(e,l):"number"==typeof l&&Qa(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(qi.hasOwnProperty(a)?null!=l&&"onScroll"===a&&Tc("scroll",e):null!=l&&oa(e,a,l,o))}switch(n){case"input":Na(e),Ba(e,r,!1);break;case"textarea":Na(e),$a(e);break;case"option":null!=r.value&&e.setAttribute("value",""+La(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?ja(e,!!r.multiple,a,!1):null!=r.defaultValue&&ja(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=Bc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Nf(t),null;case 6:if(e&&null!=t.stateNode)xf(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(Xi(166));if(n=Dh(Oh.current),Dh(Ih.current),Ju(t)){if(r=t.stateNode,n=t.memoizedProps,r[Qc]=t,(a=r.nodeValue!==n)&&null!==(e=ju))switch(e.tag){case 3:zc(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&zc(r.nodeValue,n,!!(1&e.mode))}a&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Qc]=t,t.stateNode=r}return Nf(t),null;case 13:if(du(Bh),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(Wu&&null!==Gu&&1&t.mode&&!(128&t.flags))Qu(),eh(),t.flags|=98560,a=!1;else if(a=Ju(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(Xi(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(Xi(317));a[Qc]=t}else eh(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Nf(t),a=!1}else null!==Xu&&($p(Xu),Xu=null),a=!0;if(!a)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Bh.current?0===xp&&(xp=3):nm())),null!==t.updateQueue&&(t.flags|=4),Nf(t),null);case 4:return kh(),_f(e,t),null===e&&Rc(t.stateNode.containerInfo),Nf(t),null;case 10:return ph(t.type._context),Nf(t),null;case 19:if(du(Bh),null===(a=t.memoizedState))return Nf(t),null;if(r=!!(128&t.flags),null===(o=a.rendering))if(r)If(a,!1);else{if(0!==xp||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=Hh(e))){for(t.flags|=128,If(a,!1),null!==(r=o.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=14680066,null===(o=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fu(Bh,1&Bh.current|2),t.child}e=e.sibling}null!==a.tail&&zo()>Rp&&(t.flags|=128,r=!0,If(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Hh(o))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),If(a,!0),null===a.tail&&"hidden"===a.tailMode&&!o.alternate&&!Wu)return Nf(t),null}else 2*zo()-a.renderingStartTime>Rp&&1073741824!==n&&(t.flags|=128,r=!0,If(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(null!==(n=a.last)?n.sibling=o:t.child=o,a.last=o)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=zo(),t.sibling=null,n=Bh.current,fu(Bh,r?1&n|2:1&n),t):(Nf(t),null);case 22:case 23:return Jp(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&_p)&&(Nf(t),6&t.subtreeFlags&&(t.flags|=8192)):Nf(t),null;case 24:case 25:return null}throw Error(Xi(156,t.tag))}function Df(e,t){switch(Vu(t),t.tag){case 1:return _u(t.type)&&bu(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return kh(),du(gu),du(mu),jh(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return zh(t),null;case 13:if(du(Bh),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(Xi(340));eh()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return du(Bh),null;case 4:return kh(),null;case 10:return ph(t.type._context),null;case 22:case 23:return Jp(),null;default:return null}}yf=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},_f=function(){},bf=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Dh(Ih.current);var a,o=null;switch(n){case"input":i=Ua(e,i),r=Ua(e,r),o=[];break;case"select":i=wa({},i,{value:void 0}),r=wa({},r,{value:void 0}),o=[];break;case"textarea":i=Ga(e,i),r=Ga(e,r),o=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=Bc)}for(c in ao(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var s=i[c];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(qi.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(s=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&l!==s&&(null!=l||null!=s))if("style"===c)if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(c,n)),n=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(o=o||[]).push(c,l)):"children"===c?"string"!=typeof l&&"number"!=typeof l||(o=o||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(qi.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&Tc("scroll",e),o||s===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}},xf=function(e,t,n,r){n!==r&&(t.flags|=4)};var Uf=!1,kf=!1,Ff="function"==typeof WeakSet?WeakSet:Set,zf=null;function Bf(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){hm(e,t,r)}else n.current=null}function Hf(e,t,n){try{n()}catch(r){hm(e,t,r)}}var Vf=!1;function jf(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&Hf(t,n,a)}i=i.next}while(i!==r)}}function Gf(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wf(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function Xf(e){var t=e.alternate;null!==t&&(e.alternate=null,Xf(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[Qc],delete t[eu],delete t[nu],delete t[ru],delete t[iu])),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 $f(e){return 5===e.tag||3===e.tag||4===e.tag}function qf(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||$f(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Yf(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Bc));else if(4!==r&&null!==(e=e.child))for(Yf(e,t,n),e=e.sibling;null!==e;)Yf(e,t,n),e=e.sibling}function Kf(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Kf(e,t,n),e=e.sibling;null!==e;)Kf(e,t,n),e=e.sibling}var Zf=null,Jf=!1;function Qf(e,t,n){for(n=n.child;null!==n;)ep(e,t,n),n=n.sibling}function ep(e,t,n){if($o&&"function"==typeof $o.onCommitFiberUnmount)try{$o.onCommitFiberUnmount(Xo,n)}catch(s){}switch(n.tag){case 5:kf||Bf(n,t);case 6:var r=Zf,i=Jf;Zf=null,Qf(e,t,n),Jf=i,null!==(Zf=r)&&(Jf?(e=Zf,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):Zf.removeChild(n.stateNode));break;case 18:null!==Zf&&(Jf?(e=Zf,n=n.stateNode,8===e.nodeType?Yc(e.parentNode,n):1===e.nodeType&&Yc(e,n),Ps(e)):Yc(Zf,n.stateNode));break;case 4:r=Zf,i=Jf,Zf=n.stateNode.containerInfo,Jf=!0,Qf(e,t,n),Zf=r,Jf=i;break;case 0:case 11:case 14:case 15:if(!kf&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,void 0!==o&&(2&a||4&a)&&Hf(n,t,o),i=i.next}while(i!==r)}Qf(e,t,n);break;case 1:if(!kf&&(Bf(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){hm(n,t,s)}Qf(e,t,n);break;case 21:Qf(e,t,n);break;case 22:1&n.mode?(kf=(r=kf)||null!==n.memoizedState,Qf(e,t,n),kf=r):Qf(e,t,n);break;default:Qf(e,t,n)}}function tp(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ff),t.forEach((function(t){var r=mm.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function np(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,s=o;e:for(;null!==s;){switch(s.tag){case 5:Zf=s.stateNode,Jf=!1;break e;case 3:case 4:Zf=s.stateNode.containerInfo,Jf=!0;break e}s=s.return}if(null===Zf)throw Error(Xi(160));ep(a,o,i),Zf=null,Jf=!1;var l=i.alternate;null!==l&&(l.return=null),i.return=null}catch(c){hm(i,t,c)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)rp(t,e),t=t.sibling}function rp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(np(t,e),ip(e),4&r){try{jf(3,e,e.return),Gf(3,e)}catch(m){hm(e,e.return,m)}try{jf(5,e,e.return)}catch(m){hm(e,e.return,m)}}break;case 1:np(t,e),ip(e),512&r&&null!==n&&Bf(n,n.return);break;case 5:if(np(t,e),ip(e),512&r&&null!==n&&Bf(n,n.return),32&e.flags){var i=e.stateNode;try{Qa(i,"")}catch(m){hm(e,e.return,m)}}if(4&r&&null!=(i=e.stateNode)){var a=e.memoizedProps,o=null!==n?n.memoizedProps:a,s=e.type,l=e.updateQueue;if(e.updateQueue=null,null!==l)try{"input"===s&&"radio"===a.type&&null!=a.name&&Fa(i,a),oo(s,o);var c=oo(s,a);for(o=0;o<l.length;o+=2){var u=l[o],h=l[o+1];"style"===u?ro(i,h):"dangerouslySetInnerHTML"===u?Ja(i,h):"children"===u?Qa(i,h):oa(i,u,h,c)}switch(s){case"input":za(i,a);break;case"textarea":Xa(i,a);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var f=a.value;null!=f?ja(i,!!a.multiple,f,!1):d!==!!a.multiple&&(null!=a.defaultValue?ja(i,!!a.multiple,a.defaultValue,!0):ja(i,!!a.multiple,a.multiple?[]:"",!1))}i[eu]=a}catch(m){hm(e,e.return,m)}}break;case 6:if(np(t,e),ip(e),4&r){if(null===e.stateNode)throw Error(Xi(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){hm(e,e.return,m)}}break;case 3:if(np(t,e),ip(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Ps(t.containerInfo)}catch(m){hm(e,e.return,m)}break;case 4:default:np(t,e),ip(e);break;case 13:np(t,e),ip(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,!a||null!==i.alternate&&null!==i.alternate.memoizedState||(Cp=zo())),4&r&&tp(e);break;case 22:if(u=null!==n&&null!==n.memoizedState,1&e.mode?(kf=(c=kf)||u,np(t,e),kf=c):np(t,e),ip(e),8192&r){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!u&&1&e.mode)for(zf=e,u=e.child;null!==u;){for(h=zf=u;null!==zf;){switch(f=(d=zf).child,d.tag){case 0:case 11:case 14:case 15:jf(4,d,d.return);break;case 1:Bf(d,d.return);var p=d.stateNode;if("function"==typeof p.componentWillUnmount){r=d,n=d.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){hm(r,n,m)}}break;case 5:Bf(d,d.return);break;case 22:if(null!==d.memoizedState){lp(h);continue}}null!==f?(f.return=d,zf=f):lp(h)}u=u.sibling}e:for(u=null,h=e;;){if(5===h.tag){if(null===u){u=h;try{i=h.stateNode,c?"function"==typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none":(s=h.stateNode,o=null!=(l=h.memoizedProps.style)&&l.hasOwnProperty("display")?l.display:null,s.style.display=no("display",o))}catch(m){hm(e,e.return,m)}}}else if(6===h.tag){if(null===u)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(m){hm(e,e.return,m)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:np(t,e),ip(e),4&r&&tp(e);case 21:}}function ip(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if($f(n)){var r=n;break e}n=n.return}throw Error(Xi(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(Qa(i,""),r.flags&=-33),Kf(e,qf(e),i);break;case 3:case 4:var a=r.stateNode.containerInfo;Yf(e,qf(e),a);break;default:throw Error(Xi(161))}}catch(o){hm(e,e.return,o)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function ap(e,t,n){zf=e,op(e)}function op(e,t,n){for(var r=!!(1&e.mode);null!==zf;){var i=zf,a=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||Uf;if(!o){var s=i.alternate,l=null!==s&&null!==s.memoizedState||kf;s=Uf;var c=kf;if(Uf=o,(kf=l)&&!c)for(zf=i;null!==zf;)l=(o=zf).child,22===o.tag&&null!==o.memoizedState?cp(i):null!==l?(l.return=o,zf=l):cp(i);for(;null!==a;)zf=a,op(a),a=a.sibling;zf=i,Uf=s,kf=c}sp(e)}else 8772&i.subtreeFlags&&null!==a?(a.return=i,zf=a):sp(e)}}function sp(e){for(;null!==zf;){var t=zf;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:kf||Gf(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!kf)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Vd(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Ph(t,a,r);break;case 3:var o=t.updateQueue;if(null!==o){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Ph(t,o,n)}break;case 5:var s=t.stateNode;if(null===n&&4&t.flags){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var u=c.memoizedState;if(null!==u){var h=u.dehydrated;null!==h&&Ps(h)}}}break;default:throw Error(Xi(163))}kf||512&t.flags&&Wf(t)}catch(d){hm(t,t.return,d)}}if(t===e){zf=null;break}if(null!==(n=t.sibling)){n.return=t.return,zf=n;break}zf=t.return}}function lp(e){for(;null!==zf;){var t=zf;if(t===e){zf=null;break}var n=t.sibling;if(null!==n){n.return=t.return,zf=n;break}zf=t.return}}function cp(e){for(;null!==zf;){var t=zf;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Gf(4,t)}catch(l){hm(t,n,l)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(l){hm(t,i,l)}}var a=t.return;try{Wf(t)}catch(l){hm(t,a,l)}break;case 5:var o=t.return;try{Wf(t)}catch(l){hm(t,o,l)}}}catch(l){hm(t,t.return,l)}if(t===e){zf=null;break}var s=t.sibling;if(null!==s){s.return=t.return,zf=s;break}zf=t.return}}var up,hp=Math.ceil,dp=sa.ReactCurrentDispatcher,fp=sa.ReactCurrentOwner,pp=sa.ReactCurrentBatchConfig,mp=0,gp=null,vp=null,yp=0,_p=0,bp=hu(0),xp=0,Sp=null,Mp=0,wp=0,Ep=0,Tp=null,Ap=null,Cp=0,Rp=1/0,Pp=null,Lp=!1,Ip=null,Np=null,Op=!1,Dp=null,Up=0,kp=0,Fp=null,zp=-1,Bp=0;function Hp(){return 6&mp?zo():-1!==zp?zp:zp=zo()}function Vp(e){return 1&e.mode?2&mp&&0!==yp?yp&-yp:null!==nh.transition?(0===Bp&&(Bp=rs()),Bp):0!==(e=ss)?e:e=void 0===(e=window.event)?16:Fs(e.type):1}function jp(e,t,n,r){if(50<kp)throw kp=0,Fp=null,Error(Xi(185));as(e,n,r),2&mp&&e===gp||(e===gp&&(!(2&mp)&&(wp|=n),4===xp&&qp(e,yp)),Gp(e,r),1===n&&0===mp&&!(1&t.mode)&&(Rp=zo()+500,Tu&&Ru()))}function Gp(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-qo(a),s=1<<o,l=i[o];-1===l?s&n&&!(s&r)||(i[o]=ts(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=es(e,e===gp?yp:0);if(0===r)null!==n&&Uo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Uo(n),1===t)0===e.tag?function(e){Tu=!0,Cu(e)}(Yp.bind(null,e)):Cu(Yp.bind(null,e)),$c((function(){!(6&mp)&&Ru()})),n=null;else{switch(ls(r)){case 1:n=Ho;break;case 4:n=Vo;break;case 16:default:n=jo;break;case 536870912:n=Wo}n=gm(n,Wp.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Wp(e,t){if(zp=-1,Bp=0,6&mp)throw Error(Xi(327));var n=e.callbackNode;if(cm()&&e.callbackNode!==n)return null;var r=es(e,e===gp?yp:0);if(0===r)return null;if(30&r||r&e.expiredLanes||t)t=rm(e,r);else{t=r;var i=mp;mp|=2;var a=tm();for(gp===e&&yp===t||(Pp=null,Rp=zo()+500,Qp(e,t));;)try{am();break}catch(s){em(e,s)}fh(),dp.current=a,mp=i,null!==vp?t=0:(gp=null,yp=0,t=xp)}if(0!==t){if(2===t&&(0!==(i=ns(e))&&(r=i,t=Xp(e,i))),1===t)throw n=Sp,Qp(e,0),qp(e,r),Gp(e,zo()),n;if(6===t)qp(e,r);else{if(i=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ql(a(),i))return!1}catch(o){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=rm(e,r),2===t&&(a=ns(e),0!==a&&(r=a,t=Xp(e,a))),1!==t)))throw n=Sp,Qp(e,0),qp(e,r),Gp(e,zo()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Xi(345));case 2:case 5:lm(e,Ap,Pp);break;case 3:if(qp(e,r),(130023424&r)===r&&10<(t=Cp+500-zo())){if(0!==es(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Hp(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Gc(lm.bind(null,e,Ap,Pp),t);break}lm(e,Ap,Pp);break;case 4:if(qp(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-qo(r);a=1<<o,(o=t[o])>i&&(i=o),r&=~a}if(r=i,10<(r=(120>(r=zo()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*hp(r/1960))-r)){e.timeoutHandle=Gc(lm.bind(null,e,Ap,Pp),r);break}lm(e,Ap,Pp);break;default:throw Error(Xi(329))}}}return Gp(e,zo()),e.callbackNode===n?Wp.bind(null,e):null}function Xp(e,t){var n=Tp;return e.current.memoizedState.isDehydrated&&(Qp(e,t).flags|=256),2!==(e=rm(e,t))&&(t=Ap,Ap=n,null!==t&&$p(t)),e}function $p(e){null===Ap?Ap=e:Ap.push.apply(Ap,e)}function qp(e,t){for(t&=~Ep,t&=~wp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qo(t),r=1<<n;e[n]=-1,t&=~r}}function Yp(e){if(6&mp)throw Error(Xi(327));cm();var t=es(e,0);if(!(1&t))return Gp(e,zo()),null;var n=rm(e,t);if(0!==e.tag&&2===n){var r=ns(e);0!==r&&(t=r,n=Xp(e,r))}if(1===n)throw n=Sp,Qp(e,0),qp(e,t),Gp(e,zo()),n;if(6===n)throw Error(Xi(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,lm(e,Ap,Pp),Gp(e,zo()),null}function Kp(e,t){var n=mp;mp|=1;try{return e(t)}finally{0===(mp=n)&&(Rp=zo()+500,Tu&&Ru())}}function Zp(e){null!==Dp&&0===Dp.tag&&!(6&mp)&&cm();var t=mp;mp|=1;var n=pp.transition,r=ss;try{if(pp.transition=null,ss=1,e)return e()}finally{ss=r,pp.transition=n,!(6&(mp=t))&&Ru()}}function Jp(){_p=bp.current,du(bp)}function Qp(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Wc(n)),null!==vp)for(n=vp.return;null!==n;){var r=n;switch(Vu(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&bu();break;case 3:kh(),du(gu),du(mu),jh();break;case 5:zh(r);break;case 4:kh();break;case 13:case 19:du(Bh);break;case 10:ph(r.type._context);break;case 22:case 23:Jp()}n=n.return}if(gp=e,vp=e=bm(e.current,null),yp=_p=t,xp=0,Sp=null,Ep=wp=Mp=0,Ap=Tp=null,null!==yh){for(t=0;t<yh.length;t++)if(null!==(r=(n=yh[t]).interleaved)){n.interleaved=null;var i=r.next,a=n.pending;if(null!==a){var o=a.next;a.next=i,r.next=o}n.pending=r}yh=null}return e}function em(e,t){for(;;){var n=vp;try{if(fh(),Gh.current=Fd,Kh){for(var r=$h.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}Kh=!1}if(Xh=0,Yh=qh=$h=null,Zh=!1,Jh=0,fp.current=null,null===n||null===n.return){xp=1,Sp=t,vp=null;break}e:{var a=e,o=n.return,s=n,l=t;if(t=yp,s.flags|=32768,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l,u=s,h=u.tag;if(!(1&u.mode||0!==h&&11!==h&&15!==h)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=nf(o);if(null!==f){f.flags&=-257,rf(f,o,s,0,t),1&f.mode&&tf(a,c,t),l=c;var p=(t=f).updateQueue;if(null===p){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}if(!(1&t)){tf(a,c,t),nm();break e}l=Error(Xi(426))}else if(Wu&&1&s.mode){var g=nf(o);if(null!==g){!(65536&g.flags)&&(g.flags|=256),rf(g,o,s,0,t),th(Yd(l,s));break e}}a=l=Yd(l,s),4!==xp&&(xp=2),null===Tp?Tp=[a]:Tp.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Ch(a,Qd(0,l,t));break e;case 1:s=l;var v=a.type,y=a.stateNode;if(!(128&a.flags||"function"!=typeof v.getDerivedStateFromError&&(null===y||"function"!=typeof y.componentDidCatch||null!==Np&&Np.has(y)))){a.flags|=65536,t&=-t,a.lanes|=t,Ch(a,ef(a,s,t));break e}}a=a.return}while(null!==a)}sm(n)}catch(_){t=_,vp===n&&null!==n&&(vp=n=n.return);continue}break}}function tm(){var e=dp.current;return dp.current=Fd,null===e?Fd:e}function nm(){0!==xp&&3!==xp&&2!==xp||(xp=4),null===gp||!(268435455&Mp)&&!(268435455&wp)||qp(gp,yp)}function rm(e,t){var n=mp;mp|=2;var r=tm();for(gp===e&&yp===t||(Pp=null,Qp(e,t));;)try{im();break}catch(i){em(e,i)}if(fh(),mp=n,dp.current=r,null!==vp)throw Error(Xi(261));return gp=null,yp=0,xp}function im(){for(;null!==vp;)om(vp)}function am(){for(;null!==vp&&!ko();)om(vp)}function om(e){var t=up(e.alternate,e,_p);e.memoizedProps=e.pendingProps,null===t?sm(e):vp=t,fp.current=null}function sm(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Df(n,t)))return n.flags&=32767,void(vp=n);if(null===e)return xp=6,void(vp=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Of(n,t,_p)))return void(vp=n);if(null!==(t=t.sibling))return void(vp=t);vp=t=e}while(null!==t);0===xp&&(xp=5)}function lm(e,t,n){var r=ss,i=pp.transition;try{pp.transition=null,ss=1,function(e,t,n,r){do{cm()}while(null!==Dp);if(6&mp)throw Error(Xi(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Xi(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-qo(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}(e,a),e===gp&&(vp=gp=null,yp=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||Op||(Op=!0,gm(jo,(function(){return cm(),null}))),a=!!(15990&n.flags),!!(15990&n.subtreeFlags)||a){a=pp.transition,pp.transition=null;var o=ss;ss=1;var s=mp;mp|=4,fp.current=null,function(e,t){if(Hc=Is,ec(e=Ql())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(b){n=null;break e}var o=0,s=-1,l=-1,c=0,u=0,h=e,d=null;t:for(;;){for(var f;h!==n||0!==i&&3!==h.nodeType||(s=o+i),h!==a||0!==r&&3!==h.nodeType||(l=o+r),3===h.nodeType&&(o+=h.nodeValue.length),null!==(f=h.firstChild);)d=h,h=f;for(;;){if(h===e)break t;if(d===n&&++c===i&&(s=o),d===a&&++u===r&&(l=o),null!==(f=h.nextSibling))break;d=(h=d).parentNode}h=f}n=-1===s||-1===l?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vc={focusedElem:e,selectionRange:n},Is=!1,zf=t;null!==zf;)if(e=(t=zf).child,1028&t.subtreeFlags&&null!==e)e.return=t,zf=e;else for(;null!==zf;){t=zf;try{var p=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==p){var m=p.memoizedProps,g=p.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Vd(t.type,m),g);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var _=t.stateNode.containerInfo;1===_.nodeType?_.textContent="":9===_.nodeType&&_.documentElement&&_.removeChild(_.documentElement);break;default:throw Error(Xi(163))}}catch(b){hm(t,t.return,b)}if(null!==(e=t.sibling)){e.return=t.return,zf=e;break}zf=t.return}p=Vf,Vf=!1}(e,n),rp(n,e),tc(Vc),Is=!!Hc,Vc=Hc=null,e.current=n,ap(n),Fo(),mp=s,ss=o,pp.transition=a}else e.current=n;if(Op&&(Op=!1,Dp=e,Up=i),a=e.pendingLanes,0===a&&(Np=null),function(e){if($o&&"function"==typeof $o.onCommitFiberRoot)try{$o.onCommitFiberRoot(Xo,e,void 0,!(128&~e.current.flags))}catch(t){}}(n.stateNode),Gp(e,zo()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Lp)throw Lp=!1,e=Ip,Ip=null,e;!!(1&Up)&&0!==e.tag&&cm(),a=e.pendingLanes,1&a?e===Fp?kp++:(kp=0,Fp=e):kp=0,Ru()}(e,t,n,r)}finally{pp.transition=i,ss=r}return null}function cm(){if(null!==Dp){var e=ls(Up),t=pp.transition,n=ss;try{if(pp.transition=null,ss=16>e?16:e,null===Dp)var r=!1;else{if(e=Dp,Dp=null,Up=0,6&mp)throw Error(Xi(331));var i=mp;for(mp|=4,zf=e.current;null!==zf;){var a=zf,o=a.child;if(16&zf.flags){var s=a.deletions;if(null!==s){for(var l=0;l<s.length;l++){var c=s[l];for(zf=c;null!==zf;){var u=zf;switch(u.tag){case 0:case 11:case 15:jf(8,u,a)}var h=u.child;if(null!==h)h.return=u,zf=h;else for(;null!==zf;){var d=(u=zf).sibling,f=u.return;if(Xf(u),u===c){zf=null;break}if(null!==d){d.return=f,zf=d;break}zf=f}}}var p=a.alternate;if(null!==p){var m=p.child;if(null!==m){p.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}zf=a}}if(2064&a.subtreeFlags&&null!==o)o.return=a,zf=o;else e:for(;null!==zf;){if(2048&(a=zf).flags)switch(a.tag){case 0:case 11:case 15:jf(9,a,a.return)}var v=a.sibling;if(null!==v){v.return=a.return,zf=v;break e}zf=a.return}}var y=e.current;for(zf=y;null!==zf;){var _=(o=zf).child;if(2064&o.subtreeFlags&&null!==_)_.return=o,zf=_;else e:for(o=y;null!==zf;){if(2048&(s=zf).flags)try{switch(s.tag){case 0:case 11:case 15:Gf(9,s)}}catch(x){hm(s,s.return,x)}if(s===o){zf=null;break e}var b=s.sibling;if(null!==b){b.return=s.return,zf=b;break e}zf=s.return}}if(mp=i,Ru(),$o&&"function"==typeof $o.onPostCommitFiberRoot)try{$o.onPostCommitFiberRoot(Xo,e)}catch(x){}r=!0}return r}finally{ss=n,pp.transition=t}}return!1}function um(e,t,n){e=Th(e,t=Qd(0,t=Yd(n,t),1),1),t=Hp(),null!==e&&(as(e,1,t),Gp(e,t))}function hm(e,t,n){if(3===e.tag)um(e,e,n);else for(;null!==t;){if(3===t.tag){um(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Np||!Np.has(r))){t=Th(t,e=ef(t,e=Yd(n,e),1),1),e=Hp(),null!==t&&(as(t,1,e),Gp(t,e));break}}t=t.return}}function dm(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Hp(),e.pingedLanes|=e.suspendedLanes&n,gp===e&&(yp&n)===n&&(4===xp||3===xp&&(130023424&yp)===yp&&500>zo()-Cp?Qp(e,0):Ep|=n),Gp(e,t)}function fm(e,t){0===t&&(1&e.mode?(t=Jo,!(130023424&(Jo<<=1))&&(Jo=4194304)):t=1);var n=Hp();null!==(e=xh(e,t))&&(as(e,t,n),Gp(e,n))}function pm(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),fm(e,n)}function mm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Xi(314))}null!==r&&r.delete(t),fm(e,n)}function gm(e,t){return Do(e,t)}function vm(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.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 ym(e,t,n,r){return new vm(e,t,n,r)}function _m(e){return!(!(e=e.prototype)||!e.isReactComponent)}function bm(e,t){var n=e.alternate;return null===n?((n=ym(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xm(e,t,n,r,i,a){var o=2;if(r=e,"function"==typeof e)_m(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case ua:return Sm(n.children,i,a,t);case ha:o=8,i|=8;break;case da:return(e=ym(12,n,t,2|i)).elementType=da,e.lanes=a,e;case ga:return(e=ym(13,n,t,i)).elementType=ga,e.lanes=a,e;case va:return(e=ym(19,n,t,i)).elementType=va,e.lanes=a,e;case ba:return Mm(n,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case fa:o=10;break e;case pa:o=9;break e;case ma:o=11;break e;case ya:o=14;break e;case _a:o=16,r=null;break e}throw Error(Xi(130,null==e?e:typeof e,""))}return(t=ym(o,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function Sm(e,t,n,r){return(e=ym(7,e,r,t)).lanes=n,e}function Mm(e,t,n,r){return(e=ym(22,e,r,t)).elementType=ba,e.lanes=n,e.stateNode={isHidden:!1},e}function wm(e,t,n){return(e=ym(6,e,null,t)).lanes=n,e}function Em(e,t,n){return(t=ym(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tm(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=is(0),this.expirationTimes=is(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=is(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Am(e,t,n,r,i,a,o,s,l){return e=new Tm(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=ym(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mh(a),e}function Cm(e){if(!e)return pu;e:{if(Po(e=e._reactInternals)!==e||1!==e.tag)throw Error(Xi(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_u(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(Xi(171))}if(1===e.tag){var n=e.type;if(_u(n))return Su(e,n,t)}return t}function Rm(e,t,n,r,i,a,o,s,l){return(e=Am(n,r,!0,e,0,a,0,s,l)).context=Cm(null),n=e.current,(a=Eh(r=Hp(),i=Vp(n))).callback=null!=t?t:null,Th(n,a,i),e.current.lanes=i,as(e,i,r),Gp(e,r),e}function Pm(e,t,n,r){var i=t.current,a=Hp(),o=Vp(i);return n=Cm(n),null===t.context?t.context=n:t.pendingContext=n,(t=Eh(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Th(i,t,o))&&(jp(e,i,o,a),Ah(e,i,o)),o}function Lm(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Im(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Nm(e,t){Im(e,t),(e=e.alternate)&&Im(e,t)}up=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||gu.current)of=!0;else{if(!(e.lanes&n||128&t.flags))return of=!1,function(e,t,n){switch(t.tag){case 3:gf(t),eh();break;case 5:Fh(t);break;case 1:_u(t.type)&&Mu(t);break;case 4:Uh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;fu(ch,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(fu(Bh,1&Bh.current),t.flags|=128,null):n&t.child.childLanes?wf(e,t,n):(fu(Bh,1&Bh.current),null!==(e=Lf(e,t,n))?e.sibling:null);fu(Bh,1&Bh.current);break;case 19:if(r=!!(n&t.childLanes),128&e.flags){if(r)return Rf(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),fu(Bh,Bh.current),r)break;return null;case 22:case 23:return t.lanes=0,hf(e,t,n)}return Lf(e,t,n)}(e,t,n);of=!!(131072&e.flags)}else of=!1,Wu&&1048576&t.flags&&Bu(t,Nu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pf(e,t),e=t.pendingProps;var i=yu(t,mu.current);gh(t,n),i=nd(null,t,r,e,i,n);var a=rd();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_u(r)?(a=!0,Mu(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Mh(t),i.updater=Gd,t.stateNode=i,i._reactInternals=t,qd(t,r,e,n),t=mf(null,t,r,!0,a,n)):(t.tag=0,Wu&&a&&Hu(t),sf(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Pf(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return _m(e)?1:0;if(null!=e){if((e=e.$$typeof)===ma)return 11;if(e===ya)return 14}return 2}(r),e=Vd(r,e),i){case 0:t=ff(null,t,r,e,n);break e;case 1:t=pf(null,t,r,e,n);break e;case 11:t=lf(null,t,r,e,n);break e;case 14:t=cf(null,t,r,Vd(r.type,e),n);break e}throw Error(Xi(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,ff(e,t,r,i=t.elementType===r?i:Vd(r,i),n);case 1:return r=t.type,i=t.pendingProps,pf(e,t,r,i=t.elementType===r?i:Vd(r,i),n);case 3:e:{if(gf(t),null===e)throw Error(Xi(387));r=t.pendingProps,i=(a=t.memoizedState).element,wh(e,t),Rh(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=vf(e,t,r,n,i=Yd(Error(Xi(423)),t));break e}if(r!==i){t=vf(e,t,r,n,i=Yd(Error(Xi(424)),t));break e}for(Gu=Kc(t.stateNode.containerInfo.firstChild),ju=t,Wu=!0,Xu=null,n=lh(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(eh(),r===i){t=Lf(e,t,n);break e}sf(e,t,r,n)}t=t.child}return t;case 5:return Fh(t),null===e&&Ku(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,jc(r,i)?o=null:null!==a&&jc(r,a)&&(t.flags|=32),df(e,t),sf(e,t,o,n),t.child;case 6:return null===e&&Ku(t),null;case 13:return wf(e,t,n);case 4:return Uh(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=sh(t,null,r,n):sf(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,lf(e,t,r,i=t.elementType===r?i:Vd(r,i),n);case 7:return sf(e,t,t.pendingProps,n),t.child;case 8:case 12:return sf(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,fu(ch,r._currentValue),r._currentValue=o,null!==a)if(ql(a.value,o)){if(a.children===i.children&&!gu.current){t=Lf(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var s=a.dependencies;if(null!==s){o=a.child;for(var l=s.firstContext;null!==l;){if(l.context===r){if(1===a.tag){(l=Eh(-1,n&-n)).tag=2;var c=a.updateQueue;if(null!==c){var u=(c=c.shared).pending;null===u?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),mh(a.return,n,t),s.lanes|=n;break}l=l.next}}else if(10===a.tag)o=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(o=a.return))throw Error(Xi(341));o.lanes|=n,null!==(s=o.alternate)&&(s.lanes|=n),mh(o,n,t),o=a.sibling}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===t){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}sf(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,gh(t,n),r=r(i=vh(i)),t.flags|=1,sf(e,t,r,n),t.child;case 14:return i=Vd(r=t.type,t.pendingProps),cf(e,t,r,i=Vd(r.type,i),n);case 15:return uf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Vd(r,i),Pf(e,t),t.tag=1,_u(r)?(e=!0,Mu(t)):e=!1,gh(t,n),Xd(t,r,i),qd(t,r,i,n),mf(null,t,r,!0,e,n);case 19:return Rf(e,t,n);case 22:return hf(e,t,n)}throw Error(Xi(156,t.tag))};var Om="function"==typeof reportError?reportError:function(e){console.error(e)};function Dm(e){this._internalRoot=e}function Um(e){this._internalRoot=e}function km(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Fm(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function zm(){}function Bm(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if("function"==typeof i){var s=i;i=function(){var e=Lm(o);s.call(e)}}Pm(t,o,e,i)}else o=function(e,t,n,r,i){if(i){if("function"==typeof r){var a=r;r=function(){var e=Lm(o);a.call(e)}}var o=Rm(t,r,e,0,null,!1,0,"",zm);return e._reactRootContainer=o,e[tu]=o.current,Rc(8===e.nodeType?e.parentNode:e),Zp(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var s=r;r=function(){var e=Lm(l);s.call(e)}}var l=Am(e,0,!1,null,0,!1,0,"",zm);return e._reactRootContainer=l,e[tu]=l.current,Rc(8===e.nodeType?e.parentNode:e),Zp((function(){Pm(t,l,n,r)})),l}(n,t,e,i,r);return Lm(o)}Um.prototype.render=Dm.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(Xi(409));Pm(e,t,null,null)},Um.prototype.unmount=Dm.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Zp((function(){Pm(null,e,null,null)})),t[tu]=null}},Um.prototype.unstable_scheduleHydration=function(e){if(e){var t=ds();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xs.length&&0!==t&&t<xs[n].priority;n++);xs.splice(n,0,e),0===n&&Es(e)}},cs=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qo(t.pendingLanes);0!==n&&(os(t,1|n),Gp(t,zo()),!(6&mp)&&(Rp=zo()+500,Ru()))}break;case 13:Zp((function(){var t=xh(e,1);if(null!==t){var n=Hp();jp(t,e,1,n)}})),Nm(e,1)}},us=function(e){if(13===e.tag){var t=xh(e,134217728);if(null!==t)jp(t,e,134217728,Hp());Nm(e,134217728)}},hs=function(e){if(13===e.tag){var t=Vp(e),n=xh(e,t);if(null!==n)jp(n,e,t,Hp());Nm(e,t)}},ds=function(){return ss},fs=function(e,t){var n=ss;try{return ss=e,t()}finally{ss=n}},co=function(e,t,n){switch(t){case"input":if(za(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=lu(r);if(!i)throw Error(Xi(90));Oa(r),za(r,i)}}}break;case"textarea":Xa(e,n);break;case"select":null!=(t=n.value)&&ja(e,!!n.multiple,t,!1)}},go=Kp,vo=Zp;var Hm={usingClientEntryPoint:!1,Events:[ou,su,lu,po,mo,Kp]},Vm={findFiberByHostInstance:au,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jm={bundleType:Vm.bundleType,version:Vm.version,rendererPackageName:Vm.rendererPackageName,rendererConfig:Vm.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=No(e))?null:e.stateNode},findFiberByHostInstance:Vm.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Gm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gm.isDisabled&&Gm.supportsFiber)try{Xo=Gm.inject(jm),$o=Gm}catch(Za){}}Bi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hm,Bi.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!km(t))throw Error(Xi(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:ca,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},Bi.createRoot=function(e,t){if(!km(e))throw Error(Xi(299));var n=!1,r="",i=Om;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Am(e,1,!1,null,0,n,0,r,i),e[tu]=t.current,Rc(8===e.nodeType?e.parentNode:e),new Dm(t)},Bi.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(Xi(188));throw e=Object.keys(e).join(","),Error(Xi(268,e))}return e=null===(e=No(t))?null:e.stateNode},Bi.flushSync=function(e){return Zp(e)},Bi.hydrate=function(e,t,n){if(!Fm(t))throw Error(Xi(200));return Bm(null,e,t,!0,n)},Bi.hydrateRoot=function(e,t,n){if(!km(e))throw Error(Xi(405));var r=null!=n&&n.hydratedSources||null,i=!1,a="",o=Om;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onRecoverableError&&(o=n.onRecoverableError)),t=Rm(t,null,e,1,null!=n?n:null,i,0,a,o),e[tu]=t.current,Rc(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Um(t)},Bi.render=function(e,t,n){if(!Fm(t))throw Error(Xi(200));return Bm(null,e,t,!1,n)},Bi.unmountComponentAtNode=function(e){if(!Fm(e))throw Error(Xi(40));return!!e._reactRootContainer&&(Zp((function(){Bm(null,null,e,!1,(function(){e._reactRootContainer=null,e[tu]=null}))})),!0)},Bi.unstable_batchedUpdates=Kp,Bi.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Fm(n))throw Error(Xi(200));if(null==e||void 0===e._reactInternals)throw Error(Xi(38));return Bm(e,t,n,!1,r)},Bi.version="18.3.1-next-f1338f8080-20240426",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),zi.exports=Bi;var Wm=zi.exports;const Xm=a(Wm);var $m,qm=oe({},r({__proto__:null,default:Xm},[Wm])),Ym=qm.version,Km=qm.render,Zm=qm.unmountComponentAtNode;try{Number((Ym||"").split(".")[0])>=18&&($m=qm.createRoot)}catch(AB){}function Jm(e){var t=qm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===ee(t)&&(t.usingClientEntryPoint=e)}var Qm="__rc_react_root__";function eg(e,t){$m?function(e,t){Jm(!0);var n=t[Qm]||$m(t);Jm(!1),n.render(e),t[Qm]=n}(e,t):function(e,t){Km(e,t)}(e,t)}function tg(e){return ng.apply(this,arguments)}function ng(){return(ng=Fi(Ui().mark((function e(t){return Ui().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then((function(){var e;null===(e=t[Qm])||void 0===e||e.unmount(),delete t[Qm]})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rg(e){Zm(e)}function ig(e){return ag.apply(this,arguments)}function ag(){return(ag=Fi(Ui().mark((function e(t){return Ui().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===$m){e.next=2;break}return e.abrupt("return",tg(t));case 2:rg(t);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function og(){}const sg=V.createContext({}),lg=()=>{const e=()=>{};return e.deprecated=og,e};var cg=V.createContext({});const ug=V.createContext(void 0);var hg={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},dg=oe(oe({},{yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const fg={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},pg={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},dg),timePickerLocale:Object.assign({},fg)},mg="${label} is not a valid ${type}",gg={locale:"en",Pagination:hg,DatePicker:pg,TimePicker:fg,Calendar:pg,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:mg,method:mg,array:mg,object:mg,number:mg,date:mg,boolean:mg,integer:mg,float:mg,regexp:mg,email:mg,url:mg,hex:mg},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};let vg=Object.assign({},gg.Modal),yg=[];const _g=()=>yg.reduce(((e,t)=>Object.assign(Object.assign({},e),t)),gg.Modal);function bg(){return vg}const xg=V.createContext(void 0),Sg=e=>{const{locale:t={},children:n,_ANT_MARK__:r}=e;V.useEffect((()=>{const e=function(e){if(e){const t=Object.assign({},e);return yg.push(t),vg=_g(),()=>{yg=yg.filter((e=>e!==t)),vg=_g()}}vg=Object.assign({},gg.Modal)}(null==t?void 0:t.Modal);return e}),[t]);const i=V.useMemo((()=>Object.assign(Object.assign({},t),{exist:!0})),[t]);return V.createElement(xg.Provider,{value:i},n)},Mg=`-ant-${Date.now()}-${Math.random()}`;function wg(e,t){const n=function(e,t){const n={},r=(e,t)=>{let n=e.clone();return n=(null==t?void 0:t(n))||n,n.toRgbString()},i=(e,t)=>{const i=new Br(e),a=$r(i.toRgbString());n[`${t}-color`]=r(i),n[`${t}-color-disabled`]=a[1],n[`${t}-color-hover`]=a[4],n[`${t}-color-active`]=a[6],n[`${t}-color-outline`]=i.clone().setAlpha(.2).toRgbString(),n[`${t}-color-deprecated-bg`]=a[0],n[`${t}-color-deprecated-border`]=a[2]};if(t.primaryColor){i(t.primaryColor,"primary");const e=new Br(t.primaryColor),a=$r(e.toRgbString());a.forEach(((e,t)=>{n[`primary-${t+1}`]=e})),n["primary-color-deprecated-l-35"]=r(e,(e=>e.lighten(35))),n["primary-color-deprecated-l-20"]=r(e,(e=>e.lighten(20))),n["primary-color-deprecated-t-20"]=r(e,(e=>e.tint(20))),n["primary-color-deprecated-t-50"]=r(e,(e=>e.tint(50))),n["primary-color-deprecated-f-12"]=r(e,(e=>e.setAlpha(.12*e.getAlpha())));const o=new Br(a[0]);n["primary-color-active-deprecated-f-30"]=r(o,(e=>e.setAlpha(.3*e.getAlpha()))),n["primary-color-active-deprecated-d-02"]=r(o,(e=>e.darken(2)))}return t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info"),`\n  :root {\n    ${Object.keys(n).map((t=>`--${e}-${t}: ${n[t]};`)).join("\n")}\n  }\n  `.trim()}(e,t);le()&&_e(n,`${Mg}-dynamic-theme`)}const Eg=V.createContext(!1),Tg=e=>{let{children:t,disabled:n}=e;const r=V.useContext(Eg);return V.createElement(Eg.Provider,{value:null!=n?n:r},t)},Ag=V.createContext(void 0),Cg=e=>{let{children:t,size:n}=e;const r=V.useContext(Ag);return V.createElement(Ag.Provider,{value:n||r},t)};const Rg=Object.assign({},G),{useId:Pg}=Rg,Lg=void 0===Pg?()=>"":Pg;var Ig,Ng={exports:{}};
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/Ig=Ng,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=r(e,n(i)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var a in n)e.call(n,a)&&n[a]&&(i=r(i,a));return i}function r(e,t){return t?e?e+" "+t:e+t:e}Ig.exports?(t.default=t,Ig.exports=t):window.classNames=t}();const Og=a(Ng.exports);function Dg(e){return e instanceof HTMLElement||e instanceof SVGElement}function Ug(e){return e&&"object"===ee(e)&&Dg(e.nativeElement)?e.nativeElement:Dg(e)?e:null}function kg(e){var t,n=Ug(e);return n||(e instanceof j.Component?null===(t=Xm.findDOMNode)||void 0===t?void 0:t.call(Xm,e):null)}var Fg=["children"],zg=V.createContext({});function Bg(e){var t=e.children,n=be(e,Fg);return V.createElement(zg.Provider,{value:n},t)}var Hg=function(){ke(t,V.Component);var e=Be(t);function t(){return Ce(this,t),e.apply(this,arguments)}return Pe(t,[{key:"render",value:function(){return this.props.children}}]),t}();var Vg="none",jg="appear",Gg="enter",Wg="leave",Xg="none",$g="prepare",qg="start",Yg="active",Kg="end",Zg="prepared";function Jg(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Qg,ev,tv,nv=(Qg=le(),ev="undefined"!=typeof window?window:{},tv={animationend:Jg("Animation","AnimationEnd"),transitionend:Jg("Transition","TransitionEnd")},Qg&&("AnimationEvent"in ev||delete tv.animationend.animation,"TransitionEvent"in ev||delete tv.transitionend.transition),tv),rv={};if(le()){var iv=document.createElement("div");rv=iv.style}var av={};function ov(e){if(av[e])return av[e];var t=nv[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var a=n[i];if(Object.prototype.hasOwnProperty.call(t,a)&&a in rv)return av[e]=t[a],av[e]}return""}var sv=ov("animationend"),lv=ov("transitionend"),cv=!(!sv||!lv),uv=sv||"animationend",hv=lv||"transitionend";function dv(e,t){return e?"object"===ee(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var fv=le()?V.useLayoutEffect:V.useEffect,pv=function(e){return+setTimeout(e,16)},mv=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(pv=function(e){return window.requestAnimationFrame(e)},mv=function(e){return window.cancelAnimationFrame(e)});var gv=0,vv=new Map;function yv(e){vv.delete(e)}var _v=function(e){var t=gv+=1;return function n(r){if(0===r)yv(t),e();else{var i=pv((function(){n(r-1)}));vv.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};_v.cancel=function(e){var t=vv.get(e);return yv(e),mv(t)};var bv=[$g,qg,Yg,Kg],xv=[$g,Zg],Sv=!1;function Mv(e){return e===Yg||e===Kg}const wv=function(e,t,n){var r=Q(In(Xg),2),i=r[0],a=r[1],o=function(){var e=V.useRef(null);function t(){_v.cancel(e.current)}return V.useEffect((function(){return function(){t()}}),[]),[function n(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var a=_v((function(){i<=1?r({isCanceled:function(){return a!==e.current}}):n(r,i-1)}));e.current=a},t]}(),s=Q(o,2),l=s[0],c=s[1];var u=t?xv:bv;return fv((function(){if(i!==Xg&&i!==Kg){var e=u.indexOf(i),t=u[e+1],r=n(i);r===Sv?a(t,!0):t&&l((function(e){function n(){e.isCanceled()||a(t,!0)}!0===r?n():Promise.resolve(r).then(n)}))}}),[e,i]),V.useEffect((function(){return function(){c()}}),[]),[function(){a($g,!0)},i]};function Ev(e,t,n,r){var i,a,o,s=r.motionEnter,l=void 0===s||s,c=r.motionAppear,u=void 0===c||c,h=r.motionLeave,d=void 0===h||h,f=r.motionDeadline,p=r.motionLeaveImmediately,m=r.onAppearPrepare,g=r.onEnterPrepare,v=r.onLeavePrepare,y=r.onAppearStart,_=r.onEnterStart,b=r.onLeaveStart,x=r.onAppearActive,S=r.onEnterActive,M=r.onLeaveActive,w=r.onAppearEnd,E=r.onEnterEnd,T=r.onLeaveEnd,A=r.onVisibleChanged,C=Q(In(),2),R=C[0],P=C[1],L=(i=Vg,a=Q(V.useReducer((function(e){return e+1}),0),2)[1],o=V.useRef(i),[Ln((function(){return o.current})),Ln((function(e){o.current="function"==typeof e?e(o.current):e,a()}))]),I=Q(L,2),N=I[0],O=I[1],D=Q(In(null),2),U=D[0],k=D[1],F=N(),z=V.useRef(!1),B=V.useRef(null);function H(){return n()}var j=V.useRef(!1);function G(){O(Vg),k(null,!0)}var W=Ln((function(e){var t=N();if(t!==Vg){var n=H();if(!e||e.deadline||e.target===n){var r,i=j.current;t===jg&&i?r=null==w?void 0:w(n,e):t===Gg&&i?r=null==E?void 0:E(n,e):t===Wg&&i&&(r=null==T?void 0:T(n,e)),i&&!1!==r&&G()}}})),X=function(e){var t=V.useRef();function n(t){t&&(t.removeEventListener(hv,e),t.removeEventListener(uv,e))}return V.useEffect((function(){return function(){n(t.current)}}),[]),[function(r){t.current&&t.current!==r&&n(t.current),r&&r!==t.current&&(r.addEventListener(hv,e),r.addEventListener(uv,e),t.current=r)},n]}(W),$=Q(X,1)[0],q=function(e){switch(e){case jg:return ne(ne(ne({},$g,m),qg,y),Yg,x);case Gg:return ne(ne(ne({},$g,g),qg,_),Yg,S);case Wg:return ne(ne(ne({},$g,v),qg,b),Yg,M);default:return{}}},Y=V.useMemo((function(){return q(F)}),[F]),K=Q(wv(F,!e,(function(e){if(e===$g){var t=Y[$g];return t?t(H()):Sv}var n;J in Y&&k((null===(n=Y[J])||void 0===n?void 0:n.call(Y,H(),null))||null);return J===Yg&&F!==Vg&&($(H()),f>0&&(clearTimeout(B.current),B.current=setTimeout((function(){W({deadline:!0})}),f))),J===Zg&&G(),true})),2),Z=K[0],J=K[1],ee=Mv(J);j.current=ee,fv((function(){P(t);var n,r=z.current;z.current=!0,!r&&t&&u&&(n=jg),r&&t&&l&&(n=Gg),(r&&!t&&d||!r&&p&&!t&&d)&&(n=Wg);var i=q(n);n&&(e||i[$g])?(O(n),Z()):O(Vg)}),[t]),V.useEffect((function(){(F===jg&&!u||F===Gg&&!l||F===Wg&&!d)&&O(Vg)}),[u,l,d]),V.useEffect((function(){return function(){z.current=!1,clearTimeout(B.current)}}),[]);var te=V.useRef(!1);V.useEffect((function(){R&&(te.current=!0),void 0!==R&&F===Vg&&((te.current||R)&&(null==A||A(R)),te.current=!0)}),[R,F]);var re=U;return Y[$g]&&J===qg&&(re=oe({transition:"none"},re)),[F,J,re,null!=R?R:t]}const Tv=function(e){var t=e;"object"===ee(e)&&(t=e.transitionSupport);var n=V.forwardRef((function(e,n){var r=e.visible,i=void 0===r||r,a=e.removeOnLeave,o=void 0===a||a,s=e.forceRender,l=e.children,c=e.motionName,u=e.leavedClassName,h=e.eventProps,d=function(e,n){return!(!e.motionName||!t||!1===n)}(e,V.useContext(zg).motion),f=V.useRef(),p=V.useRef();var m=Q(Ev(d,i,(function(){try{return f.current instanceof HTMLElement?f.current:kg(p.current)}catch(AB){return null}}),e),4),g=m[0],v=m[1],y=m[2],_=m[3],b=V.useRef(_);_&&(b.current=!0);var x,S=V.useCallback((function(e){f.current=e,Jn(n,e)}),[n]),M=oe(oe({},h),{},{visible:i});if(l)if(g===Vg)x=_?l(oe({},M),S):!o&&b.current&&u?l(oe(oe({},M),{},{className:u}),S):s||!o&&!u?l(oe(oe({},M),{},{style:{display:"none"}}),S):null;else{var w;v===$g?w="prepare":Mv(v)?w="active":v===qg&&(w="start");var E=dv(c,"".concat(g,"-").concat(w));x=l(oe(oe({},M),{},{className:Og(dv(c,g),ne(ne({},E,E&&w),c,"string"==typeof c)),style:y}),S)}else x=null;V.isValidElement(x)&&tr(x)&&(x.ref||(x=V.cloneElement(x,{ref:S})));return V.createElement(Hg,{ref:p},x)}));return n.displayName="CSSMotion",n}(cv);var Av="add",Cv="keep",Rv="remove",Pv="removed";function Lv(e){var t;return oe(oe({},t=e&&"object"===ee(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Iv(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Lv)}var Nv=["component","children","onVisibleChanged","onAllRemoved"],Ov=["status"],Dv=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];const Uv=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tv,n=function(){ke(n,V.Component);var e=Be(n);function n(){var t;Ce(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return ne($(t=e.call.apply(e,[this].concat(i))),"state",{keyEntities:[]}),ne($(t),"removeKey",(function(e){t.setState((function(t){return{keyEntities:t.keyEntities.map((function(t){return t.key!==e?t:oe(oe({},t),{},{status:Pv})}))}}),(function(){0===t.state.keyEntities.filter((function(e){return e.status!==Pv})).length&&t.props.onAllRemoved&&t.props.onAllRemoved()}))})),t}return Pe(n,[{key:"render",value:function(){var e=this,n=this.state.keyEntities,r=this.props,i=r.component,a=r.children,o=r.onVisibleChanged;r.onAllRemoved;var s=be(r,Nv),l=i||V.Fragment,c={};return Dv.forEach((function(e){c[e]=s[e],delete s[e]})),delete s.keys,V.createElement(l,s,n.map((function(n,r){var i=n.status,s=be(n,Ov),l=i===Av||i===Cv;return V.createElement(t,W({},c,{key:s.key,visible:l,eventProps:s,onVisibleChanged:function(t){null==o||o(t,{key:s.key}),t||e.removeKey(s.key)}}),(function(e,t){return a(oe(oe({},e),{},{index:r}),t)}))})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,i=Iv(n),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,a=Iv(e),o=Iv(t);a.forEach((function(e){for(var t=!1,a=r;a<i;a+=1){var s=o[a];if(s.key===e.key){r<a&&(n=n.concat(o.slice(r,a).map((function(e){return oe(oe({},e),{},{status:Av})}))),r=a),n.push(oe(oe({},s),{},{status:Cv})),r+=1,t=!0;break}}t||n.push(oe(oe({},e),{},{status:Rv}))})),r<i&&(n=n.concat(o.slice(r).map((function(e){return oe(oe({},e),{},{status:Av})}))));var s={};return n.forEach((function(e){var t=e.key;s[t]=(s[t]||0)+1})),Object.keys(s).filter((function(e){return s[e]>1})).forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==Rv}))).forEach((function(t){t.key===e&&(t.status=Cv)}))})),n}(r,i);return{keyEntities:a.filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==Pv||e.status!==Rv}))}}}]),n}();return ne(n,"defaultProps",{component:"div"}),n}(cv);function kv(e){const{children:t}=e,[,n]=Ai(),{motion:r}=n,i=V.useRef(!1);return i.current=i.current||!1===r,i.current?V.createElement(Bg,{motion:r},t):t}const Fv=()=>null;const zv=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let Bv,Hv,Vv,jv;function Gv(){return Bv||Ci}function Wv(){return Hv||Ri}const Xv=()=>({getPrefixCls:(e,t)=>t||(e?`${Gv()}-${e}`:Gv()),getIconPrefixCls:Wv,getRootPrefixCls:()=>Bv||Gv(),getTheme:()=>Vv,holderRender:jv}),$v=e=>{const{children:t,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:a,form:o,locale:s,componentSize:l,direction:c,space:u,splitter:h,virtual:d,dropdownMatchSelectWidth:f,popupMatchSelectWidth:p,popupOverflow:m,legacyLocale:g,parentContext:v,iconPrefixCls:y,theme:_,componentDisabled:b,segmented:x,statistic:S,spin:M,calendar:w,carousel:E,cascader:T,collapse:A,typography:C,checkbox:R,descriptions:P,divider:L,drawer:I,skeleton:N,steps:O,image:D,layout:U,list:k,mentions:F,modal:z,progress:B,result:H,slider:j,breadcrumb:G,menu:W,pagination:X,input:$,textArea:q,empty:Y,badge:K,radio:Z,rate:J,switch:Q,transfer:ee,avatar:te,message:ne,tag:re,table:ie,card:ae,tabs:oe,timeline:se,timePicker:le,upload:ce,notification:ue,tree:he,colorPicker:de,datePicker:fe,rangePicker:pe,flex:me,wave:ge,dropdown:ve,warning:ye,tour:_e,floatButtonGroup:be,variant:Se,inputNumber:Me,treeSelect:we}=e,Ee=V.useCallback(((t,n)=>{const{prefixCls:r}=e;if(n)return n;const i=r||v.getPrefixCls("");return t?`${i}-${t}`:i}),[v.getPrefixCls,e.prefixCls]),Te=y||v.iconPrefixCls||Ri,Ce=n||v.csp;Ii(Te,Ce);const Re=function(e,t,n){var r;lg();const i=e||{},a=!1!==i.inherit&&t?t:Object.assign(Object.assign({},vi),{hashed:null!==(r=null==t?void 0:t.hashed)&&void 0!==r?r:vi.hashed,cssVar:null==t?void 0:t.cssVar}),o=Lg();return xe((()=>{var r,s;if(!e)return t;const l=Object.assign({},a.components);Object.keys(e.components||{}).forEach((t=>{l[t]=Object.assign(Object.assign({},l[t]),e.components[t])}));const c=`css-var-${o.replace(/:/g,"")}`,u=(null!==(r=i.cssVar)&&void 0!==r?r:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:null==n?void 0:n.prefixCls},"object"==typeof a.cssVar?a.cssVar:{}),"object"==typeof i.cssVar?i.cssVar:{}),{key:"object"==typeof i.cssVar&&(null===(s=i.cssVar)||void 0===s?void 0:s.key)||c});return Object.assign(Object.assign(Object.assign({},a),i),{token:Object.assign(Object.assign({},a.token),i.token),components:l,cssVar:u})}),[i,a],((e,t)=>e.some(((e,n)=>!Ae(e,t[n],!0)))))}(_,v.theme,{prefixCls:Ee("")}),Pe={csp:Ce,autoInsertSpaceInButton:r,alert:i,anchor:a,locale:s||g,direction:c,space:u,splitter:h,virtual:d,popupMatchSelectWidth:null!=p?p:f,popupOverflow:m,getPrefixCls:Ee,iconPrefixCls:Te,theme:Re,segmented:x,statistic:S,spin:M,calendar:w,carousel:E,cascader:T,collapse:A,typography:C,checkbox:R,descriptions:P,divider:L,drawer:I,skeleton:N,steps:O,image:D,input:$,textArea:q,layout:U,list:k,mentions:F,modal:z,progress:B,result:H,slider:j,breadcrumb:G,menu:W,pagination:X,empty:Y,badge:K,radio:Z,rate:J,switch:Q,transfer:ee,avatar:te,message:ne,tag:re,table:ie,card:ae,tabs:oe,timeline:se,timePicker:le,upload:ce,notification:ue,tree:he,colorPicker:de,datePicker:fe,rangePicker:pe,flex:me,wave:ge,dropdown:ve,warning:ye,tour:_e,floatButtonGroup:be,variant:Se,inputNumber:Me,treeSelect:we},Le=Object.assign({},v);Object.keys(Pe).forEach((e=>{void 0!==Pe[e]&&(Le[e]=Pe[e])})),zv.forEach((t=>{const n=e[t];n&&(Le[t]=n)})),void 0!==r&&(Le.button=Object.assign({autoInsertSpace:r},Le.button));const Ie=xe((()=>Le),Le,((e,t)=>{const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some((n=>e[n]!==t[n]))})),Ne=V.useMemo((()=>({prefixCls:Te,csp:Ce})),[Te,Ce]);let Oe=V.createElement(V.Fragment,null,V.createElement(Fv,{dropdownMatchSelectWidth:f}),t);const De=V.useMemo((()=>{var e,t,n,r;return ur((null===(e=gg.Form)||void 0===e?void 0:e.defaultValidateMessages)||{},(null===(n=null===(t=Ie.locale)||void 0===t?void 0:t.Form)||void 0===n?void 0:n.defaultValidateMessages)||{},(null===(r=Ie.form)||void 0===r?void 0:r.validateMessages)||{},(null==o?void 0:o.validateMessages)||{})}),[Ie,null==o?void 0:o.validateMessages]);Object.keys(De).length>0&&(Oe=V.createElement(ug.Provider,{value:De},Oe)),s&&(Oe=V.createElement(Sg,{locale:s,_ANT_MARK__:"internalMark"},Oe)),(Te||Ce)&&(Oe=V.createElement(cg.Provider,{value:Ne},Oe)),l&&(Oe=V.createElement(Cg,{size:l},Oe)),Oe=V.createElement(kv,null,Oe);const Ue=V.useMemo((()=>{const e=Re||{},{algorithm:t,token:n,components:r,cssVar:i}=e,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["algorithm","token","components","cssVar"]),o=t&&(!Array.isArray(t)||t.length>0)?We(t):gi,s={};Object.entries(r||{}).forEach((e=>{let[t,n]=e;const r=Object.assign({},n);"algorithm"in r&&(!0===r.algorithm?r.theme=o:(Array.isArray(r.algorithm)||"function"==typeof r.algorithm)&&(r.theme=We(r.algorithm)),delete r.algorithm),s[t]=r}));const l=Object.assign(Object.assign({},ui),n);return Object.assign(Object.assign({},a),{theme:o,token:l,components:s,override:Object.assign({override:l},s),cssVar:i})}),[Re]);return _&&(Oe=V.createElement(yi.Provider,{value:Ue},Oe)),Ie.warning&&(Oe=V.createElement(sg.Provider,{value:Ie.warning},Oe)),void 0!==b&&(Oe=V.createElement(Tg,{disabled:b},Oe)),V.createElement(Li.Provider,{value:Ie},Oe)},qv=e=>{const t=V.useContext(Li),n=V.useContext(xg);return V.createElement($v,Object.assign({parentContext:t,legacyLocale:n},e))};qv.ConfigContext=Li,qv.SizeContext=Ag,qv.config=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:i}=e;void 0!==t&&(Bv=t),void 0!==n&&(Hv=n),"holderRender"in e&&(jv=i),r&&(!function(e){return Object.keys(e).some((e=>e.endsWith("Color")))}(r)?Vv=r:wg(Gv(),r))},qv.useConfig=function(){return{componentDisabled:V.useContext(Eg),componentSize:V.useContext(Ag)}},Object.defineProperty(qv,"SizeContext",{get:()=>Ag});var Yv={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function Kv(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}function Zv(e){return function(e){return Kv(e)instanceof ShadowRoot}(e)?Kv(e):null}function Jv(e){return"object"===ee(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===ee(e.icon)||"function"==typeof e.icon)}function Qv(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r,i=e[n];if("class"===n)t.className=i,delete t.class;else delete t[n],t[(r=n,r.replace(/-(.)/g,(function(e,t){return t.toUpperCase()})))]=i;return t}),{})}function ey(e,t,n){return n?j.createElement(e.tag,oe(oe({key:t},Qv(e.attrs)),n),(e.children||[]).map((function(n,r){return ey(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):j.createElement(e.tag,oe({key:t},Qv(e.attrs)),(e.children||[]).map((function(n,r){return ey(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function ty(e){return $r(e)[0]}function ny(e){return e?Array.isArray(e)?e:[e]:[]}var ry=["icon","className","onClick","style","primaryColor","secondaryColor"],iy={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var ay=function(e){var t,n,r,i,a,o,s,l=e.icon,c=e.className,u=e.onClick,h=e.style,d=e.primaryColor,f=e.secondaryColor,p=be(e,ry),m=V.useRef(),g=iy;if(d&&(g={primaryColor:d,secondaryColor:f||ty(d)}),t=m,n=V.useContext(cg),r=n.csp,i=n.prefixCls,a="\n.anticon {\n  display: inline-flex;\n  align-items: center;\n  color: inherit;\n  font-style: normal;\n  line-height: 0;\n  text-align: center;\n  text-transform: none;\n  vertical-align: -0.125em;\n  text-rendering: optimizeLegibility;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n  line-height: 1;\n}\n\n.anticon svg {\n  display: inline-block;\n}\n\n.anticon::before {\n  display: none;\n}\n\n.anticon .anticon-icon {\n  display: block;\n}\n\n.anticon[tabindex] {\n  cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n  display: inline-block;\n  -webkit-animation: loadingCircle 1s infinite linear;\n  animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n\n@keyframes loadingCircle {\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n",i&&(a=a.replace(/anticon/g,i)),V.useEffect((function(){var e=Zv(t.current);_e(a,"@ant-design-icons",{prepend:!0,csp:r,attachTo:e})}),[]),o=Jv(l),s="icon should be icon definiton, but got ".concat(l),Te(o,"[@ant-design/icons] ".concat(s)),!Jv(l))return null;var v=l;return v&&"function"==typeof v.icon&&(v=oe(oe({},v),{},{icon:v.icon(g.primaryColor,g.secondaryColor)})),ey(v.icon,"svg-".concat(v.name),oe(oe({className:c,onClick:u,style:h,"data-icon":v.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},p),{},{ref:m}))};function oy(e){var t=Q(ny(e),2),n=t[0],r=t[1];return ay.setTwoToneColors({primaryColor:n,secondaryColor:r})}ay.displayName="IconReact",ay.getTwoToneColors=function(){return oe({},iy)},ay.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;iy.primaryColor=t,iy.secondaryColor=n||ty(t),iy.calculated=!!n};var sy=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];oy(ri.primary);var ly=V.forwardRef((function(e,t){var n=e.className,r=e.icon,i=e.spin,a=e.rotate,o=e.tabIndex,s=e.onClick,l=e.twoToneColor,c=be(e,sy),u=V.useContext(cg),h=u.prefixCls,d=void 0===h?"anticon":h,f=u.rootClassName,p=Og(f,d,ne(ne({},"".concat(d,"-").concat(r.name),!!r.name),"".concat(d,"-spin"),!!i||"loading"===r.name),n),m=o;void 0===m&&s&&(m=-1);var g=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,v=Q(ny(l),2),y=v[0],_=v[1];return V.createElement("span",W({role:"img","aria-label":r.name},c,{ref:t,tabIndex:m,onClick:s,className:p}),V.createElement(ay,{icon:r,primaryColor:y,secondaryColor:_,style:g}))}));ly.displayName="AntdIcon",ly.getTwoToneColor=function(){var e=ay.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},ly.setTwoToneColor=oy;var cy=function(e,t){return V.createElement(ly,W({},e,{ref:t,icon:Yv}))},uy=V.forwardRef(cy),hy={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},dy=function(e,t){return V.createElement(ly,W({},e,{ref:t,icon:hy}))},fy=V.forwardRef(dy),py={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},my=function(e,t){return V.createElement(ly,W({},e,{ref:t,icon:py}))},gy=V.forwardRef(my),vy={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},yy=function(e,t){return V.createElement(ly,W({},e,{ref:t,icon:vy}))},_y=V.forwardRef(yy);const by=j.createContext(void 0),xy=100,Sy=1e3,My={Modal:xy,Drawer:xy,Popover:xy,Popconfirm:xy,Tooltip:xy,Tour:xy,FloatButton:xy},wy={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};const Ey=(e,t)=>{const[,n]=Ai(),r=j.useContext(by),i=e in My;let a;if(void 0!==t)a=[t,t];else{let o=null!=r?r:0;o+=i?(r?0:n.zIndexPopupBase)+My[e]:wy[e],a=[void 0===r?t:o,o]}return a};var Ty={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},Ay=function(e,t){return V.createElement(ly,W({},e,{ref:t,icon:Ty}))},Cy=V.forwardRef(Ay),Ry={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=Ry.F1&&t<=Ry.F12)return!1;switch(t){case Ry.ALT:case Ry.CAPS_LOCK:case Ry.CONTEXT_MENU:case Ry.CTRL:case Ry.DOWN:case Ry.END:case Ry.ESC:case Ry.HOME:case Ry.INSERT:case Ry.LEFT:case Ry.MAC_FF_META:case Ry.META:case Ry.NUMLOCK:case Ry.NUM_CENTER:case Ry.PAGE_DOWN:case Ry.PAGE_UP:case Ry.PAUSE:case Ry.PRINT_SCREEN:case Ry.RIGHT:case Ry.SHIFT:case Ry.UP:case Ry.WIN_KEY:case Ry.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=Ry.ZERO&&e<=Ry.NINE)return!0;if(e>=Ry.NUM_ZERO&&e<=Ry.NUM_MULTIPLY)return!0;if(e>=Ry.A&&e<=Ry.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case Ry.SPACE:case Ry.QUESTION_MARK:case Ry.NUM_PLUS:case Ry.NUM_MINUS:case Ry.NUM_PERIOD:case Ry.NUM_DIVISION:case Ry.SEMICOLON:case Ry.DASH:case Ry.EQUALS:case Ry.COMMA:case Ry.PERIOD:case Ry.SLASH:case Ry.APOSTROPHE:case Ry.SINGLE_QUOTE:case Ry.OPEN_SQUARE_BRACKET:case Ry.BACKSLASH:case Ry.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Py="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n    alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n    charSet checked classID className colSpan cols content contentEditable contextMenu\n    controls coords crossOrigin data dateTime default defer dir disabled download draggable\n    encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n    headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n    is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n    mediaGroup method min minLength multiple muted name noValidate nonce open\n    optimum pattern placeholder poster preload radioGroup readOnly rel required\n    reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n    shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n    summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n    onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n    onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n    onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n    onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n    onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n    onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/);function Ly(e,t){return 0===e.indexOf(t)}function Iy(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:oe({},n);var r={};return Object.keys(e).forEach((function(n){(t.aria&&("role"===n||Ly(n,"aria-"))||t.data&&Ly(n,"data-")||t.attr&&Py.includes(n))&&(r[n]=e[n])})),r}var Ny={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},Oy=function(e,t){return V.createElement(ly,W({},e,{ref:t,icon:Ny}))},Dy=V.forwardRef(Oy);const Uy=e=>{const[,,,,t]=Ai();return t?`${e}-css-var`:""};var ky=Object.prototype;var Fy=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ky)};var zy=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),By=Fy,Hy=zy,Vy=Object.prototype.hasOwnProperty;var jy=function(e){if(!By(e))return Hy(e);var t=[];for(var n in Object(e))Vy.call(e,n)&&"constructor"!=n&&t.push(n);return t},Gy="object"==typeof i&&i&&i.Object===Object&&i,Wy=Gy,Xy="object"==typeof self&&self&&self.Object===Object&&self,$y=Wy||Xy||Function("return this")(),qy=$y.Symbol,Yy=qy,Ky=Object.prototype,Zy=Ky.hasOwnProperty,Jy=Ky.toString,Qy=Yy?Yy.toStringTag:void 0;var e_=function(e){var t=Zy.call(e,Qy),n=e[Qy];try{e[Qy]=void 0;var r=!0}catch(AB){}var i=Jy.call(e);return r&&(t?e[Qy]=n:delete e[Qy]),i},t_=Object.prototype.toString;var n_=e_,r_=function(e){return t_.call(e)},i_=qy?qy.toStringTag:void 0;var a_=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i_&&i_ in Object(e)?n_(e):r_(e)};var o_=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},s_=a_,l_=o_;var c_,u_=function(e){if(!l_(e))return!1;var t=s_(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},h_=$y["__core-js_shared__"],d_=(c_=/[^.]+$/.exec(h_&&h_.keys&&h_.keys.IE_PROTO||""))?"Symbol(src)_1."+c_:"";var f_=function(e){return!!d_&&d_ in e},p_=Function.prototype.toString;var m_=function(e){if(null!=e){try{return p_.call(e)}catch(AB){}try{return e+""}catch(AB){}}return""},g_=u_,v_=f_,y_=o_,__=m_,b_=/^\[object .+?Constructor\]$/,x_=Function.prototype,S_=Object.prototype,M_=x_.toString,w_=S_.hasOwnProperty,E_=RegExp("^"+M_.call(w_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var T_=function(e){return!(!y_(e)||v_(e))&&(g_(e)?E_:b_).test(__(e))},A_=function(e,t){return null==e?void 0:e[t]};var C_=function(e,t){var n=A_(e,t);return T_(n)?n:void 0},R_=C_($y,"DataView"),P_=C_($y,"Map"),L_=C_($y,"Promise"),I_=C_($y,"Set"),N_=R_,O_=P_,D_=L_,U_=I_,k_=C_($y,"WeakMap"),F_=a_,z_=m_,B_="[object Map]",H_="[object Promise]",V_="[object Set]",j_="[object WeakMap]",G_="[object DataView]",W_=z_(N_),X_=z_(O_),$_=z_(D_),q_=z_(U_),Y_=z_(k_),K_=F_;(N_&&K_(new N_(new ArrayBuffer(1)))!=G_||O_&&K_(new O_)!=B_||D_&&K_(D_.resolve())!=H_||U_&&K_(new U_)!=V_||k_&&K_(new k_)!=j_)&&(K_=function(e){var t=F_(e),n="[object Object]"==t?e.constructor:void 0,r=n?z_(n):"";if(r)switch(r){case W_:return G_;case X_:return B_;case $_:return H_;case q_:return V_;case Y_:return j_}return t});var Z_=K_;var J_=function(e){return null!=e&&"object"==typeof e},Q_=a_,eb=J_;var tb=function(e){return eb(e)&&"[object Arguments]"==Q_(e)},nb=J_,rb=Object.prototype,ib=rb.hasOwnProperty,ab=rb.propertyIsEnumerable,ob=tb(function(){return arguments}())?tb:function(e){return nb(e)&&ib.call(e,"callee")&&!ab.call(e,"callee")},sb=Array.isArray;var lb=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},cb=u_,ub=lb;var hb=function(e){return null!=e&&ub(e.length)&&!cb(e)},db={exports:{}};var fb=function(){return!1};!function(e,t){var n=$y,r=fb,i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?n.Buffer:void 0,s=(o?o.isBuffer:void 0)||r;e.exports=s}(db,db.exports);var pb=db.exports,mb=a_,gb=lb,vb=J_,yb={};yb["[object Float32Array]"]=yb["[object Float64Array]"]=yb["[object Int8Array]"]=yb["[object Int16Array]"]=yb["[object Int32Array]"]=yb["[object Uint8Array]"]=yb["[object Uint8ClampedArray]"]=yb["[object Uint16Array]"]=yb["[object Uint32Array]"]=!0,yb["[object Arguments]"]=yb["[object Array]"]=yb["[object ArrayBuffer]"]=yb["[object Boolean]"]=yb["[object DataView]"]=yb["[object Date]"]=yb["[object Error]"]=yb["[object Function]"]=yb["[object Map]"]=yb["[object Number]"]=yb["[object Object]"]=yb["[object RegExp]"]=yb["[object Set]"]=yb["[object String]"]=yb["[object WeakMap]"]=!1;var _b=function(e){return vb(e)&&gb(e.length)&&!!yb[mb(e)]};var bb=function(e){return function(t){return e(t)}},xb={exports:{}};!function(e,t){var n=Gy,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,a=i&&i.exports===r&&n.process,o=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(AB){}}();e.exports=o}(xb,xb.exports);var Sb=xb.exports,Mb=_b,wb=bb,Eb=Sb&&Sb.isTypedArray,Tb=Eb?wb(Eb):Mb,Ab=jy,Cb=Z_,Rb=ob,Pb=sb,Lb=hb,Ib=pb,Nb=Fy,Ob=Tb,Db=Object.prototype.hasOwnProperty;const Ub=a((function(e){if(null==e)return!0;if(Lb(e)&&(Pb(e)||"string"==typeof e||"function"==typeof e.splice||Ib(e)||Ob(e)||Rb(e)))return!e.length;var t=Cb(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Nb(e))return!Ab(e).length;for(var n in e)if(Db.call(e,n))return!1;return!0})),kb=e=>{const{componentCls:t,iconCls:n,boxShadow:r,colorText:i,colorSuccess:a,colorError:o,colorWarning:s,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:h,marginXS:d,paddingXS:f,borderRadiusLG:p,zIndexPopup:m,contentPadding:g,contentBg:v}=e,y=`${t}-notice`,_=new pn("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:f,transform:"translateY(0)",opacity:1}}),b=new pn("MessageMoveOut",{"0%":{maxHeight:e.height,padding:f,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),x={padding:f,textAlign:"center",[`${t}-custom-content`]:{display:"flex",alignItems:"center"},[`${t}-custom-content > ${n}`]:{marginInlineEnd:d,fontSize:c},[`${y}-content`]:{display:"inline-block",padding:g,background:v,borderRadius:p,boxShadow:r,pointerEvents:"all"},[`${t}-success > ${n}`]:{color:a},[`${t}-error > ${n}`]:{color:o},[`${t}-warning > ${n}`]:{color:s},[`${t}-info > ${n},\n      ${t}-loading > ${n}`]:{color:l}};return[{[t]:Object.assign(Object.assign({},vn(e)),{color:i,position:"fixed",top:d,width:"100%",pointerEvents:"none",zIndex:m,[`${t}-move-up`]:{animationFillMode:"forwards"},[`\n        ${t}-move-up-appear,\n        ${t}-move-up-enter\n      `]:{animationName:_,animationDuration:h,animationPlayState:"paused",animationTimingFunction:u},[`\n        ${t}-move-up-appear${t}-move-up-appear-active,\n        ${t}-move-up-enter${t}-move-up-enter-active\n      `]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:b,animationDuration:h,animationPlayState:"paused",animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{[`${y}-wrapper`]:Object.assign({},x)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},x),{padding:0,textAlign:"start"})}]},Fb=Ni("Message",(e=>{const t=pr(e,{height:150});return[kb(t)]}),(e=>({zIndexPopup:e.zIndexPopupBase+1e3+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`})));var zb=a_,Bb=J_;var Hb=function(e){return"symbol"==typeof e||Bb(e)&&"[object Symbol]"==zb(e)},Vb=sb,jb=Hb,Gb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wb=/^\w*$/;var Xb=function(e,t){if(Vb(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!jb(e))||(Wb.test(e)||!Gb.test(e)||null!=t&&e in Object(t))},$b=C_(Object,"create"),qb=$b;var Yb=function(){this.__data__=qb?qb(null):{},this.size=0};var Kb=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zb=$b,Jb=Object.prototype.hasOwnProperty;var Qb=function(e){var t=this.__data__;if(Zb){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Jb.call(t,e)?t[e]:void 0},ex=$b,tx=Object.prototype.hasOwnProperty;var nx=$b;var rx=Yb,ix=Kb,ax=Qb,ox=function(e){var t=this.__data__;return ex?void 0!==t[e]:tx.call(t,e)},sx=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nx&&void 0===t?"__lodash_hash_undefined__":t,this};function lx(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}lx.prototype.clear=rx,lx.prototype.delete=ix,lx.prototype.get=ax,lx.prototype.has=ox,lx.prototype.set=sx;var cx=lx;var ux=function(){this.__data__=[],this.size=0};var hx=function(e,t){return e===t||e!=e&&t!=t},dx=hx;var fx=function(e,t){for(var n=e.length;n--;)if(dx(e[n][0],t))return n;return-1},px=fx,mx=Array.prototype.splice;var gx=fx;var vx=fx;var yx=fx;var _x=ux,bx=function(e){var t=this.__data__,n=px(t,e);return!(n<0)&&(n==t.length-1?t.pop():mx.call(t,n,1),--this.size,!0)},xx=function(e){var t=this.__data__,n=gx(t,e);return n<0?void 0:t[n][1]},Sx=function(e){return vx(this.__data__,e)>-1},Mx=function(e,t){var n=this.__data__,r=yx(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function wx(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wx.prototype.clear=_x,wx.prototype.delete=bx,wx.prototype.get=xx,wx.prototype.has=Sx,wx.prototype.set=Mx;var Ex=wx,Tx=cx,Ax=Ex,Cx=P_;var Rx=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Px=function(e,t){var n=e.__data__;return Rx(t)?n["string"==typeof t?"string":"hash"]:n.map},Lx=Px;var Ix=Px;var Nx=Px;var Ox=Px;var Dx=function(){this.size=0,this.__data__={hash:new Tx,map:new(Cx||Ax),string:new Tx}},Ux=function(e){var t=Lx(this,e).delete(e);return this.size-=t?1:0,t},kx=function(e){return Ix(this,e).get(e)},Fx=function(e){return Nx(this,e).has(e)},zx=function(e,t){var n=Ox(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Bx(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bx.prototype.clear=Dx,Bx.prototype.delete=Ux,Bx.prototype.get=kx,Bx.prototype.has=Fx,Bx.prototype.set=zx;var Hx=Bx,Vx=Hx;function jx(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(jx.Cache||Vx),n}jx.Cache=Vx;var Gx=jx;var Wx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xx=/\\(\\)?/g,$x=function(e){var t=Gx(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Wx,(function(e,n,r,i){t.push(r?i.replace(Xx,"$1"):n||e)})),t}));var qx=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},Yx=sb,Kx=Hb,Zx=qy?qy.prototype:void 0,Jx=Zx?Zx.toString:void 0;var Qx=function e(t){if("string"==typeof t)return t;if(Yx(t))return qx(t,e)+"";if(Kx(t))return Jx?Jx.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},eS=Qx;var tS=function(e){return null==e?"":eS(e)},nS=sb,rS=Xb,iS=$x,aS=tS;var oS=function(e,t){return nS(e)?e:rS(e,t)?[e]:iS(aS(e))},sS=Hb;var lS=function(e){if("string"==typeof e||sS(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},cS=oS,uS=lS;var hS=function(e,t){for(var n=0,r=(t=cS(t,e)).length;null!=e&&n<r;)e=e[uS(t[n++])];return n&&n==r?e:void 0},dS=hS;var fS=function(e,t,n){var r=null==e?void 0:dS(e,t);return void 0===r?n:r};const pS=a(fS);var mS=Ex;var gS=Ex,vS=P_,yS=Hx;var _S=Ex,bS=function(){this.__data__=new mS,this.size=0},xS=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},SS=function(e){return this.__data__.get(e)},MS=function(e){return this.__data__.has(e)},wS=function(e,t){var n=this.__data__;if(n instanceof gS){var r=n.__data__;if(!vS||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new yS(r)}return n.set(e,t),this.size=n.size,this};function ES(e){var t=this.__data__=new _S(e);this.size=t.size}ES.prototype.clear=bS,ES.prototype.delete=xS,ES.prototype.get=SS,ES.prototype.has=MS,ES.prototype.set=wS;var TS=ES;var AS=Hx,CS=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},RS=function(e){return this.__data__.has(e)};function PS(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new AS;++t<n;)this.add(e[t])}PS.prototype.add=PS.prototype.push=CS,PS.prototype.has=RS;var LS=PS;var IS=function(e,t){return e.has(t)},NS=LS,OS=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},DS=IS;var US=function(e,t,n,r,i,a){var o=1&n,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=2&n?new NS:void 0;for(a.set(e,t),a.set(t,e);++h<s;){var p=e[h],m=t[h];if(r)var g=o?r(m,p,h,t,e,a):r(p,m,h,e,t,a);if(void 0!==g){if(g)continue;d=!1;break}if(f){if(!OS(t,(function(e,t){if(!DS(f,t)&&(p===e||i(p,e,n,r,a)))return f.push(t)}))){d=!1;break}}else if(p!==m&&!i(p,m,n,r,a)){d=!1;break}}return a.delete(e),a.delete(t),d};var kS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},FS=$y.Uint8Array,zS=hx,BS=US,HS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},VS=kS,jS=qy?qy.prototype:void 0,GS=jS?jS.valueOf:void 0;var WS=function(e,t,n,r,i,a,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new FS(e),new FS(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return zS(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=HS;case"[object Set]":var l=1&r;if(s||(s=VS),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;r|=2,o.set(e,t);var u=BS(s(e),s(t),r,i,a,o);return o.delete(e),u;case"[object Symbol]":if(GS)return GS.call(e)==GS.call(t)}return!1};var XS=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},$S=XS,qS=sb;var YS=function(e,t,n){var r=t(e);return qS(e)?r:$S(r,n(e))};var KS=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a},ZS=function(){return[]},JS=Object.prototype.propertyIsEnumerable,QS=Object.getOwnPropertySymbols,eM=QS?function(e){return null==e?[]:(e=Object(e),KS(QS(e),(function(t){return JS.call(e,t)})))}:ZS;var tM=/^(?:0|[1-9]\d*)$/;var nM=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&tM.test(e))&&e>-1&&e%1==0&&e<t},rM=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},iM=ob,aM=sb,oM=pb,sM=nM,lM=Tb,cM=Object.prototype.hasOwnProperty;var uM=function(e,t){var n=aM(e),r=!n&&iM(e),i=!n&&!r&&oM(e),a=!n&&!r&&!i&&lM(e),o=n||r||i||a,s=o?rM(e.length,String):[],l=s.length;for(var c in e)!t&&!cM.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||sM(c,l))||s.push(c);return s},hM=jy,dM=hb;var fM=function(e){return dM(e)?uM(e):hM(e)},pM=YS,mM=eM,gM=fM;var vM=function(e){return pM(e,gM,mM)},yM=Object.prototype.hasOwnProperty;var _M=TS,bM=US,xM=WS,SM=function(e,t,n,r,i,a){var o=1&n,s=vM(e),l=s.length;if(l!=vM(t).length&&!o)return!1;for(var c=l;c--;){var u=s[c];if(!(o?u in t:yM.call(t,u)))return!1}var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var f=!0;a.set(e,t),a.set(t,e);for(var p=o;++c<l;){var m=e[u=s[c]],g=t[u];if(r)var v=o?r(g,m,u,t,e,a):r(m,g,u,e,t,a);if(!(void 0===v?m===g||i(m,g,n,r,a):v)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var y=e.constructor,_=t.constructor;y==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof _&&_ instanceof _||(f=!1)}return a.delete(e),a.delete(t),f},MM=Z_,wM=sb,EM=pb,TM=Tb,AM="[object Arguments]",CM="[object Array]",RM="[object Object]",PM=Object.prototype.hasOwnProperty;var LM=function(e,t,n,r,i,a){var o=wM(e),s=wM(t),l=o?CM:MM(e),c=s?CM:MM(t),u=(l=l==AM?RM:l)==RM,h=(c=c==AM?RM:c)==RM,d=l==c;if(d&&EM(e)){if(!EM(t))return!1;o=!0,u=!1}if(d&&!u)return a||(a=new _M),o||TM(e)?bM(e,t,n,r,i,a):xM(e,t,l,n,r,i,a);if(!(1&n)){var f=u&&PM.call(e,"__wrapped__"),p=h&&PM.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return a||(a=new _M),i(m,g,n,r,a)}}return!!d&&(a||(a=new _M),SM(e,t,n,r,i,a))},IM=J_;var NM=function e(t,n,r,i,a){return t===n||(null==t||null==n||!IM(t)&&!IM(n)?t!=t&&n!=n:LM(t,n,r,i,e,a))},OM=NM;const DM=a((function(e,t){return OM(e,t)}));var UM=C_,kM=function(){try{var e=UM(Object,"defineProperty");return e({},"",{}),e}catch(AB){}}(),FM=kM;var zM=function(e,t,n){"__proto__"==t&&FM?FM(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},BM=hx,HM=Object.prototype.hasOwnProperty;var VM=function(e,t,n){var r=e[t];HM.call(e,t)&&BM(r,n)&&(void 0!==n||t in e)||zM(e,t,n)},jM=oS,GM=nM,WM=o_,XM=lS;var $M=hS,qM=function(e,t,n,r){if(!WM(e))return e;for(var i=-1,a=(t=jM(t,e)).length,o=a-1,s=e;null!=s&&++i<a;){var l=XM(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=o){var u=s[l];void 0===(c=r?r(u,l,s):void 0)&&(c=WM(u)?u:GM(t[i+1])?[]:{})}VM(s,l,c),s=s[l]}return e},YM=oS;var KM=oS,ZM=ob,JM=sb,QM=nM,ew=lb,tw=lS;var nw=function(e,t){return null!=e&&t in Object(e)},rw=function(e,t,n){for(var r=-1,i=(t=KM(t,e)).length,a=!1;++r<i;){var o=tw(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&ew(i)&&QM(o,i)&&(JM(e)||ZM(e))};var iw=function(e,t){return null!=e&&rw(e,t,nw)},aw=function(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=$M(e,o);n(s,o)&&qM(a,YM(o,e),s)}return a},ow=iw;var sw=function(e,t){return aw(e,t,(function(t,n){return ow(e,n)}))},lw=ob,cw=sb,uw=qy?qy.isConcatSpreadable:void 0;var hw=XS,dw=function(e){return cw(e)||lw(e)||!!(uw&&e&&e[uw])};var fw=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||(r=dw),a||(a=[]);++o<s;){var l=t[o];n>0&&r(l)?n>1?e(l,n-1,r,i,a):hw(a,l):i||(a[a.length]=l)}return a},pw=fw;var mw=function(e){return(null==e?0:e.length)?pw(e,1):[]};var gw=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},vw=Math.max;var yw=function(e,t,n){return t=vw(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=vw(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),gw(e,this,s)}};var _w=function(e){return e},bw=function(e){return function(){return e}},xw=kM,Sw=xw?function(e,t){return xw(e,"toString",{configurable:!0,enumerable:!1,value:bw(t),writable:!0})}:_w,Mw=Date.now;var ww=function(e){var t=0,n=0;return function(){var r=Mw(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Sw),Ew=mw,Tw=yw,Aw=ww;var Cw=sw;const Rw=a(function(e){return Aw(Tw(e,void 0,Ew),e+"")}((function(e,t){return null==e?{}:Cw(e,t)}))),Pw=j.createContext({});var Lw=V.forwardRef((function(e,t){var n=e.prefixCls,r=e.style,i=e.className,a=e.duration,o=void 0===a?4.5:a,s=e.showProgress,l=e.pauseOnHover,c=void 0===l||l,u=e.eventKey,h=e.content,d=e.closable,f=e.closeIcon,p=void 0===f?"x":f,m=e.props,g=e.onClick,v=e.onNoticeClose,y=e.times,_=e.hovering,b=Q(V.useState(!1),2),x=b[0],S=b[1],M=Q(V.useState(0),2),w=M[0],E=M[1],T=Q(V.useState(0),2),A=T[0],C=T[1],R=_||x,P=o>0&&s,L=function(){v(u)};V.useEffect((function(){if(!R&&o>0){var e=Date.now()-A,t=setTimeout((function(){L()}),1e3*o-A);return function(){c&&clearTimeout(t),C(Date.now()-e)}}}),[o,R,y]),V.useEffect((function(){if(!R&&P&&(c||0===A)){var e,t=performance.now();return function n(){cancelAnimationFrame(e),e=requestAnimationFrame((function(e){var r=e+A-t,i=Math.min(r/(1e3*o),1);E(100*i),i<1&&n()}))}(),function(){c&&cancelAnimationFrame(e)}}}),[o,A,R,P,y]);var I=V.useMemo((function(){return"object"===ee(d)&&null!==d?d:d?{closeIcon:p}:{}}),[d,p]),N=Iy(I,!0),O=100-(!w||w<0?0:w>100?100:w),D="".concat(n,"-notice");return V.createElement("div",W({},m,{ref:t,className:Og(D,i,ne({},"".concat(D,"-closable"),d)),style:r,onMouseEnter:function(e){var t;S(!0),null==m||null===(t=m.onMouseEnter)||void 0===t||t.call(m,e)},onMouseLeave:function(e){var t;S(!1),null==m||null===(t=m.onMouseLeave)||void 0===t||t.call(m,e)},onClick:g}),V.createElement("div",{className:"".concat(D,"-content")},h),d&&V.createElement("a",W({tabIndex:0,className:"".concat(D,"-close"),onKeyDown:function(e){"Enter"!==e.key&&"Enter"!==e.code&&e.keyCode!==Ry.ENTER||L()},"aria-label":"Close"},N,{onClick:function(e){e.preventDefault(),e.stopPropagation(),L()}}),I.closeIcon),P&&V.createElement("progress",{className:"".concat(D,"-progress"),max:"100",value:O},O+"%"))})),Iw=j.createContext({}),Nw=function(e){var t=e.children,n=e.classNames;return j.createElement(Iw.Provider,{value:{classNames:n}},t)},Ow=["className","style","classNames","styles"],Dw=function(e){var t,n,r,i,a,o=e.configList,s=e.placement,l=e.prefixCls,c=e.className,u=e.style,h=e.motion,d=e.onAllNoticeRemoved,f=e.onNoticeClose,p=e.stack,m=V.useContext(Iw).classNames,g=V.useRef({}),v=Q(V.useState(null),2),y=v[0],_=v[1],b=Q(V.useState([]),2),x=b[0],S=b[1],M=o.map((function(e){return{config:e,key:String(e.key)}})),w=Q((a={offset:8,threshold:3,gap:16},(t=p)&&"object"===ee(t)&&(a.offset=null!==(n=t.offset)&&void 0!==n?n:8,a.threshold=null!==(r=t.threshold)&&void 0!==r?r:3,a.gap=null!==(i=t.gap)&&void 0!==i?i:16),[!!t,a]),2),E=w[0],T=w[1],A=T.offset,C=T.threshold,R=T.gap,P=E&&(x.length>0||M.length<=C),L="function"==typeof h?h(s):h;return V.useEffect((function(){E&&x.length>1&&S((function(e){return e.filter((function(e){return M.some((function(t){var n=t.key;return e===n}))}))}))}),[x,M,E]),V.useEffect((function(){var e,t;E&&g.current[null===(e=M[M.length-1])||void 0===e?void 0:e.key]&&_(g.current[null===(t=M[M.length-1])||void 0===t?void 0:t.key])}),[M,E]),j.createElement(Uv,W({key:s,className:Og(l,"".concat(l,"-").concat(s),null==m?void 0:m.list,c,ne(ne({},"".concat(l,"-stack"),!!E),"".concat(l,"-stack-expanded"),P)),style:u,keys:M,motionAppear:!0},L,{onAllRemoved:function(){d(s)}}),(function(e,t){var n=e.config,r=e.className,i=e.style,a=e.index,o=n,c=o.key,u=o.times,h=String(c),d=n,p=d.className,v=d.style,_=d.classNames,b=d.styles,w=be(d,Ow),T=M.findIndex((function(e){return e.key===h})),C={};if(E){var L=M.length-1-(T>-1?T:a-1),I="top"===s||"bottom"===s?"-50%":"0";if(L>0){var N,O,D;C.height=P?null===(N=g.current[h])||void 0===N?void 0:N.offsetHeight:null==y?void 0:y.offsetHeight;for(var U=0,k=0;k<L;k++){var F;U+=(null===(F=g.current[M[M.length-1-k].key])||void 0===F?void 0:F.offsetHeight)+R}var z=(P?U:L*A)*(s.startsWith("top")?1:-1),B=!P&&null!=y&&y.offsetWidth&&null!==(O=g.current[h])&&void 0!==O&&O.offsetWidth?((null==y?void 0:y.offsetWidth)-2*A*(L<3?L:3))/(null===(D=g.current[h])||void 0===D?void 0:D.offsetWidth):1;C.transform="translate3d(".concat(I,", ").concat(z,"px, 0) scaleX(").concat(B,")")}else C.transform="translate3d(".concat(I,", 0, 0)")}return j.createElement("div",{ref:t,className:Og("".concat(l,"-notice-wrapper"),r,null==_?void 0:_.wrapper),style:oe(oe(oe({},i),C),null==b?void 0:b.wrapper),onMouseEnter:function(){return S((function(e){return e.includes(h)?e:[].concat(ie(e),[h])}))},onMouseLeave:function(){return S((function(e){return e.filter((function(e){return e!==h}))}))}},j.createElement(Lw,W({},w,{ref:function(e){T>-1?g.current[h]=e:delete g.current[h]},prefixCls:l,classNames:_,styles:b,className:Og(p,null==m?void 0:m.notice),style:v,times:u,key:c,eventKey:c,onNoticeClose:f,hovering:E&&x.length>0})))}))},Uw=V.forwardRef((function(e,t){var n=e.prefixCls,r=void 0===n?"rc-notification":n,i=e.container,a=e.motion,o=e.maxCount,s=e.className,l=e.style,c=e.onAllRemoved,u=e.stack,h=e.renderNotifications,d=Q(V.useState([]),2),f=d[0],p=d[1],m=function(e){var t,n=f.find((function(t){return t.key===e}));null==n||null===(t=n.onClose)||void 0===t||t.call(n),p((function(t){return t.filter((function(t){return t.key!==e}))}))};V.useImperativeHandle(t,(function(){return{open:function(e){p((function(t){var n,r=ie(t),i=r.findIndex((function(t){return t.key===e.key})),a=oe({},e);i>=0?(a.times=((null===(n=t[i])||void 0===n?void 0:n.times)||0)+1,r[i]=a):(a.times=0,r.push(a));return o>0&&r.length>o&&(r=r.slice(-o)),r}))},close:function(e){m(e)},destroy:function(){p([])}}}));var g=Q(V.useState({}),2),v=g[0],y=g[1];V.useEffect((function(){var e={};f.forEach((function(t){var n=t.placement,r=void 0===n?"topRight":n;r&&(e[r]=e[r]||[],e[r].push(t))})),Object.keys(v).forEach((function(t){e[t]=e[t]||[]})),y(e)}),[f]);var _=function(e){y((function(t){var n=oe({},t);return(n[e]||[]).length||delete n[e],n}))},b=V.useRef(!1);if(V.useEffect((function(){Object.keys(v).length>0?b.current=!0:b.current&&(null==c||c(),b.current=!1)}),[v]),!i)return null;var x=Object.keys(v);return Wm.createPortal(V.createElement(V.Fragment,null,x.map((function(e){var t=v[e],n=V.createElement(Dw,{key:e,configList:t,placement:e,prefixCls:r,className:null==s?void 0:s(e),style:null==l?void 0:l(e),motion:a,onNoticeClose:m,onAllNoticeRemoved:_,stack:u});return h?h(n,{prefixCls:r,key:e}):n}))),i)})),kw=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],Fw=function(){return document.body},zw=0;function Bw(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getContainer,n=void 0===t?Fw:t,r=e.motion,i=e.prefixCls,a=e.maxCount,o=e.className,s=e.style,l=e.onAllRemoved,c=e.stack,u=e.renderNotifications,h=be(e,kw),d=Q(V.useState(),2),f=d[0],p=d[1],m=V.useRef(),g=V.createElement(Uw,{container:f,ref:m,prefixCls:i,motion:r,maxCount:a,className:o,style:s,onAllRemoved:l,stack:c,renderNotifications:u}),v=Q(V.useState([]),2),y=v[0],_=v[1],b=V.useMemo((function(){return{open:function(e){var t=function(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){t&&Object.keys(t).forEach((function(n){var r=t[n];void 0!==r&&(e[n]=r)}))})),e}(h,e);null!==t.key&&void 0!==t.key||(t.key="rc-notification-".concat(zw),zw+=1),_((function(e){return[].concat(ie(e),[{type:"open",config:t}])}))},close:function(e){_((function(t){return[].concat(ie(t),[{type:"close",key:e}])}))},destroy:function(){_((function(e){return[].concat(ie(e),[{type:"destroy"}])}))}}}),[]);return V.useEffect((function(){p(n())})),V.useEffect((function(){m.current&&y.length&&(y.forEach((function(e){switch(e.type){case"open":m.current.open(e.config);break;case"close":m.current.close(e.key);break;case"destroy":m.current.destroy()}})),_((function(e){return e.filter((function(e){return!y.includes(e)}))})))}),[y]),[b,g]}const Hw={info:V.createElement(_y,null),success:V.createElement(uy,null),error:V.createElement(fy,null),warning:V.createElement(gy,null),loading:V.createElement(Cy,null)},Vw=e=>{let{prefixCls:t,type:n,icon:r,children:i}=e;return V.createElement("div",{className:Og(`${t}-custom-content`,`${t}-${n}`)},r||Hw[n],V.createElement("span",null,i))};function jw(e){let t;const n=new Promise((n=>{t=e((()=>{n(!0)}))})),r=()=>{null==t||t()};return r.then=(e,t)=>n.then(e,t),r.promise=n,r}const Gw=3,Ww=e=>{let{children:t,prefixCls:n}=e;const r=Uy(n),[i,a,o]=Fb(n,r);return i(V.createElement(Nw,{classNames:{list:Og(a,o,r)}},t))},Xw=(e,t)=>{let{prefixCls:n,key:r}=t;return V.createElement(Ww,{prefixCls:n,key:r},e)},$w=V.forwardRef(((e,t)=>{const{top:n,prefixCls:r,getContainer:i,maxCount:a,duration:o=Gw,rtl:s,transitionName:l,onAllRemoved:c}=e,{getPrefixCls:u,getPopupContainer:h,message:d,direction:f}=V.useContext(Li),p=r||u("message"),m=V.createElement("span",{className:`${p}-close-x`},V.createElement(Dy,{className:`${p}-close-icon`})),[g,v]=Bw({prefixCls:p,style:()=>({left:"50%",transform:"translateX(-50%)",top:null!=n?n:8}),className:()=>Og({[`${p}-rtl`]:null!=s?s:"rtl"===f}),motion:()=>function(e,t){return{motionName:null!=t?t:`${e}-move-up`}}(p,l),closable:!1,closeIcon:m,duration:o,getContainer:()=>(null==i?void 0:i())||(null==h?void 0:h())||document.body,maxCount:a,onAllRemoved:c,renderNotifications:Xw});return V.useImperativeHandle(t,(()=>Object.assign(Object.assign({},g),{prefixCls:p,message:d}))),v}));let qw=0;function Yw(e){const t=V.useRef(null);lg();return[V.useMemo((()=>{const e=e=>{var n;null===(n=t.current)||void 0===n||n.close(e)},n=n=>{if(!t.current){const e=()=>{};return e.then=()=>{},e}const{open:r,prefixCls:i,message:a}=t.current,o=`${i}-notice`,{content:s,icon:l,type:c,key:u,className:h,style:d,onClose:f}=n,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,["content","icon","type","key","className","style","onClose"]);let m=u;return null==m&&(qw+=1,m=`antd-message-${qw}`),jw((t=>(r(Object.assign(Object.assign({},p),{key:m,content:V.createElement(Vw,{prefixCls:i,type:c,icon:l},s),placement:"top",className:Og(c&&`${o}-${c}`,h,null==a?void 0:a.className),style:Object.assign(Object.assign({},null==a?void 0:a.style),d),onClose:()=>{null==f||f(),t()}})),()=>{e(m)})))},r={open:n,destroy:n=>{var r;void 0!==n?e(n):null===(r=t.current)||void 0===r||r.destroy()}};return["info","success","warning","error","loading"].forEach((e=>{r[e]=(t,r,i)=>{let a,o,s;a=t&&"object"==typeof t&&"content"in t?t:{content:t},"function"==typeof r?s=r:(o=r,s=i);const l=Object.assign(Object.assign({onClose:s,duration:o},a),{type:e});return n(l)}})),r}),[]),V.createElement($w,Object.assign({key:"message-holder"},e,{ref:t}))]}let Kw=null,Zw=e=>e(),Jw=[],Qw={};function eE(){const{getContainer:e,duration:t,rtl:n,maxCount:r,top:i}=Qw,a=(null==e?void 0:e())||document.body;return{getContainer:()=>a,duration:t,rtl:n,maxCount:r,top:i}}const tE=j.forwardRef(((e,t)=>{const{messageConfig:n,sync:r}=e,{getPrefixCls:i}=V.useContext(Li),a=Qw.prefixCls||i("message"),o=V.useContext(Pw),[s,l]=Yw(Object.assign(Object.assign(Object.assign({},n),{prefixCls:a}),o.message));return j.useImperativeHandle(t,(()=>{const e=Object.assign({},s);return Object.keys(e).forEach((t=>{e[t]=function(){return r(),s[t].apply(s,arguments)}})),{instance:e,sync:r}})),l})),nE=j.forwardRef(((e,t)=>{const[n,r]=j.useState(eE),i=()=>{r(eE)};j.useEffect(i,[]);const a=Xv(),o=a.getRootPrefixCls(),s=a.getIconPrefixCls(),l=a.getTheme(),c=j.createElement(tE,{ref:t,sync:i,messageConfig:n});return j.createElement(qv,{prefixCls:o,iconPrefixCls:s,theme:l},a.holderRender?a.holderRender(c):c)}));function rE(){if(!Kw){const e=document.createDocumentFragment(),t={fragment:e};return Kw=t,void Zw((()=>{eg(j.createElement(nE,{ref:e=>{const{instance:n,sync:r}=e||{};Promise.resolve().then((()=>{!t.instance&&n&&(t.instance=n,t.sync=r,rE())}))}}),e)}))}Kw.instance&&(Jw.forEach((e=>{const{type:t,skipped:n}=e;if(!n)switch(t){case"open":Zw((()=>{const t=Kw.instance.open(Object.assign(Object.assign({},Qw),e.config));null==t||t.then(e.resolve),e.setCloseFn(t)}));break;case"destroy":Zw((()=>{null==Kw||Kw.instance.destroy(e.key)}));break;default:Zw((()=>{var n;const r=(n=Kw.instance)[t].apply(n,ie(e.args));null==r||r.then(e.resolve),e.setCloseFn(r)}))}})),Jw=[])}const iE={open:function(e){const t=jw((t=>{let n;const r={type:"open",config:e,resolve:t,setCloseFn:e=>{n=e}};return Jw.push(r),()=>{n?Zw((()=>{n()})):r.skipped=!0}}));return rE(),t},destroy:e=>{Jw.push({type:"destroy",key:e}),rE()},config:function(e){Qw=Object.assign(Object.assign({},Qw),e),Zw((()=>{var e;null===(e=null==Kw?void 0:Kw.sync)||void 0===e||e.call(Kw)}))},useMessage:function(e){return Yw(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{const{prefixCls:t,className:n,type:r,icon:i,content:a}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:s}=V.useContext(Li),l=t||s("message"),c=Uy(l),[u,h,d]=Fb(l,c);return u(V.createElement(Lw,Object.assign({},o,{prefixCls:l,className:Og(n,h,`${l}-notice-pure-panel`,d,c),eventKey:"pure",duration:null,content:V.createElement(Vw,{prefixCls:l,type:r,icon:i},a)})))}};["success","info","warning","error","loading"].forEach((e=>{iE[e]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){const n=jw((n=>{let r;const i={type:e,args:t,resolve:n,setCloseFn:e=>{r=e}};return Jw.push(i),()=>{r?Zw((()=>{r()})):i.skipped=!0}}));return rE(),n}(e,n)}}));
/**
 * @license
 * Copyright 2010-2024 Three.js Authors
 * SPDX-License-Identifier: MIT
 */
const aE="167",oE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},sE={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lE=0,cE=1,uE=2,hE=0,dE=1,fE=100,pE=101,mE=102,gE=200,vE=201,yE=202,_E=203,bE=204,xE=205,SE=206,ME=207,wE=208,EE=209,TE=210,AE=211,CE=212,RE=213,PE=214,LE="attached",IE=301,NE=302,OE=303,DE=306,UE=1e3,kE=1001,FE=1002,zE=1003,BE=1004,HE=1005,VE=1006,jE=1007,GE=1008,WE=1009,XE=1010,$E=1011,qE=1012,YE=1013,KE=1014,ZE=1015,JE=1016,QE=1017,eT=1018,tT=1020,nT=35902,rT=1023,iT=1026,aT=1027,oT=1028,sT=1029,lT=1031,cT=1033,uT=33776,hT=33777,dT=33778,fT=33779,pT=35840,mT=35841,gT=35842,vT=35843,yT=36196,_T=37492,bT=37496,xT=37808,ST=37809,MT=37810,wT=37811,ET=37812,TT=37813,AT=37814,CT=37815,RT=37816,PT=37817,LT=37818,IT=37819,NT=37820,OT=37821,DT=36492,UT=36494,kT=36495,FT=36284,zT=36285,BT=36286,HT=2300,VT=2301,jT=2302,GT=2400,WT=2401,XT=2402,$T=2500,qT=0,YT=1,KT=2,ZT="",JT="srgb",QT="srgb-linear",eA="display-p3",tA="display-p3-linear",nA="linear",rA="srgb",iA="rec709",aA="p3",oA=7680,sA=512,lA=513,cA=514,uA=515,hA=516,dA=517,fA=518,pA=519,mA=35044,gA="300 es",vA=2e3,yA=2001;class _A{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const bA=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let xA=1234567;const SA=Math.PI/180,MA=180/Math.PI;function wA(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(bA[255&e]+bA[e>>8&255]+bA[e>>16&255]+bA[e>>24&255]+"-"+bA[255&t]+bA[t>>8&255]+"-"+bA[t>>16&15|64]+bA[t>>24&255]+"-"+bA[63&n|128]+bA[n>>8&255]+"-"+bA[n>>16&255]+bA[n>>24&255]+bA[255&r]+bA[r>>8&255]+bA[r>>16&255]+bA[r>>24&255]).toLowerCase()}function EA(e,t,n){return Math.max(t,Math.min(n,e))}function TA(e,t){return(e%t+t)%t}function AA(e,t,n){return(1-n)*e+n*t}function CA(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 new Error("Invalid component type.")}}function RA(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const PA={DEG2RAD:SA,RAD2DEG:MA,generateUUID:wA,clamp:EA,euclideanModulo:TA,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:AA,damp:function(e,t,n,r){return AA(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(TA(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(xA=e);let t=xA+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*SA},radToDeg:function(e){return e*MA},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((t+r)/2),u=o((t+r)/2),h=a((t-r)/2),d=o((t-r)/2),f=a((r-t)/2),p=o((r-t)/2);switch(i){case"XYX":e.set(s*u,l*h,l*d,s*c);break;case"YZY":e.set(l*d,s*u,l*h,s*c);break;case"ZXZ":e.set(l*h,l*d,s*u,s*c);break;case"XZX":e.set(s*u,l*p,l*f,s*c);break;case"YXY":e.set(l*f,s*u,l*p,s*c);break;case"ZYZ":e.set(l*p,l*f,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:RA,denormalize:CA};class LA{constructor(e=0,t=0){LA.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}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){const 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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(EA(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),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}}class IA{constructor(e,t,n,r,i,a,o,s,l){IA.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,o,s,l)}set(e,t,n,r,i,a,o,s,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=r[0],m=r[3],g=r[6],v=r[1],y=r[4],_=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*p+o*v+s*b,i[3]=a*m+o*y+s*x,i[6]=a*g+o*_+s*S,i[1]=l*p+c*v+u*b,i[4]=l*m+c*y+u*x,i[7]=l*g+c*_+u*S,i[2]=h*p+d*v+f*b,i[5]=h*m+d*y+f*x,i[8]=h*g+d*_+f*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*i*c+n*o*s+r*i*l-r*a*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=c*a-o*l,h=o*s-c*i,d=l*i-a*s,f=t*u+n*h+r*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return e[0]=u*p,e[1]=(r*l-c*n)*p,e[2]=(o*n-r*a)*p,e[3]=h*p,e[4]=(c*t-r*s)*p,e[5]=(r*i-o*t)*p,e[6]=d*p,e[7]=(n*s-l*t)*p,e[8]=(a*t-n*i)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(NA.makeScale(e,t)),this}rotate(e){return this.premultiply(NA.makeRotation(-e)),this}translate(e,t){return this.premultiply(NA.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const NA=new IA;function OA(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function DA(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function UA(){const e=DA("canvas");return e.style.display="block",e}const kA={};function FA(e){e in kA||(kA[e]=!0,console.warn(e))}const zA=(new IA).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),BA=(new IA).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),HA={[QT]:{transfer:nA,primaries:iA,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e,fromReference:e=>e},[JT]:{transfer:rA,primaries:iA,luminanceCoefficients:[.2126,.7152,.0722],toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[tA]:{transfer:nA,primaries:aA,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.applyMatrix3(BA),fromReference:e=>e.applyMatrix3(zA)},[eA]:{transfer:rA,primaries:aA,luminanceCoefficients:[.2289,.6917,.0793],toReference:e=>e.convertSRGBToLinear().applyMatrix3(BA),fromReference:e=>e.applyMatrix3(zA).convertLinearToSRGB()}},VA=new Set([QT,tA]),jA={enabled:!0,_workingColorSpace:QT,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!VA.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const r=HA[t].toReference;return(0,HA[n].fromReference)(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return HA[e].primaries},getTransfer:function(e){return e===ZT?nA:HA[e].transfer},getLuminanceCoefficients:function(e,t=this._workingColorSpace){return e.fromArray(HA[t].luminanceCoefficients)}};function GA(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function WA(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let XA;class $A{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===XA&&(XA=DA("canvas")),XA.width=e.width,XA.height=e.height;const n=XA.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=XA}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=DA("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*GA(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*GA(t[e]/255)):t[e]=GA(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let qA=0;class YA{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:qA++}),this.uuid=wA(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(KA(r[t].image)):e.push(KA(r[t]))}else e=KA(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function KA(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?$A.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ZA=0;class JA extends _A{constructor(e=JA.DEFAULT_IMAGE,t=JA.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,l=JA.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ZA++}),this.uuid=wA(),this.name="",this.source=new YA(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new LA(0,0),this.repeat=new LA(1,1),this.center=new LA(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new IA,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case UE:e.x=e.x-Math.floor(e.x);break;case kE:e.x=e.x<0?0:1;break;case FE:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case UE:e.y=e.y-Math.floor(e.y);break;case kE:e.y=e.y<0?0:1;break;case FE:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}JA.DEFAULT_IMAGE=null,JA.DEFAULT_MAPPING=300,JA.DEFAULT_ANISOTROPY=1;class QA{constructor(e=0,t=0,n=0,r=1){QA.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}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 new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,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}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const a=.01,o=.1,s=e.elements,l=s[0],c=s[4],u=s[8],h=s[1],d=s[5],f=s[9],p=s[2],m=s[6],g=s[10];if(Math.abs(c-h)<a&&Math.abs(u-p)<a&&Math.abs(f-m)<a){if(Math.abs(c+h)<o&&Math.abs(u+p)<o&&Math.abs(f+m)<o&&Math.abs(l+d+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,s=(d+1)/2,v=(g+1)/2,y=(c+h)/4,_=(u+p)/4,b=(f+m)/4;return e>s&&e>v?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=y/n,i=_/n):s>v?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=y/r,i=b/r):v<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(v),n=_/i,r=b/i),this.set(n,r,i,t),this}let v=Math.sqrt((m-f)*(m-f)+(u-p)*(u-p)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-f)/v,this.y=(u-p)/v,this.z=(h-c)/v,this.w=Math.acos((l+d+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class eC extends _A{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new QA(0,0,e,t),this.scissorTest=!1,this.viewport=new QA(0,0,e,t);const r={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:VE,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const i=new JA(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);i.flipY=!1,i.generateMipmaps=n.generateMipmaps,i.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=i.clone(),this.textures[o].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}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.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 n=0,r=e.textures.length;n<r;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new YA(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class tC extends eC{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class nC extends JA{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=zE,this.minFilter=zE,this.wrapR=kE,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class rC extends JA{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=zE,this.minFilter=zE,this.wrapR=kE,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class iC{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],l=n[r+1],c=n[r+2],u=n[r+3];const h=i[a+0],d=i[a+1],f=i[a+2],p=i[a+3];if(0===o)return e[t+0]=s,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===o)return e[t+0]=h,e[t+1]=d,e[t+2]=f,void(e[t+3]=p);if(u!==p||s!==h||l!==d||c!==f){let e=1-o;const t=s*h+l*d+c*f+u*p,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*e+h*i,l=l*e+d*i,c=c*e+f*i,u=u*e+p*i,e===1-o){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){const o=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[a],h=i[a+1],d=i[a+2],f=i[a+3];return e[t]=o*f+c*u+s*d-l*h,e[t+1]=s*f+c*h+l*u-o*d,e[t+2]=l*f+c*d+o*h-s*u,e[t+3]=c*f-o*u-s*h-l*d,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){const n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),h=s(n/2),d=s(r/2),f=s(i/2);switch(a){case"XYZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"YXZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"ZXY":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"ZYX":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"YZX":this._x=h*c*u+l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u-h*d*f;break;case"XZY":this._x=h*c*u-l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const 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){const t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],u=t[10],h=n+o+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-s)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>o&&n>u){const e=2*Math.sqrt(1+n-o-u);this._w=(c-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-n-u);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(s+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(EA(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const 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 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}const l=Math.sqrt(s),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,h=Math.sin(t*c)/l;return this._w=a*u+this._w*h,this._x=n*u+this._x*h,this._y=r*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),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}}class aC{constructor(e=0,t=0,n=0){aC.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(sC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(sC.setFromAxisAngle(e,t))}applyMatrix3(e){const 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){const 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){const t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=2*(a*r-o*n),c=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*l+a*u-o*c,this.y=n+s*c+o*l-i*u,this.z=r+s*u+i*c-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,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){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return oC.copy(this).projectOnVector(e),this.sub(oC)}reflect(e){return this.sub(oC.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(EA(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const 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){const 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){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),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,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const oC=new aC,sC=new iC;class lC{constructor(e=new aC(1/0,1/0,1/0),t=new aC(-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(uC.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(uC.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=uC.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,uC):uC.fromBufferAttribute(r,t),uC.applyMatrix4(e.matrixWorld),this.expandByPoint(uC);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),hC.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),hC.copy(n.boundingBox)),hC.applyMatrix4(e.matrixWorld),this.union(hC)}const r=e.children;for(let i=0,a=r.length;i<a;i++)this.expandByObject(r[i],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,uC),uC.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(yC),_C.subVectors(this.max,yC),dC.subVectors(e.a,yC),fC.subVectors(e.b,yC),pC.subVectors(e.c,yC),mC.subVectors(fC,dC),gC.subVectors(pC,fC),vC.subVectors(dC,pC);let t=[0,-mC.z,mC.y,0,-gC.z,gC.y,0,-vC.z,vC.y,mC.z,0,-mC.x,gC.z,0,-gC.x,vC.z,0,-vC.x,-mC.y,mC.x,0,-gC.y,gC.x,0,-vC.y,vC.x,0];return!!SC(t,dC,fC,pC,_C)&&(t=[1,0,0,0,1,0,0,0,1],!!SC(t,dC,fC,pC,_C)&&(bC.crossVectors(mC,gC),t=[bC.x,bC.y,bC.z],SC(t,dC,fC,pC,_C)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,uC).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(uC).length()),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()||(cC[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),cC[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),cC[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),cC[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),cC[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),cC[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),cC[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),cC[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(cC)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const cC=[new aC,new aC,new aC,new aC,new aC,new aC,new aC,new aC],uC=new aC,hC=new lC,dC=new aC,fC=new aC,pC=new aC,mC=new aC,gC=new aC,vC=new aC,yC=new aC,_C=new aC,bC=new aC,xC=new aC;function SC(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){xC.fromArray(e,a);const o=i.x*Math.abs(xC.x)+i.y*Math.abs(xC.y)+i.z*Math.abs(xC.z),s=t.dot(xC),l=n.dot(xC),c=r.dot(xC);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>o)return!1}return!0}const MC=new lC,wC=new aC,EC=new aC;class TC{constructor(e=new aC,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):MC.setFromPoints(e).getCenter(n);let r=0;for(let i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));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){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;wC.subVectors(e,this.center);const t=wC.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(wC,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(EC.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(wC.copy(e.center).add(EC)),this.expandByPoint(wC.copy(e.center).sub(EC))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const AC=new aC,CC=new aC,RC=new aC,PC=new aC,LC=new aC,IC=new aC,NC=new aC;class OC{constructor(e=new aC,t=new aC(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,AC)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=AC.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(AC.copy(this.origin).addScaledVector(this.direction,t),AC.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){CC.copy(e).add(t).multiplyScalar(.5),RC.copy(t).sub(e).normalize(),PC.copy(this.origin).sub(CC);const i=.5*e.distanceTo(t),a=-this.direction.dot(RC),o=PC.dot(this.direction),s=-PC.dot(RC),l=PC.lengthSq(),c=Math.abs(1-a*a);let u,h,d,f;if(c>0)if(u=a*s-o,h=a*o-s,f=i*c,u>=0)if(h>=-f)if(h<=f){const e=1/c;u*=e,h*=e,d=u*(u+a*h+2*o)+h*(a*u+h+2*s)+l}else h=i,u=Math.max(0,-(a*h+o)),d=-u*u+h*(h+2*s)+l;else h=-i,u=Math.max(0,-(a*h+o)),d=-u*u+h*(h+2*s)+l;else h<=-f?(u=Math.max(0,-(-a*i+o)),h=u>0?-i:Math.min(Math.max(-i,-s),i),d=-u*u+h*(h+2*s)+l):h<=f?(u=0,h=Math.min(Math.max(-i,-s),i),d=h*(h+2*s)+l):(u=Math.max(0,-(a*i+o)),h=u>0?i:Math.min(Math.max(-i,-s),i),d=-u*u+h*(h+2*s)+l);else h=a>0?-i:i,u=Math.max(0,-(a*h+o)),d=-u*u+h*(h+2*s)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(CC).addScaledVector(RC,h),d}intersectSphere(e,t){AC.subVectors(e.center,this.origin);const n=AC.dot(this.direction),r=AC.dot(AC)-n*n,i=e.radius*e.radius;if(r>i)return null;const 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 this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r?null:((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 null!==this.intersectBox(e,AC)}intersectTriangle(e,t,n,r,i){LC.subVectors(t,e),IC.subVectors(n,e),NC.crossVectors(LC,IC);let a,o=this.direction.dot(NC);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}PC.subVectors(this.origin,e);const s=a*this.direction.dot(IC.crossVectors(PC,IC));if(s<0)return null;const l=a*this.direction.dot(LC.cross(PC));if(l<0)return null;if(s+l>o)return null;const c=-a*PC.dot(NC);return c<0?null:this.at(c/o,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)}}class DC{constructor(e,t,n,r,i,a,o,s,l,c,u,h,d,f,p,m){DC.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,o,s,l,c,u,h,d,f,p,m)}set(e,t,n,r,i,a,o,s,l,c,u,h,d,f,p,m){const 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]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,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 DC).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/UC.setFromMatrixColumn(e,0).length(),i=1/UC.setFromMatrixColumn(e,1).length(),a=1/UC.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){const t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*c,t[9]=i-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=a*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*c,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(FC,e,zC)}lookAt(e,t,n){const r=this.elements;return VC.subVectors(e,t),0===VC.lengthSq()&&(VC.z=1),VC.normalize(),BC.crossVectors(n,VC),0===BC.lengthSq()&&(1===Math.abs(n.z)?VC.x+=1e-4:VC.z+=1e-4,VC.normalize(),BC.crossVectors(n,VC)),BC.normalize(),HC.crossVectors(VC,BC),r[0]=BC.x,r[4]=HC.x,r[8]=VC.x,r[1]=BC.y,r[5]=HC.y,r[9]=VC.y,r[2]=BC.z,r[6]=HC.z,r[10]=VC.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],_=n[11],b=n[15],x=r[0],S=r[4],M=r[8],w=r[12],E=r[1],T=r[5],A=r[9],C=r[13],R=r[2],P=r[6],L=r[10],I=r[14],N=r[3],O=r[7],D=r[11],U=r[15];return i[0]=a*x+o*E+s*R+l*N,i[4]=a*S+o*T+s*P+l*O,i[8]=a*M+o*A+s*L+l*D,i[12]=a*w+o*C+s*I+l*U,i[1]=c*x+u*E+h*R+d*N,i[5]=c*S+u*T+h*P+d*O,i[9]=c*M+u*A+h*L+d*D,i[13]=c*w+u*C+h*I+d*U,i[2]=f*x+p*E+m*R+g*N,i[6]=f*S+p*T+m*P+g*O,i[10]=f*M+p*A+m*L+g*D,i[14]=f*w+p*C+m*I+g*U,i[3]=v*x+y*E+_*R+b*N,i[7]=v*S+y*T+_*P+b*O,i[11]=v*M+y*A+_*L+b*D,i[15]=v*w+y*C+_*I+b*U,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*l*u-i*o*h+n*l*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*l*h+i*a*h-r*a*d+r*l*c-i*s*c)+e[11]*(+t*l*u-t*o*d-i*a*u+n*a*d+i*o*c-n*l*c)+e[15]*(-r*o*c-t*s*u+t*o*h+r*a*u-n*a*h+n*s*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const 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(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=u*m*l-p*h*l+p*s*d-o*m*d-u*s*g+o*h*g,y=f*h*l-c*m*l-f*s*d+a*m*d+c*s*g-a*h*g,_=c*p*l-f*u*l+f*o*d-a*p*d-c*o*g+a*u*g,b=f*u*s-c*p*s-f*o*h+a*p*h+c*o*m-a*u*m,x=t*v+n*y+r*_+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/x;return e[0]=v*S,e[1]=(p*h*i-u*m*i-p*r*d+n*m*d+u*r*g-n*h*g)*S,e[2]=(o*m*i-p*s*i+p*r*l-n*m*l-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*h*i-u*r*l+n*h*l+o*r*d-n*s*d)*S,e[4]=y*S,e[5]=(c*m*i-f*h*i+f*r*d-t*m*d-c*r*g+t*h*g)*S,e[6]=(f*s*i-a*m*i-f*r*l+t*m*l+a*r*g-t*s*g)*S,e[7]=(a*h*i-c*s*i+c*r*l-t*h*l-a*r*d+t*s*d)*S,e[8]=_*S,e[9]=(f*u*i-c*p*i-f*n*d+t*p*d+c*n*g-t*u*g)*S,e[10]=(a*p*i-f*o*i+f*n*l-t*p*l-a*n*g+t*o*g)*S,e[11]=(c*o*i-a*u*i-c*n*l+t*u*l+a*n*d-t*o*d)*S,e[12]=b*S,e[13]=(c*p*r-f*u*r+f*n*h-t*p*h-c*n*m+t*u*m)*S,e[14]=(f*o*r-a*p*r-f*n*s+t*p*s+a*n*m-t*o*m)*S,e[15]=(a*u*r-c*o*r+c*n*s-t*u*s-a*n*h+t*o*h)*S,this}scale(e){const 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(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],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){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,c*o+n,c*s-r*a,0,l*s-r*o,c*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){const r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,u=o+o,h=i*l,d=i*c,f=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,_=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(p+g))*b,r[1]=(d+_)*b,r[2]=(f-y)*b,r[3]=0,r[4]=(d-_)*x,r[5]=(1-(h+g))*x,r[6]=(m+v)*x,r[7]=0,r[8]=(f+y)*S,r[9]=(m-v)*S,r[10]=(1-(h+p))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=UC.set(r[0],r[1],r[2]).length();const a=UC.set(r[4],r[5],r[6]).length(),o=UC.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],kC.copy(this);const s=1/i,l=1/a,c=1/o;return kC.elements[0]*=s,kC.elements[1]*=s,kC.elements[2]*=s,kC.elements[4]*=l,kC.elements[5]*=l,kC.elements[6]*=l,kC.elements[8]*=c,kC.elements[9]*=c,kC.elements[10]*=c,t.setFromRotationMatrix(kC),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=2e3){const s=this.elements,l=2*i/(t-e),c=2*i/(n-r),u=(t+e)/(t-e),h=(n+r)/(n-r);let d,f;if(o===vA)d=-(a+i)/(a-i),f=-2*a*i/(a-i);else{if(o!==yA)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);d=-a/(a-i),f=-a*i/(a-i)}return s[0]=l,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=c,s[9]=h,s[13]=0,s[2]=0,s[6]=0,s[10]=d,s[14]=f,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=2e3){const s=this.elements,l=1/(t-e),c=1/(n-r),u=1/(a-i),h=(t+e)*l,d=(n+r)*c;let f,p;if(o===vA)f=(a+i)*u,p=-2*u;else{if(o!==yA)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);f=i*u,p=-1*u}return s[0]=2*l,s[4]=0,s[8]=0,s[12]=-h,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-d,s[2]=0,s[6]=0,s[10]=p,s[14]=-f,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const UC=new aC,kC=new DC,FC=new aC(0,0,0),zC=new aC(1,1,1),BC=new aC,HC=new aC,VC=new aC,jC=new DC,GC=new iC;class WC{constructor(e=0,t=0,n=0,r=WC.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}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){const r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],l=r[5],c=r[9],u=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(EA(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-EA(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(EA(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-EA(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(EA(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-EA(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return jC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(jC,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return GC.setFromEuler(this),this.setFromQuaternion(GC,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],void 0!==e[3]&&(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}}WC.DEFAULT_ORDER="XYZ";class XC{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return!!(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let $C=0;const qC=new aC,YC=new iC,KC=new DC,ZC=new aC,JC=new aC,QC=new aC,eR=new iC,tR=new aC(1,0,0),nR=new aC(0,1,0),rR=new aC(0,0,1),iR={type:"added"},aR={type:"removed"},oR={type:"childadded",child:null},sR={type:"childremoved",child:null};class lR extends _A{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:$C++}),this.uuid=wA(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=lR.DEFAULT_UP.clone();const e=new aC,t=new WC,n=new iC,r=new aC(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new DC},normalMatrix:{value:new IA}}),this.matrix=new DC,this.matrixWorld=new DC,this.matrixAutoUpdate=lR.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=lR.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new XC,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],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 YC.setFromAxisAngle(e,t),this.quaternion.multiply(YC),this}rotateOnWorldAxis(e,t){return YC.setFromAxisAngle(e,t),this.quaternion.premultiply(YC),this}rotateX(e){return this.rotateOnAxis(tR,e)}rotateY(e){return this.rotateOnAxis(nR,e)}rotateZ(e){return this.rotateOnAxis(rR,e)}translateOnAxis(e,t){return qC.copy(e).applyQuaternion(this.quaternion),this.position.add(qC.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(tR,e)}translateY(e){return this.translateOnAxis(nR,e)}translateZ(e){return this.translateOnAxis(rR,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(KC.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ZC.copy(e):ZC.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),JC.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?KC.lookAt(JC,ZC,this.up):KC.lookAt(ZC,JC,this.up),this.quaternion.setFromRotationMatrix(KC),r&&(KC.extractRotation(r.matrixWorld),YC.setFromRotationMatrix(KC),this.quaternion.premultiply(YC.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(iR),oR.child=e,this.dispatchEvent(oR),oR.child=null):console.error("THREE.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}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(aR),sR.child=e,this.dispatchEvent(sR),sR.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),KC.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),KC.multiply(e.parent.matrixWorld)),e.applyMatrix4(KC),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(iR),oR.child=e,this.dispatchEvent(oR),oR.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++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const 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(JC,e,QC),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(JC,eR,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(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)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++){t[n].updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){e[t].updateWorldMatrix(!1,!0)}}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(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(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(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.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}))),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),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&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const 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++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),l=a(e.skeletons),c=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),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){const t=[];for(const n in e){const 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)),!0===t)for(let n=0;n<e.children.length;n++){const t=e.children[n];this.add(t.clone())}return this}}lR.DEFAULT_UP=new aC(0,1,0),lR.DEFAULT_MATRIX_AUTO_UPDATE=!0,lR.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const cR=new aC,uR=new aC,hR=new aC,dR=new aC,fR=new aC,pR=new aC,mR=new aC,gR=new aC,vR=new aC,yR=new aC;class _R{constructor(e=new aC,t=new aC,n=new aC){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),cR.subVectors(e,t),r.cross(cR);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){cR.subVectors(r,t),uR.subVectors(n,t),hR.subVectors(e,t);const a=cR.dot(cR),o=cR.dot(uR),s=cR.dot(hR),l=uR.dot(uR),c=uR.dot(hR),u=a*l-o*o;if(0===u)return i.set(0,0,0),null;const h=1/u,d=(l*s-o*c)*h,f=(a*c-o*s)*h;return i.set(1-d-f,f,d)}static containsPoint(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,dR)&&(dR.x>=0&&dR.y>=0&&dR.x+dR.y<=1)}static getInterpolation(e,t,n,r,i,a,o,s){return null===this.getBarycoord(e,t,n,r,dR)?(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,dR.x),s.addScaledVector(a,dR.y),s.addScaledVector(o,dR.z),s)}static isFrontFacing(e,t,n,r){return cR.subVectors(n,t),uR.subVectors(e,t),cR.cross(uR).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 cR.subVectors(this.c,this.b),uR.subVectors(this.a,this.b),.5*cR.cross(uR).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return _R.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return _R.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return _R.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return _R.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return _R.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let a,o;fR.subVectors(r,n),pR.subVectors(i,n),gR.subVectors(e,n);const s=fR.dot(gR),l=pR.dot(gR);if(s<=0&&l<=0)return t.copy(n);vR.subVectors(e,r);const c=fR.dot(vR),u=pR.dot(vR);if(c>=0&&u<=c)return t.copy(r);const h=s*u-c*l;if(h<=0&&s>=0&&c<=0)return a=s/(s-c),t.copy(n).addScaledVector(fR,a);yR.subVectors(e,i);const d=fR.dot(yR),f=pR.dot(yR);if(f>=0&&d<=f)return t.copy(i);const p=d*l-s*f;if(p<=0&&l>=0&&f<=0)return o=l/(l-f),t.copy(n).addScaledVector(pR,o);const m=c*f-d*u;if(m<=0&&u-c>=0&&d-f>=0)return mR.subVectors(i,r),o=(u-c)/(u-c+(d-f)),t.copy(r).addScaledVector(mR,o);const g=1/(m+p+h);return a=p*g,o=h*g,t.copy(n).addScaledVector(fR,a).addScaledVector(pR,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const bR={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},xR={h:0,s:0,l:0},SR={h:0,s:0,l:0};function MR(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class wR{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(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&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=JT){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,jA.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=jA.workingColorSpace){return this.r=e,this.g=t,this.b=n,jA.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=jA.workingColorSpace){if(e=TA(e,1),t=EA(t,0,1),n=EA(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=MR(i,r,e+1/3),this.g=MR(i,r,e),this.b=MR(i,r,e-1/3)}return jA.toWorkingColorSpace(this,r),this}setStyle(e,t=JT){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const 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:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===i)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=JT){const n=bR[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=GA(e.r),this.g=GA(e.g),this.b=GA(e.b),this}copyLinearToSRGB(e){return this.r=WA(e.r),this.g=WA(e.g),this.b=WA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=JT){return jA.fromWorkingColorSpace(ER.copy(this),e),65536*Math.round(EA(255*ER.r,0,255))+256*Math.round(EA(255*ER.g,0,255))+Math.round(EA(255*ER.b,0,255))}getHexString(e=JT){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=jA.workingColorSpace){jA.fromWorkingColorSpace(ER.copy(this),t);const n=ER.r,r=ER.g,i=ER.b,a=Math.max(n,r,i),o=Math.min(n,r,i);let s,l;const c=(o+a)/2;if(o===a)s=0,l=0;else{const e=a-o;switch(l=c<=.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}s/=6}return e.h=s,e.s=l,e.l=c,e}getRGB(e,t=jA.workingColorSpace){return jA.fromWorkingColorSpace(ER.copy(this),t),e.r=ER.r,e.g=ER.g,e.b=ER.b,e}getStyle(e=JT){jA.fromWorkingColorSpace(ER.copy(this),e);const t=ER.r,n=ER.g,r=ER.b;return e!==JT?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(xR),this.setHSL(xR.h+e,xR.s+t,xR.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(xR),e.getHSL(SR);const n=AA(xR.h,SR.h,t),r=AA(xR.s,SR.s,t),i=AA(xR.l,SR.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){const 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}}const ER=new wR;wR.NAMES=bR;let TR=0;class AR extends _A{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:TR++}),this.uuid=wA(),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=fE,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new wR(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=oA,this.stencilZFail=oA,this.stencilZPass=oA,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.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}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(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()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(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),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(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,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==fE&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==oA&&(n.stencilFail=this.stencilFail),this.stencilZFail!==oA&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==oA&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const 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;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new 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.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class CR extends AR{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new wR(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 WC,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}}const RR=new aC,PR=new LA;class LR{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=mA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ZE,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return FA("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)PR.fromBufferAttribute(this,t),PR.applyMatrix3(e),this.setXY(t,PR.x,PR.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)RR.fromBufferAttribute(this,t),RR.applyMatrix3(e),this.setXYZ(t,RR.x,RR.y,RR.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)RR.fromBufferAttribute(this,t),RR.applyMatrix4(e),this.setXYZ(t,RR.x,RR.y,RR.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)RR.fromBufferAttribute(this,t),RR.applyNormalMatrix(e),this.setXYZ(t,RR.x,RR.y,RR.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)RR.fromBufferAttribute(this,t),RR.transformDirection(e),this.setXYZ(t,RR.x,RR.y,RR.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=CA(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=RA(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=CA(t,this.array)),t}setX(e,t){return this.normalized&&(t=RA(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=CA(t,this.array)),t}setY(e,t){return this.normalized&&(t=RA(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=CA(t,this.array)),t}setZ(e,t){return this.normalized&&(t=RA(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=CA(t,this.array)),t}setW(e,t){return this.normalized&&(t=RA(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=RA(t,this.array),n=RA(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=RA(t,this.array),n=RA(n,this.array),r=RA(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=RA(t,this.array),n=RA(n,this.array),r=RA(r,this.array),i=RA(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(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==mA&&(e.usage=this.usage),e}}class IR extends LR{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class NR extends LR{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class OR extends LR{constructor(e,t,n){super(new Float32Array(e),t,n)}}let DR=0;const UR=new DC,kR=new lR,FR=new aC,zR=new lC,BR=new lC,HR=new aC;class VR extends _A{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:DR++}),this.uuid=wA(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(OA(e)?NR:IR)(e,1):this.index=e,this}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 void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new IA).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return UR.makeRotationFromQuaternion(e),this.applyMatrix4(UR),this}rotateX(e){return UR.makeRotationX(e),this.applyMatrix4(UR),this}rotateY(e){return UR.makeRotationY(e),this.applyMatrix4(UR),this}rotateZ(e){return UR.makeRotationZ(e),this.applyMatrix4(UR),this}translate(e,t,n){return UR.makeTranslation(e,t,n),this.applyMatrix4(UR),this}scale(e,t,n){return UR.makeScale(e,t,n),this.applyMatrix4(UR),this}lookAt(e){return kR.lookAt(e),kR.updateMatrix(),this.applyMatrix4(kR.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(FR).negate(),this.translate(FR.x,FR.y,FR.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new OR(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new lC);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new aC(-1/0,-1/0,-1/0),new aC(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const e=t[n];zR.setFromBufferAttribute(e),this.morphTargetsRelative?(HR.addVectors(this.boundingBox.min,zR.min),this.boundingBox.expandByPoint(HR),HR.addVectors(this.boundingBox.max,zR.max),this.boundingBox.expandByPoint(HR)):(this.boundingBox.expandByPoint(zR.min),this.boundingBox.expandByPoint(zR.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new TC);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new aC,1/0);if(e){const n=this.boundingSphere.center;if(zR.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const n=t[e];BR.setFromBufferAttribute(n),this.morphTargetsRelative?(HR.addVectors(zR.min,BR.min),zR.expandByPoint(HR),HR.addVectors(zR.max,BR.max),zR.expandByPoint(HR)):(zR.expandByPoint(BR.min),zR.expandByPoint(BR.max))}zR.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)HR.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(HR));if(t)for(let i=0,a=t.length;i<a;i++){const a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)HR.fromBufferAttribute(a,t),o&&(FR.fromBufferAttribute(e,t),HR.add(FR)),r=Math.max(r,n.distanceToSquared(HR))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.position,r=t.normal,i=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new LR(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],s=[];for(let M=0;M<n.count;M++)o[M]=new aC,s[M]=new aC;const l=new aC,c=new aC,u=new aC,h=new LA,d=new LA,f=new LA,p=new aC,m=new aC;function g(e,t,r){l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),h.fromBufferAttribute(i,e),d.fromBufferAttribute(i,t),f.fromBufferAttribute(i,r),c.sub(l),u.sub(l),d.sub(h),f.sub(h);const a=1/(d.x*f.y-f.x*d.y);isFinite(a)&&(p.copy(c).multiplyScalar(f.y).addScaledVector(u,-d.y).multiplyScalar(a),m.copy(u).multiplyScalar(d.x).addScaledVector(c,-f.x).multiplyScalar(a),o[e].add(p),o[t].add(p),o[r].add(p),s[e].add(m),s[t].add(m),s[r].add(m))}let v=this.groups;0===v.length&&(v=[{start:0,count:e.count}]);for(let M=0,w=v.length;M<w;++M){const t=v[M],n=t.start;for(let r=n,i=n+t.count;r<i;r+=3)g(e.getX(r+0),e.getX(r+1),e.getX(r+2))}const y=new aC,_=new aC,b=new aC,x=new aC;function S(e){b.fromBufferAttribute(r,e),x.copy(b);const t=o[e];y.copy(t),y.sub(b.multiplyScalar(b.dot(t))).normalize(),_.crossVectors(x,t);const n=_.dot(s[e])<0?-1:1;a.setXYZW(e,y.x,y.y,y.z,n)}for(let M=0,w=v.length;M<w;++M){const t=v[M],n=t.start;for(let r=n,i=n+t.count;r<i;r+=3)S(e.getX(r+0)),S(e.getX(r+1)),S(e.getX(r+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new LR(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new aC,i=new aC,a=new aC,o=new aC,s=new aC,l=new aC,c=new aC,u=new aC;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),f=e.getX(h+1),p=e.getX(h+2);r.fromBufferAttribute(t,d),i.fromBufferAttribute(t,f),a.fromBufferAttribute(t,p),c.subVectors(a,i),u.subVectors(r,i),c.cross(u),o.fromBufferAttribute(n,d),s.fromBufferAttribute(n,f),l.fromBufferAttribute(n,p),o.add(c),s.add(c),l.add(c),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,h=t.count;e<h;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,i),u.subVectors(r,i),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)HR.fromBufferAttribute(e,t),HR.normalize(),e.setXYZ(t,HR.x,HR.y,HR.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r);let o=0,s=0;for(let l=0,c=t.length;l<c;l++){o=e.isInterleavedBufferAttribute?t[l]*e.data.stride+e.offset:t[l]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new LR(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new VR,n=this.index.array,r=this.attributes;for(const o in r){const i=e(r[o],n);t.setAttribute(o,i)}const i=this.morphAttributes;for(const o in i){const r=[],a=i[o];for(let t=0,i=a.length;t<i;t++){const i=e(a[t],n);r.push(i)}t.morphAttributes[o]=r}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,s=a.length;o<s;o++){const e=a[o];t.addGroup(e.start,e.count,e.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const s in n){const t=n[s];e.data.attributes[s]=t.toJSON(e.data)}const r={};let i=!1;for(const s in this.morphAttributes){const t=this.morphAttributes[s],n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n.push(i.toJSON(e.data))}n.length>0&&(r[s]=n,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const l in r){const e=r[l];this.setAttribute(l,e.clone(t))}const i=e.morphAttributes;for(const l in i){const e=[],n=i[l];for(let r=0,i=n.length;r<i;r++)e.push(n[r].clone(t));this.morphAttributes[l]=e}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let l=0,c=a.length;l<c;l++){const e=a[l];this.addGroup(e.start,e.count,e.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=e.boundingSphere;return null!==s&&(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"})}}const jR=new DC,GR=new OC,WR=new TC,XR=new aC,$R=new aC,qR=new aC,YR=new aC,KR=new aC,ZR=new aC,JR=new LA,QR=new LA,eP=new LA,tP=new aC,nP=new aC,rP=new aC,iP=new aC,aP=new aC;class oP extends lR{constructor(e=new VR,t=new CR){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(i&&o){ZR.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=o[n],s=i[n];0!==r&&(KR.fromBufferAttribute(s,e),a?ZR.addScaledVector(KR,r):ZR.addScaledVector(KR.sub(t),r))}t.add(ZR)}return t}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),WR.copy(n.boundingSphere),WR.applyMatrix4(i),GR.copy(e.ray).recast(e.near),!1===WR.containsPoint(GR.origin)){if(null===GR.intersectSphere(WR,XR))return;if(GR.origin.distanceToSquared(XR)>(e.far-e.near)**2)return}jR.copy(i).invert(),GR.copy(e.ray).applyMatrix4(jR),null!==n.boundingBox&&!1===GR.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,GR)}}_computeIntersections(e,t,n){let r;const i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,l=i.attributes.uv,c=i.attributes.uv1,u=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==o)if(Array.isArray(a))for(let f=0,p=h.length;f<p;f++){const i=h[f],s=a[i.materialIndex];for(let a=Math.max(i.start,d.start),h=Math.min(o.count,Math.min(i.start+i.count,d.start+d.count));a<h;a+=3){r=sP(this,s,e,n,l,c,u,o.getX(a),o.getX(a+1),o.getX(a+2)),r&&(r.faceIndex=Math.floor(a/3),r.face.materialIndex=i.materialIndex,t.push(r))}}else{for(let i=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);i<s;i+=3){r=sP(this,a,e,n,l,c,u,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}else if(void 0!==s)if(Array.isArray(a))for(let f=0,p=h.length;f<p;f++){const i=h[f],o=a[i.materialIndex];for(let a=Math.max(i.start,d.start),h=Math.min(s.count,Math.min(i.start+i.count,d.start+d.count));a<h;a+=3){r=sP(this,o,e,n,l,c,u,a,a+1,a+2),r&&(r.faceIndex=Math.floor(a/3),r.face.materialIndex=i.materialIndex,t.push(r))}}else{for(let i=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);i<o;i+=3){r=sP(this,a,e,n,l,c,u,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}}}function sP(e,t,n,r,i,a,o,s,l,c){e.getVertexPosition(s,$R),e.getVertexPosition(l,qR),e.getVertexPosition(c,YR);const u=function(e,t,n,r,i,a,o,s){let l;if(l=1===t.side?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,0===t.side,s),null===l)return null;aP.copy(s),aP.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(aP);return c<n.near||c>n.far?null:{distance:c,point:aP.clone(),object:e}}(e,t,n,r,$R,qR,YR,iP);if(u){i&&(JR.fromBufferAttribute(i,s),QR.fromBufferAttribute(i,l),eP.fromBufferAttribute(i,c),u.uv=_R.getInterpolation(iP,$R,qR,YR,JR,QR,eP,new LA)),a&&(JR.fromBufferAttribute(a,s),QR.fromBufferAttribute(a,l),eP.fromBufferAttribute(a,c),u.uv1=_R.getInterpolation(iP,$R,qR,YR,JR,QR,eP,new LA)),o&&(tP.fromBufferAttribute(o,s),nP.fromBufferAttribute(o,l),rP.fromBufferAttribute(o,c),u.normal=_R.getInterpolation(iP,$R,qR,YR,tP,nP,rP,new aC),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const e={a:s,b:l,c:c,normal:new aC,materialIndex:0};_R.getNormal($R,qR,YR,e.normal),u.face=e}return u}class lP extends VR{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};const o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],l=[],c=[],u=[];let h=0,d=0;function f(e,t,n,r,i,a,f,p,m,g,v){const y=a/m,_=f/g,b=a/2,x=f/2,S=p/2,M=m+1,w=g+1;let E=0,T=0;const A=new aC;for(let o=0;o<w;o++){const a=o*_-x;for(let s=0;s<M;s++){const h=s*y-b;A[e]=h*r,A[t]=a*i,A[n]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=p>0?1:-1,c.push(A.x,A.y,A.z),u.push(s/m),u.push(1-o/g),E+=1}}for(let o=0;o<g;o++)for(let e=0;e<m;e++){const t=h+e+M*o,n=h+e+M*(o+1),r=h+(e+1)+M*(o+1),i=h+(e+1)+M*o;s.push(t,n,i),s.push(n,r,i),T+=6}o.addGroup(d,T,v),d+=T,h+=E}f("z","y","x",-1,-1,n,t,e,a,i,0),f("z","y","x",1,-1,n,t,-e,a,i,1),f("x","z","y",1,1,e,n,t,r,a,2),f("x","z","y",1,-1,e,n,-t,r,a,3),f("x","y","z",1,-1,e,t,n,r,i,4),f("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new OR(l,3)),this.setAttribute("normal",new OR(c,3)),this.setAttribute("uv",new OR(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lP(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function cP(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("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 uP(e){const t={};for(let n=0;n<e.length;n++){const r=cP(e[n]);for(const e in r)t[e]=r[e]}return t}function hP(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:jA.workingColorSpace}const dP={clone:cP,merge:uP};class fP extends AR{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",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,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cP(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)!0===this.extensions[r]&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class pP extends lR{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new DC,this.projectionMatrix=new DC,this.projectionMatrixInverse=new DC,this.coordinateSystem=vA}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const mP=new aC,gP=new LA,vP=new LA;class yP extends pP{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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*MA*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*SA*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*MA*Math.atan(Math.tan(.5*SA*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){mP.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(mP.x,mP.y).multiplyScalar(-e/mP.z),mP.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(mP.x,mP.y).multiplyScalar(-e/mP.z)}getViewSize(e,t){return this.getViewBounds(e,gP,vP),t.subVectors(vP,gP)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*SA*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const _P=-90;class bP extends lR{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new yP(_P,1,e,t);r.layers=this.layers,this.add(r);const i=new yP(_P,1,e,t);i.layers=this.layers,this.add(i);const a=new yP(_P,1,e,t);a.layers=this.layers,this.add(a);const o=new yP(_P,1,e,t);o.layers=this.layers,this.add(o);const s=new yP(_P,1,e,t);s.layers=this.layers,this.add(s);const l=new yP(_P,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(const l of t)this.remove(l);if(e===vA)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!==yA)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);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)}for(const l of t)this.add(l),l.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,a,o,s,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;const p=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,l),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,r),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class xP extends JA{constructor(e,t,n,r,i,a,o,s,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:IE,n,r,i,a,o,s,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class SP extends tC{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new xP(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:VE}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new lP(5,5,5),i=new fP({name:"CubemapFromEquirect",uniforms:cP(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;const a=new oP(r,i),o=t.minFilter;t.minFilter===GE&&(t.minFilter=VE);return new bP(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(i)}}const MP=new aC,wP=new aC,EP=new IA;class TP{constructor(e=new aC(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){const r=MP.subVectors(n,t).cross(wP.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(MP),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||EP.getNormalMatrix(e),r=this.coplanarPoint(MP).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)}}const AP=new TC,CP=new aC;class RP{constructor(e=new TP,t=new TP,n=new TP,r=new TP,i=new TP,a=new TP){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){const 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){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3){const n=this.planes,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],c=r[5],u=r[6],h=r[7],d=r[8],f=r[9],p=r[10],m=r[11],g=r[12],v=r[13],y=r[14],_=r[15];if(n[0].setComponents(s-i,h-l,m-d,_-g).normalize(),n[1].setComponents(s+i,h+l,m+d,_+g).normalize(),n[2].setComponents(s+a,h+c,m+f,_+v).normalize(),n[3].setComponents(s-a,h-c,m-f,_-v).normalize(),n[4].setComponents(s-o,h-u,m-p,_-y).normalize(),t===vA)n[5].setComponents(s+o,h+u,m+p,_+y).normalize();else{if(t!==yA)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(o,u,p,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),AP.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),AP.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(AP)}intersectsSprite(e){return AP.center.set(0,0,0),AP.radius=.7071067811865476,AP.applyMatrix4(e.matrixWorld),this.intersectsSphere(AP)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(CP.x=r.normal.x>0?e.max.x:e.min.x,CP.y=r.normal.y>0?e.max.y:e.min.y,CP.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(CP)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function PP(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function LP(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const e=t.get(n);return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const i=t.get(n);if(void 0===i)t.set(n,function(t,n){const r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();let s;if(e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback(),r instanceof Float32Array)s=e.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))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);s=e.UNSIGNED_BYTE}return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}(n,r));else if(i.version<n.version){if(i.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,r){const i=n.array,a=n._updateRange,o=n.updateRanges;if(e.bindBuffer(r,t),-1===a.count&&0===o.length&&e.bufferSubData(r,0,i),0!==o.length){for(let t=0,n=o.length;t<n;t++){const n=o[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}-1!==a.count&&(e.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i,a.offset,a.count),a.count=-1),n.onUploadCallback()}(i.buffer,n,r),i.version=n.version}}}}class IP extends VR{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),l=o+1,c=s+1,u=e/o,h=t/s,d=[],f=[],p=[],m=[];for(let g=0;g<c;g++){const e=g*h-a;for(let t=0;t<l;t++){const n=t*u-i;f.push(n,-e,0),p.push(0,0,1),m.push(t/o),m.push(1-g/s)}}for(let g=0;g<s;g++)for(let e=0;e<o;e++){const t=e+l*g,n=e+l*(g+1),r=e+1+l*(g+1),i=e+1+l*g;d.push(t,n,i),d.push(n,r,i)}this.setIndex(d),this.setAttribute("position",new OR(f,3)),this.setAttribute("normal",new OR(p,3)),this.setAttribute("uv",new OR(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new IP(e.width,e.height,e.widthSegments,e.heightSegments)}}const NP={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn 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 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid 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 ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat 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 ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid 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 ) {\n#else\nvoid 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 ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid 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 ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid 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 ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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 ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid 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) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = 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 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},OP={common:{diffuse:{value:new wR(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new IA},alphaMap:{value:null},alphaMapTransform:{value:new IA},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new IA}},envmap:{envMap:{value:null},envMapRotation:{value:new IA},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new IA}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new IA}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new IA},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new IA},normalScale:{value:new LA(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new IA},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new IA}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new IA}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new IA}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new wR(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 wR(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new IA},alphaTest:{value:0},uvTransform:{value:new IA}},sprite:{diffuse:{value:new wR(16777215)},opacity:{value:1},center:{value:new LA(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new IA},alphaMap:{value:null},alphaMapTransform:{value:new IA},alphaTest:{value:0}}},DP={basic:{uniforms:uP([OP.common,OP.specularmap,OP.envmap,OP.aomap,OP.lightmap,OP.fog]),vertexShader:NP.meshbasic_vert,fragmentShader:NP.meshbasic_frag},lambert:{uniforms:uP([OP.common,OP.specularmap,OP.envmap,OP.aomap,OP.lightmap,OP.emissivemap,OP.bumpmap,OP.normalmap,OP.displacementmap,OP.fog,OP.lights,{emissive:{value:new wR(0)}}]),vertexShader:NP.meshlambert_vert,fragmentShader:NP.meshlambert_frag},phong:{uniforms:uP([OP.common,OP.specularmap,OP.envmap,OP.aomap,OP.lightmap,OP.emissivemap,OP.bumpmap,OP.normalmap,OP.displacementmap,OP.fog,OP.lights,{emissive:{value:new wR(0)},specular:{value:new wR(1118481)},shininess:{value:30}}]),vertexShader:NP.meshphong_vert,fragmentShader:NP.meshphong_frag},standard:{uniforms:uP([OP.common,OP.envmap,OP.aomap,OP.lightmap,OP.emissivemap,OP.bumpmap,OP.normalmap,OP.displacementmap,OP.roughnessmap,OP.metalnessmap,OP.fog,OP.lights,{emissive:{value:new wR(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:NP.meshphysical_vert,fragmentShader:NP.meshphysical_frag},toon:{uniforms:uP([OP.common,OP.aomap,OP.lightmap,OP.emissivemap,OP.bumpmap,OP.normalmap,OP.displacementmap,OP.gradientmap,OP.fog,OP.lights,{emissive:{value:new wR(0)}}]),vertexShader:NP.meshtoon_vert,fragmentShader:NP.meshtoon_frag},matcap:{uniforms:uP([OP.common,OP.bumpmap,OP.normalmap,OP.displacementmap,OP.fog,{matcap:{value:null}}]),vertexShader:NP.meshmatcap_vert,fragmentShader:NP.meshmatcap_frag},points:{uniforms:uP([OP.points,OP.fog]),vertexShader:NP.points_vert,fragmentShader:NP.points_frag},dashed:{uniforms:uP([OP.common,OP.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:NP.linedashed_vert,fragmentShader:NP.linedashed_frag},depth:{uniforms:uP([OP.common,OP.displacementmap]),vertexShader:NP.depth_vert,fragmentShader:NP.depth_frag},normal:{uniforms:uP([OP.common,OP.bumpmap,OP.normalmap,OP.displacementmap,{opacity:{value:1}}]),vertexShader:NP.meshnormal_vert,fragmentShader:NP.meshnormal_frag},sprite:{uniforms:uP([OP.sprite,OP.fog]),vertexShader:NP.sprite_vert,fragmentShader:NP.sprite_frag},background:{uniforms:{uvTransform:{value:new IA},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:NP.background_vert,fragmentShader:NP.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new IA}},vertexShader:NP.backgroundCube_vert,fragmentShader:NP.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:NP.cube_vert,fragmentShader:NP.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:NP.equirect_vert,fragmentShader:NP.equirect_frag},distanceRGBA:{uniforms:uP([OP.common,OP.displacementmap,{referencePosition:{value:new aC},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:NP.distanceRGBA_vert,fragmentShader:NP.distanceRGBA_frag},shadow:{uniforms:uP([OP.lights,OP.fog,{color:{value:new wR(0)},opacity:{value:1}}]),vertexShader:NP.shadow_vert,fragmentShader:NP.shadow_frag}};DP.physical={uniforms:uP([DP.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new IA},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new IA},clearcoatNormalScale:{value:new LA(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new IA},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new IA},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new IA},sheen:{value:0},sheenColor:{value:new wR(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new IA},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new IA},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new IA},transmissionSamplerSize:{value:new LA},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new IA},attenuationDistance:{value:0},attenuationColor:{value:new wR(0)},specularColor:{value:new wR(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new IA},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new IA},anisotropyVector:{value:new LA},anisotropyMap:{value:null},anisotropyMapTransform:{value:new IA}}]),vertexShader:NP.meshphysical_vert,fragmentShader:NP.meshphysical_frag};const UP={r:0,b:0,g:0},kP=new WC,FP=new DC;function zP(e,t,n,r,i,a,o){const s=new wR(0);let l,c,u=!0===a?0:1,h=null,d=0,f=null;function p(e){let r=!0===e.isScene?e.background:null;if(r&&r.isTexture){r=(e.backgroundBlurriness>0?n:t).get(r)}return r}function m(t,n){t.getRGB(UP,hP(e)),r.buffers.color.setClear(UP.r,UP.g,UP.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),u=t,m(s,u)},getClearAlpha:function(){return u},setClearAlpha:function(e){u=e,m(s,u)},render:function(t){let n=!1;const i=p(t);null===i?m(s,u):i&&i.isColor&&(m(i,1),n=!0);const a=e.xr.getEnvironmentBlendMode();"additive"===a?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===a&&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))},addToRenderList:function(t,n){const r=p(n);r&&(r.isCubeTexture||r.mapping===DE)?(void 0===c&&(c=new oP(new lP(1,1,1),new fP({name:"BackgroundCubeMaterial",uniforms:cP(DP.backgroundCube.uniforms),vertexShader:DP.backgroundCube.vertexShader,fragmentShader:DP.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),kP.copy(n.backgroundRotation),kP.x*=-1,kP.y*=-1,kP.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(kP.y*=-1,kP.z*=-1),c.material.uniforms.envMap.value=r,c.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(FP.makeRotationFromEuler(kP)),c.material.toneMapped=jA.getTransfer(r.colorSpace)!==rA,h===r&&d===r.version&&f===e.toneMapping||(c.material.needsUpdate=!0,h=r,d=r.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null)):r&&r.isTexture&&(void 0===l&&(l=new oP(new IP(2,2),new fP({name:"BackgroundMaterial",uniforms:cP(DP.background.uniforms),vertexShader:DP.background.vertexShader,fragmentShader:DP.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!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=jA.getTransfer(r.colorSpace)!==rA,!0===r.matrixAutoUpdate&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),h===r&&d===r.version&&f===e.toneMapping||(l.material.needsUpdate=!0,h=r,d=r.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}}}function BP(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=c(null);let a=i,o=!1;function s(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){const t=[],r=[],i=[];for(let a=0;a<n;a++)t[a]=0,r[a]=0,i[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function u(){const e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function h(e){d(e,0)}function d(t,n){const r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,0===i[t]&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function f(){const 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 p(t,n,r,i,a,o,s){!0===s?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function m(){g(),o=!0,a!==i&&(a=i,s(a.object))}function g(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:function(n,i,l,m,g){let v=!1;const y=function(t,n,i){const a=!0===i.wireframe;let o=r[t.id];void 0===o&&(o={},r[t.id]=o);let s=o[n.id];void 0===s&&(s={},o[n.id]=s);let l=s[a];void 0===l&&(l=c(e.createVertexArray()),s[a]=l);return l}(m,l,i);a!==y&&(a=y,s(a.object)),v=function(e,t,n,r){const i=a.attributes,o=t.attributes;let s=0;const l=n.getAttributes();for(const a in l){if(l[a].location>=0){const t=i[a];let n=o[a];if(void 0===n&&("instanceMatrix"===a&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===a&&e.instanceColor&&(n=e.instanceColor)),void 0===t)return!0;if(t.attribute!==n)return!0;if(n&&t.data!==n.data)return!0;s++}}return a.attributesNum!==s||a.index!==r}(n,m,l,g),v&&function(e,t,n,r){const i={},o=t.attributes;let s=0;const l=n.getAttributes();for(const a in l){if(l[a].location>=0){let t=o[a];void 0===t&&("instanceMatrix"===a&&e.instanceMatrix&&(t=e.instanceMatrix),"instanceColor"===a&&e.instanceColor&&(t=e.instanceColor));const n={};n.attribute=t,t&&t.data&&(n.data=t.data),i[a]=n,s++}}a.attributes=i,a.attributesNum=s,a.index=r}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(v||o)&&(o=!1,function(n,r,i,a){u();const o=a.attributes,s=i.getAttributes(),l=r.defaultAttributeValues;for(const c in s){const r=s[c];if(r.location>=0){let i=o[c];if(void 0===i&&("instanceMatrix"===c&&n.instanceMatrix&&(i=n.instanceMatrix),"instanceColor"===c&&n.instanceColor&&(i=n.instanceColor)),void 0!==i){const o=i.normalized,s=i.itemSize,l=t.get(i);if(void 0===l)continue;const c=l.buffer,u=l.type,f=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||i.gpuType===YE;if(i.isInterleavedBufferAttribute){const t=i.data,l=t.stride,g=i.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)d(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)h(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,s/r.locationSize,u,o,l*f,(g+s/r.locationSize*e)*f,m)}else{if(i.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)d(r.location+e,i.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let e=0;e<r.locationSize;e++)h(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,s/r.locationSize,u,o,s*f,s/r.locationSize*e*f,m)}}else if(void 0!==l){const t=l[c];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}f()}(n,i,l,m),null!==g&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){m();for(const e in r){const t=r[e];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0===r[e.id])return;const t=r[e.id];for(const n in t){const e=t[n];for(const t in e)l(e[t].object),delete e[t];delete t[n]}delete r[e.id]},releaseStatesOfProgram:function(e){for(const t in r){const n=r[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)l(i[e].object),delete i[e];delete n[e.id]}},initAttributes:u,enableAttribute:h,disableUnusedAttributes:f}}function HP(e,t,n){let r;function i(t,i,a){0!==a&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=i,this.renderMultiDraw=function(e,i,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,e,0,i,0,a);let o=0;for(let t=0;t<a;t++)o+=i[t];n.update(o,r,1)},this.renderMultiDrawInstances=function(e,a,o,s){if(0===o)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)i(e[t],a[t],s[t]);else{l.multiDrawArraysInstancedWEBGL(r,e,0,a,0,s,0,o);let t=0;for(let e=0;e<o;e++)t+=a[e];for(let e=0;e<s.length;e++)n.update(t,r,s[e])}}}function VP(e,t,n,r){let i;function a(t){if("highp"===t){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"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==n.precision?n.precision:"highp";const s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:a,textureFormatReadable:function(t){return t===rT||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const i=n===JE&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==WE&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==ZE&&!i)},precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:u>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function jP(e){const t=this;let n=null,r=0,i=!1,a=!1;const o=new TP,s=new IA,l={value:null,needsUpdate:!1};function c(e,n,r,i){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==i||null===c){const t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let n=0,l=r;n!==a;++n,l+=4)o.copy(e[n]).applyMatrix4(i,s),o.normal.toArray(c,l),c[l+3]=o.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(o,s,u){const h=o.clippingPlanes,d=o.clipIntersection,f=o.clipShadows,p=e.get(o);if(!i||null===h||0===h.length||a&&!f)a?c(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=r>0);t.numPlanes=r,t.numIntersection=0}();else{const e=a?0:r,t=4*e;let i=p.clippingState||null;l.value=i,i=c(h,s,t,u);for(let r=0;r!==t;++r)i[r]=n[r];p.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function GP(e){let t=new WeakMap;function n(e,t){return t===OE?e.mapping=IE:304===t&&(e.mapping=NE),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping;if(a===OE||304===a){if(t.has(i)){return n(t.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const o=new SP(a.height);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}class WP extends pP{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=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){null===this.view&&(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){const 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.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const XP=[.125,.215,.35,.446,.526,.582],$P=20,qP=new WP,YP=new wR;let KP=null,ZP=0,JP=0,QP=!1;const eL=(1+Math.sqrt(5))/2,tL=1/eL,nL=[new aC(-eL,tL,0),new aC(eL,tL,0),new aC(-tL,0,eL),new aC(tL,0,eL),new aC(0,eL,-tL),new aC(0,eL,tL),new aC(-1,1,-1),new aC(1,1,-1),new aC(-1,1,1),new aC(1,1,1)];class rL{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){KP=this._renderer.getRenderTarget(),ZP=this._renderer.getActiveCubeFace(),JP=this._renderer.getActiveMipmapLevel(),QP=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=sL(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=oL(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(KP,ZP,JP),this._renderer.xr.enabled=QP,e.scissorTest=!1,aL(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===IE||e.mapping===NE?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),KP=this._renderer.getRenderTarget(),ZP=this._renderer.getActiveCubeFace(),JP=this._renderer.getActiveMipmapLevel(),QP=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:VE,minFilter:VE,generateMipmaps:!1,type:JE,format:rT,colorSpace:QT,depthBuffer:!1},r=iL(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=iL(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const a=e-4+1+XP.length;for(let o=0;o<a;o++){const a=Math.pow(2,i);n.push(a);let s=1/a;o>e-4?s=XP[o-e+4-1]:0===o&&(s=0),r.push(s);const l=1/(a-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=6,f=6,p=3,m=2,g=1,v=new Float32Array(p*f*d),y=new Float32Array(m*f*d),_=new Float32Array(g*f*d);for(let e=0;e<d;e++){const 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];v.set(r,p*f*e),y.set(h,m*f*e);const i=[e,e,e,e,e,e];_.set(i,g*f*e)}const b=new VR;b.setAttribute("position",new LR(v,p)),b.setAttribute("uv",new LR(y,m)),b.setAttribute("faceIndex",new LR(_,g)),t.push(b),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array($P),i=new aC(0,1,0),a=new fP({name:"SphericalGaussianBlur",defines:{n:$P,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:lL(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return a}(r,e,t)}return r}_compileMaterial(e){const t=new oP(this._lodPlanes[0],e);this._renderer.compile(t,qP)}_sceneToCubeUV(e,t,n,r){const i=new yP(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,l=s.autoClear,c=s.toneMapping;s.getClearColor(YP),s.toneMapping=0,s.autoClear=!1;const u=new CR({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),h=new oP(new lP,u);let d=!1;const f=e.background;f?f.isColor&&(u.color.copy(f),e.background=null,d=!0):(u.color.copy(YP),d=!0);for(let p=0;p<6;p++){const t=p%3;0===t?(i.up.set(0,a[p],0),i.lookAt(o[p],0,0)):1===t?(i.up.set(0,0,a[p]),i.lookAt(0,o[p],0)):(i.up.set(0,a[p],0),i.lookAt(0,0,o[p]));const n=this._cubeSize;aL(r,t*n,p>2?n:0,n,n),s.setRenderTarget(r),d&&s.render(h,i),s.render(e,i)}h.geometry.dispose(),h.material.dispose(),s.toneMapping=c,s.autoClear=l,e.background=f}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===IE||e.mapping===NE;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=sL()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=oL());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new oP(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;aL(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,qP)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let i=1;i<r;i++){const t=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),n=nL[(r-i-1)%nL.length];this._blur(e,i-1,i,t,n)}t.autoClear=n}_blur(e,t,n,r,i){const 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){const s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new oP(this._lodPlanes[r],l),u=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,f=i/d,p=isFinite(i)?1+Math.floor(3*f):$P;p>$P&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const m=[];let g=0;for(let _=0;_<$P;++_){const e=_/f,t=Math.exp(-e*e/2);m.push(t),0===_?g+=t:_<p&&(g+=2*t)}for(let _=0;_<m.length;_++)m[_]=m[_]/g;u.envMap.value=e.texture,u.samples.value=p,u.weights.value=m,u.latitudinal.value="latitudinal"===a,o&&(u.poleAxis.value=o);const{_lodMax:v}=this;u.dTheta.value=d,u.mipInt.value=v-n;const y=this._sizeLods[r];aL(t,3*y*(r>v-4?r-v+4:0),4*(this._cubeSize-y),3*y,2*y),s.setRenderTarget(t),s.render(c,qP)}}function iL(e,t,n){const r=new tC(e,t,n);return r.texture.mapping=DE,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function aL(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function oL(){return new fP({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:lL(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function sL(){return new fP({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lL(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function lL(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function cL(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping,o=a===OE||304===a,s=a===IE||a===NE;if(o||s){let a=t.get(i);const l=void 0!==a?a.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===n&&(n=new rL(e)),a=o?n.fromEquirectangular(i,a):n.fromCubemap(i,a),a.texture.pmremVersion=i.pmremVersion,t.set(i,a),a.texture;if(void 0!==a)return a.texture;{const l=i.image;return o&&l&&l.height>0||s&&l&&function(e){let t=0;const n=6;for(let r=0;r<n;r++)void 0!==e[r]&&t++;return t===n}(l)?(null===n&&(n=new rL(e)),a=o?n.fromEquirectangular(i):n.fromCubemap(i),a.texture.pmremVersion=i.pmremVersion,t.set(i,a),i.addEventListener("dispose",r),a.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function uL(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},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){const t=n(e);return null===t&&FA("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function hL(e,t,n,r){const i={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const n in s.attributes)t.remove(s.attributes[n]);for(const n in s.morphAttributes){const e=s.morphAttributes[n];for(let n=0,r=e.length;n<r;n++)t.remove(e[n])}s.removeEventListener("dispose",o),delete i[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let o=0;if(null!==r){const e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{if(void 0===i)return;{const e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}}const s=new(OA(n)?NR:IR)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(n){const r=n.attributes;for(const a in r)t.update(r[a],e.ARRAY_BUFFER);const i=n.morphAttributes;for(const a in i){const n=i[a];for(let r=0,i=n.length;r<i;r++)t.update(n[r],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){const t=a.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function dL(e,t,n){let r,i,a;function o(t,o,s){0!==s&&(e.drawElementsInstanced(r,o,i,t*a,s),n.update(o,r,s))}this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(r,o,i,t*a),n.update(o,r,1)},this.renderInstances=o,this.renderMultiDraw=function(e,a,o){if(0===o)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,a,0,i,e,0,o);let s=0;for(let t=0;t<o;t++)s+=a[t];n.update(s,r,1)},this.renderMultiDrawInstances=function(e,s,l,c){if(0===l)return;const u=t.get("WEBGL_multi_draw");if(null===u)for(let t=0;t<e.length;t++)o(e[t]/a,s[t],c[t]);else{u.multiDrawElementsInstancedWEBGL(r,s,0,i,e,0,c,0,l);let t=0;for(let e=0;e<l;e++)t+=s[e];for(let e=0;e<c.length;e++)n.update(t,r,c[e])}}}function fL(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function pL(e,t,n){const r=new WeakMap,i=new QA;return{update:function(a,o,s){const l=a.morphTargetInfluences,c=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=void 0!==c?c.length:0;let h=r.get(o);if(void 0===h||h.count!==u){let e=function(){v.dispose(),r.delete(o),o.removeEventListener("dispose",e)};void 0!==h&&h.texture.dispose();const n=void 0!==o.morphAttributes.position,a=void 0!==o.morphAttributes.normal,s=void 0!==o.morphAttributes.color,l=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],d=o.morphAttributes.color||[];let f=0;!0===n&&(f=1),!0===a&&(f=2),!0===s&&(f=3);let p=o.attributes.position.count*f,m=1;p>t.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);const g=new Float32Array(p*m*4*u),v=new nC(g,p,m,u);v.type=ZE,v.needsUpdate=!0;const y=4*f;for(let t=0;t<u;t++){const e=l[t],r=c[t],o=d[t],u=p*m*4*t;for(let t=0;t<e.count;t++){const l=t*y;!0===n&&(i.fromBufferAttribute(e,t),g[u+l+0]=i.x,g[u+l+1]=i.y,g[u+l+2]=i.z,g[u+l+3]=0),!0===a&&(i.fromBufferAttribute(r,t),g[u+l+4]=i.x,g[u+l+5]=i.y,g[u+l+6]=i.z,g[u+l+7]=0),!0===s&&(i.fromBufferAttribute(o,t),g[u+l+8]=i.x,g[u+l+9]=i.y,g[u+l+10]=i.z,g[u+l+11]=4===o.itemSize?i.w:1)}}h={count:u,texture:v,size:new LA(p,m)},r.set(o,h),o.addEventListener("dispose",e)}if(!0===a.isInstancedMesh&&null!==a.morphTexture)s.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let t=0;for(let e=0;e<l.length;e++)t+=l[e];const n=o.morphTargetsRelative?1:1-t;s.getUniforms().setValue(e,"morphTargetBaseInfluence",n),s.getUniforms().setValue(e,"morphTargetInfluences",l)}s.getUniforms().setValue(e,"morphTargetsTexture",h.texture,n),s.getUniforms().setValue(e,"morphTargetsTextureSize",h.size)}}}function mL(e,t,n,r){let i=new WeakMap;function a(e){const t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){const s=r.render.frame,l=o.geometry,c=t.get(o,l);if(i.get(c)!==s&&(t.update(c),i.set(c,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){const e=o.skeleton;i.get(e)!==s&&(e.update(),i.set(e,s))}return c},dispose:function(){i=new WeakMap}}}class gL extends JA{constructor(e,t,n,r,i,a,o,s,l,c=1026){if(c!==iT&&c!==aT)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===iT&&(n=KE),void 0===n&&c===aT&&(n=tT),super(null,r,i,a,o,s,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:zE,this.minFilter=void 0!==s?s:zE,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}const vL=new JA,yL=new gL(1,1),_L=new nC,bL=new rC,xL=new xP,SL=[],ML=[],wL=new Float32Array(16),EL=new Float32Array(9),TL=new Float32Array(4);function AL(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let a=SL[i];if(void 0===a&&(a=new Float32Array(i),SL[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function CL(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 RL(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function PL(e,t){let n=ML[t];void 0===n&&(n=new Int32Array(t),ML[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function LL(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function IL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform2fv(this.addr,t),RL(n,t)}}function NL(e,t){const n=this.cache;if(void 0!==t.x)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(void 0!==t.r)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(CL(n,t))return;e.uniform3fv(this.addr,t),RL(n,t)}}function OL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform4fv(this.addr,t),RL(n,t)}}function DL(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(CL(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),RL(n,t)}else{if(CL(n,r))return;TL.set(r),e.uniformMatrix2fv(this.addr,!1,TL),RL(n,r)}}function UL(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(CL(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),RL(n,t)}else{if(CL(n,r))return;EL.set(r),e.uniformMatrix3fv(this.addr,!1,EL),RL(n,r)}}function kL(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(CL(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),RL(n,t)}else{if(CL(n,r))return;wL.set(r),e.uniformMatrix4fv(this.addr,!1,wL),RL(n,r)}}function FL(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function zL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform2iv(this.addr,t),RL(n,t)}}function BL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform3iv(this.addr,t),RL(n,t)}}function HL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform4iv(this.addr,t),RL(n,t)}}function VL(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function jL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform2uiv(this.addr,t),RL(n,t)}}function GL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform3uiv(this.addr,t),RL(n,t)}}function WL(e,t){const n=this.cache;if(void 0!==t.x)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(CL(n,t))return;e.uniform4uiv(this.addr,t),RL(n,t)}}function XL(e,t,n){const r=this.cache,i=n.allocateTextureUnit();let a;r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),this.type===e.SAMPLER_2D_SHADOW?(yL.compareFunction=515,a=yL):a=vL,n.setTexture2D(t||a,i)}function $L(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||bL,i)}function qL(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||xL,i)}function YL(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||_L,i)}function KL(e,t){e.uniform1fv(this.addr,t)}function ZL(e,t){const n=AL(t,this.size,2);e.uniform2fv(this.addr,n)}function JL(e,t){const n=AL(t,this.size,3);e.uniform3fv(this.addr,n)}function QL(e,t){const n=AL(t,this.size,4);e.uniform4fv(this.addr,n)}function eI(e,t){const n=AL(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function tI(e,t){const n=AL(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function nI(e,t){const n=AL(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function rI(e,t){e.uniform1iv(this.addr,t)}function iI(e,t){e.uniform2iv(this.addr,t)}function aI(e,t){e.uniform3iv(this.addr,t)}function oI(e,t){e.uniform4iv(this.addr,t)}function sI(e,t){e.uniform1uiv(this.addr,t)}function lI(e,t){e.uniform2uiv(this.addr,t)}function cI(e,t){e.uniform3uiv(this.addr,t)}function uI(e,t){e.uniform4uiv(this.addr,t)}function hI(e,t,n){const r=this.cache,i=t.length,a=PL(n,i);CL(r,a)||(e.uniform1iv(this.addr,a),RL(r,a));for(let o=0;o!==i;++o)n.setTexture2D(t[o]||vL,a[o])}function dI(e,t,n){const r=this.cache,i=t.length,a=PL(n,i);CL(r,a)||(e.uniform1iv(this.addr,a),RL(r,a));for(let o=0;o!==i;++o)n.setTexture3D(t[o]||bL,a[o])}function fI(e,t,n){const r=this.cache,i=t.length,a=PL(n,i);CL(r,a)||(e.uniform1iv(this.addr,a),RL(r,a));for(let o=0;o!==i;++o)n.setTextureCube(t[o]||xL,a[o])}function pI(e,t,n){const r=this.cache,i=t.length,a=PL(n,i);CL(r,a)||(e.uniform1iv(this.addr,a),RL(r,a));for(let o=0;o!==i;++o)n.setTexture2DArray(t[o]||_L,a[o])}class mI{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return LL;case 35664:return IL;case 35665:return NL;case 35666:return OL;case 35674:return DL;case 35675:return UL;case 35676:return kL;case 5124:case 35670:return FL;case 35667:case 35671:return zL;case 35668:case 35672:return BL;case 35669:case 35673:return HL;case 5125:return VL;case 36294:return jL;case 36295:return GL;case 36296:return WL;case 35678:case 36198:case 36298:case 36306:case 35682:return XL;case 35679:case 36299:case 36307:return $L;case 35680:case 36300:case 36308:case 36293:return qL;case 36289:case 36303:case 36311:case 36292:return YL}}(t.type)}}class gI{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return KL;case 35664:return ZL;case 35665:return JL;case 35666:return QL;case 35674:return eI;case 35675:return tI;case 35676:return nI;case 5124:case 35670:return rI;case 35667:case 35671:return iI;case 35668:case 35672:return aI;case 35669:case 35673:return oI;case 5125:return sI;case 36294:return lI;case 36295:return cI;case 36296:return uI;case 35678:case 36198:case 36298:case 36306:case 35682:return hI;case 35679:case 36299:case 36307:return dI;case 35680:case 36300:case 36308:case 36293:return fI;case 36289:case 36303:case 36311:case 36292:return pI}}(t.type)}}class vI{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,a=r.length;i!==a;++i){const a=r[i];a.setValue(e,t[a.id],n)}}}const yI=/(\w+)(\])?(\[|\.)?/g;function _I(e,t){e.seq.push(t),e.map[t.id]=t}function bI(e,t,n){const r=e.name,i=r.length;for(yI.lastIndex=0;;){const a=yI.exec(r),o=yI.lastIndex;let s=a[1];const l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===i){_I(n,void 0===c?new mI(s,e,t):new gI(s,e,t));break}{let e=n.map[s];void 0===e&&(e=new vI(s),_I(n,e)),n=e}}}class xI{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);bI(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){const a=t[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function SI(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let MI=0;function wI(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const r=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let o=i;o<a;o++){const e=o+1;r.push(`${e===t?">":" "} ${e}: ${n[o]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return i}function EI(e,t){const n=function(e){const t=jA.getPrimaries(jA.workingColorSpace),n=jA.getPrimaries(e);let r;switch(t===n?r="":t===aA&&n===iA?r="LinearDisplayP3ToLinearSRGB":t===iA&&n===aA&&(r="LinearSRGBToLinearDisplayP3"),e){case QT:case tA:return[r,"LinearTransferOETF"];case JT:case eA:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[r,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function TI(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const AI=new aC;function CI(){jA.getLuminanceCoefficients(AI);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${AI.x.toFixed(4)}, ${AI.y.toFixed(4)}, ${AI.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function RI(e){return""!==e}function PI(e,t){const 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 LI(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const II=/^[ \t]*#include +<([\w\d./]+)>/gm;function NI(e){return e.replace(II,DI)}const OI=new Map;function DI(e,t){let n=NP[t];if(void 0===n){const e=OI.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=NP[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return NI(n)}const UI=/#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 kI(e){return e.replace(UI,FI)}function FI(e,t,n,r){let i="";for(let a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function zI(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function BI(e,t,n,r){const i=e.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case IE:case NE:t="ENVMAP_TYPE_CUBE";break;case DE:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),u=function(e){let t="ENVMAP_MODE_REFLECTION";e.envMap&&e.envMapMode===NE&&(t="ENVMAP_MODE_REFRACTION");return t}(n),h=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),d=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),f=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(RI).join("\n")}(n),p=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(a),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(RI).join("\n"),g.length>0&&(g+="\n"),v=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(RI).join("\n"),v.length>0&&(v+="\n")):(g=[zI(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+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&&!1===n.flatShading?"#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&&!1===n.flatShading?"#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 "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(RI).join("\n"),v=[zI(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.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&&!1===n.flatShading?"#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 "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?NP.tonemapping_pars_fragment:"",0!==n.toneMapping?TI("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",NP.colorspace_pars_fragment,EI("linearToOutputTexel",n.outputColorSpace),CI(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(RI).join("\n")),o=NI(o),o=PI(o,n),o=LI(o,n),s=NI(s),s=PI(s,n),s=LI(s,n),o=kI(o),s=kI(s),!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===gA?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===gA?"":"#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("\n")+"\n"+v);const _=y+g+o,b=y+v+s,x=SI(i,i.VERTEX_SHADER,_),S=SI(i,i.FRAGMENT_SHADER,b);function M(t){if(e.debug.checkShaderErrors){const n=i.getProgramInfoLog(m).trim(),r=i.getShaderInfoLog(x).trim(),a=i.getShaderInfoLog(S).trim();let o=!0,s=!0;if(!1===i.getProgramParameter(m,i.LINK_STATUS))if(o=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,m,x,S);else{const e=wI(i,x,"vertex"),r=wI(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+r)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==a||(s=!1);s&&(t.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:g},fragmentShader:{log:a,prefix:v}})}i.deleteShader(x),i.deleteShader(S),w=new xI(i,m),E=function(e,t){const n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),a=r.name;let 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}(i,m)}let w,E;i.attachShader(m,x),i.attachShader(m,S),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),this.getUniforms=function(){return void 0===w&&M(this),w},this.getAttributes=function(){return void 0===E&&M(this),E};let T=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===T&&(T=i.getProgramParameter(m,37297)),T},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=MI++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=x,this.fragmentShader=S,this}let HI=0;class VI{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new jI(e),t.set(e,n)),n}}class jI{constructor(e){this.id=HI++,this.code=e,this.usedTimes=0}}function GI(e,t,n,r,i,a,o){const s=new XC,l=new VI,c=new Set,u=[],h=i.logarithmicDepthBuffer,d=i.vertexTextures;let f=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(e){return c.add(e),0===e?"uv":`uv${e}`}return{getParameters:function(a,s,u,g,v){const y=g.fog,_=v.geometry,b=a.isMeshStandardMaterial?g.environment:null,x=(a.isMeshStandardMaterial?n:t).get(a.envMap||b),S=x&&x.mapping===DE?x.image.height:null,M=p[a.type];null!==a.precision&&(f=i.getMaxPrecision(a.precision),f!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",f,"instead."));const w=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,E=void 0!==w?w.length:0;let T,A,C,R,P=0;if(void 0!==_.morphAttributes.position&&(P=1),void 0!==_.morphAttributes.normal&&(P=2),void 0!==_.morphAttributes.color&&(P=3),M){const e=DP[M];T=e.vertexShader,A=e.fragmentShader}else T=a.vertexShader,A=a.fragmentShader,l.update(a),C=l.getVertexShaderID(a),R=l.getFragmentShaderID(a);const L=e.getRenderTarget(),I=!0===v.isInstancedMesh,N=!0===v.isBatchedMesh,O=!!a.map,D=!!a.matcap,U=!!x,k=!!a.aoMap,F=!!a.lightMap,z=!!a.bumpMap,B=!!a.normalMap,H=!!a.displacementMap,V=!!a.emissiveMap,j=!!a.metalnessMap,G=!!a.roughnessMap,W=a.anisotropy>0,X=a.clearcoat>0,$=a.dispersion>0,q=a.iridescence>0,Y=a.sheen>0,K=a.transmission>0,Z=W&&!!a.anisotropyMap,J=X&&!!a.clearcoatMap,Q=X&&!!a.clearcoatNormalMap,ee=X&&!!a.clearcoatRoughnessMap,te=q&&!!a.iridescenceMap,ne=q&&!!a.iridescenceThicknessMap,re=Y&&!!a.sheenColorMap,ie=Y&&!!a.sheenRoughnessMap,ae=!!a.specularMap,oe=!!a.specularColorMap,se=!!a.specularIntensityMap,le=K&&!!a.transmissionMap,ce=K&&!!a.thicknessMap,ue=!!a.gradientMap,he=!!a.alphaMap,de=a.alphaTest>0,fe=!!a.alphaHash,pe=!!a.extensions;let me=0;a.toneMapped&&(null!==L&&!0!==L.isXRRenderTarget||(me=e.toneMapping));const ge={shaderID:M,shaderType:a.type,shaderName:a.name,vertexShader:T,fragmentShader:A,defines:a.defines,customVertexShaderID:C,customFragmentShaderID:R,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:f,batching:N,batchingColor:N&&null!==v._colorsTexture,instancing:I,instancingColor:I&&null!==v.instanceColor,instancingMorph:I&&null!==v.morphTexture,supportsVertexTextures:d,outputColorSpace:null===L?e.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:QT,alphaToCoverage:!!a.alphaToCoverage,map:O,matcap:D,envMap:U,envMapMode:U&&x.mapping,envMapCubeUVHeight:S,aoMap:k,lightMap:F,bumpMap:z,normalMap:B,displacementMap:d&&H,emissiveMap:V,normalMapObjectSpace:B&&1===a.normalMapType,normalMapTangentSpace:B&&0===a.normalMapType,metalnessMap:j,roughnessMap:G,anisotropy:W,anisotropyMap:Z,clearcoat:X,clearcoatMap:J,clearcoatNormalMap:Q,clearcoatRoughnessMap:ee,dispersion:$,iridescence:q,iridescenceMap:te,iridescenceThicknessMap:ne,sheen:Y,sheenColorMap:re,sheenRoughnessMap:ie,specularMap:ae,specularColorMap:oe,specularIntensityMap:se,transmission:K,transmissionMap:le,thicknessMap:ce,gradientMap:ue,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:he,alphaTest:de,alphaHash:fe,combine:a.combine,mapUv:O&&m(a.map.channel),aoMapUv:k&&m(a.aoMap.channel),lightMapUv:F&&m(a.lightMap.channel),bumpMapUv:z&&m(a.bumpMap.channel),normalMapUv:B&&m(a.normalMap.channel),displacementMapUv:H&&m(a.displacementMap.channel),emissiveMapUv:V&&m(a.emissiveMap.channel),metalnessMapUv:j&&m(a.metalnessMap.channel),roughnessMapUv:G&&m(a.roughnessMap.channel),anisotropyMapUv:Z&&m(a.anisotropyMap.channel),clearcoatMapUv:J&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:Q&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ee&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ne&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:re&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:ie&&m(a.sheenRoughnessMap.channel),specularMapUv:ae&&m(a.specularMap.channel),specularColorMapUv:oe&&m(a.specularColorMap.channel),specularIntensityMapUv:se&&m(a.specularIntensityMap.channel),transmissionMapUv:le&&m(a.transmissionMap.channel),thicknessMapUv:ce&&m(a.thicknessMap.channel),alphaMapUv:he&&m(a.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(B||W),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!_.attributes.uv&&(O||he),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:E,morphTextureStride:P,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:me,decodeVideoTexture:O&&!0===a.map.isVideoTexture&&jA.getTransfer(a.map.colorSpace)===rA,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:1===a.side,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:pe&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(pe&&!0===a.extensions.multiDraw||N)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ge.vertexUv1s=c.has(1),ge.vertexUv2s=c.has(2),ge.vertexUv3s=c.has(3),c.clear(),ge},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(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)}(n,t),function(e,t){s.disableAll(),t.supportsVertexTextures&&s.enable(0);t.instancing&&s.enable(1);t.instancingColor&&s.enable(2);t.instancingMorph&&s.enable(3);t.matcap&&s.enable(4);t.envMap&&s.enable(5);t.normalMapObjectSpace&&s.enable(6);t.normalMapTangentSpace&&s.enable(7);t.clearcoat&&s.enable(8);t.iridescence&&s.enable(9);t.alphaTest&&s.enable(10);t.vertexColors&&s.enable(11);t.vertexAlphas&&s.enable(12);t.vertexUv1s&&s.enable(13);t.vertexUv2s&&s.enable(14);t.vertexUv3s&&s.enable(15);t.vertexTangents&&s.enable(16);t.anisotropy&&s.enable(17);t.alphaHash&&s.enable(18);t.batching&&s.enable(19);t.dispersion&&s.enable(20);t.batchingColor&&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.skinning&&s.enable(4);t.morphTargets&&s.enable(5);t.morphNormals&&s.enable(6);t.morphColors&&s.enable(7);t.premultipliedAlpha&&s.enable(8);t.shadowMapEnabled&&s.enable(9);t.doubleSided&&s.enable(10);t.flipSided&&s.enable(11);t.useDepthPacking&&s.enable(12);t.dithering&&s.enable(13);t.transmission&&s.enable(14);t.sheen&&s.enable(15);t.opaque&&s.enable(16);t.pointsUvs&&s.enable(17);t.decodeVideoTexture&&s.enable(18);t.alphaToCoverage&&s.enable(19);e.push(s.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=p[e.type];let n;if(t){const e=DP[t];n=dP.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,i=u.length;e<i;e++){const t=u[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new BI(e,n,t,a),u.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:u,dispose:function(){l.dispose()}}}function WI(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function XI(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function $I(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function qI(){const e=[];let t=0;const n=[],r=[],i=[];function a(n,r,i,a,o,s){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=o,l.group=s),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?r.push(u):!0===o.transparent?i.push(u):n.push(u)},unshift:function(e,t,o,s,l,c){const u=a(e,t,o,s,l,c);o.transmission>0?r.unshift(u):!0===o.transparent?i.unshift(u):n.unshift(u)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||XI),r.length>1&&r.sort(t||$I),i.length>1&&i.sort(t||$I)}}}function YI(){let e=new WeakMap;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new qI,e.set(t,[i])):n>=r.length?(i=new qI,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function KI(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new aC,color:new wR};break;case"SpotLight":n={position:new aC,direction:new aC,color:new wR,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new aC,color:new wR,distance:0,decay:0};break;case"HemisphereLight":n={direction:new aC,skyColor:new wR,groundColor:new wR};break;case"RectAreaLight":n={color:new wR,position:new aC,halfWidth:new aC,halfHeight:new aC}}return e[t.id]=n,n}}}let ZI=0;function JI(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function QI(e){const t=new KI,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new LA};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new LA,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),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 s=0;s<9;s++)r.probe.push(new aC);const i=new aC,a=new DC,o=new DC;return{setup:function(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0;i.sort(JI);for(let e=0,b=i.length;e<b;e++){const _=i[e],b=_.color,x=_.intensity,S=_.distance,M=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)a+=b.r*x,o+=b.g*x,s+=b.b*x;else if(_.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(_.sh.coefficients[e],x);y++}else if(_.isDirectionalLight){const e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),_.castShadow){const e=_.shadow,t=n.get(_);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=M,r.directionalShadowMatrix[l]=_.shadow.matrix,f++}r.directional[l]=e,l++}else if(_.isSpotLight){const e=t.get(_);e.position.setFromMatrixPosition(_.matrixWorld),e.color.copy(b).multiplyScalar(x),e.distance=S,e.coneCos=Math.cos(_.angle),e.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),e.decay=_.decay,r.spot[u]=e;const i=_.shadow;if(_.map&&(r.spotLightMap[g]=_.map,g++,i.updateMatrices(_),_.castShadow&&v++),r.spotLightMatrix[u]=i.matrix,_.castShadow){const e=n.get(_);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]=M,m++}u++}else if(_.isRectAreaLight){const e=t.get(_);e.color.copy(b).multiplyScalar(x),e.halfWidth.set(.5*_.width,0,0),e.halfHeight.set(0,.5*_.height,0),r.rectArea[h]=e,h++}else if(_.isPointLight){const e=t.get(_);if(e.color.copy(_.color).multiplyScalar(_.intensity),e.distance=_.distance,e.decay=_.decay,_.castShadow){const e=_.shadow,t=n.get(_);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[c]=t,r.pointShadowMap[c]=M,r.pointShadowMatrix[c]=_.shadow.matrix,p++}r.point[c]=e,c++}else if(_.isHemisphereLight){const e=t.get(_);e.skyColor.copy(_.color).multiplyScalar(x),e.groundColor.copy(_.groundColor).multiplyScalar(x),r.hemi[d]=e,d++}}h>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=OP.LTC_FLOAT_1,r.rectAreaLTC2=OP.LTC_FLOAT_2):(r.rectAreaLTC1=OP.LTC_HALF_1,r.rectAreaLTC2=OP.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;const _=r.hash;_.directionalLength===l&&_.pointLength===c&&_.spotLength===u&&_.rectAreaLength===h&&_.hemiLength===d&&_.numDirectionalShadows===f&&_.numPointShadows===p&&_.numSpotShadows===m&&_.numSpotMaps===g&&_.numLightProbes===y||(r.directional.length=l,r.spot.length=u,r.rectArea.length=h,r.point.length=c,r.hemi.length=d,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=p,r.pointShadowMap.length=p,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=p,r.spotLightMatrix.length=m+g-v,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=v,r.numLightProbes=y,_.directionalLength=l,_.pointLength=c,_.spotLength=u,_.rectAreaLength=h,_.hemiLength=d,_.numDirectionalShadows=f,_.numPointShadows=p,_.numSpotShadows=m,_.numSpotMaps=g,_.numLightProbes=y,r.version=ZI++)},setupView:function(e,t){let n=0,s=0,l=0,c=0,u=0;const h=t.matrixWorldInverse;for(let d=0,f=e.length;d<f;d++){const t=e[d];if(t.isDirectionalLight){const e=r.directional[n];e.direction.setFromMatrixPosition(t.matrixWorld),i.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(h),n++}else if(t.isSpotLight){const e=r.spot[l];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(t.matrixWorld),i.setFromMatrixPosition(t.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(h),l++}else if(t.isRectAreaLight){const e=r.rectArea[c];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),o.identity(),a.copy(t.matrixWorld),a.premultiply(h),o.extractRotation(a),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(t.isPointLight){const e=r.point[s];e.position.setFromMatrixPosition(t.matrixWorld),e.position.applyMatrix4(h),s++}else if(t.isHemisphereLight){const e=r.hemi[u];e.direction.setFromMatrixPosition(t.matrixWorld),e.direction.transformDirection(h),u++}}},state:r}}function eN(e){const t=new QI(e),n=[],r=[];const i={lightsArray:n,shadowsArray:r,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){i.camera=e,n.length=0,r.length=0},state:i,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function tN(e){let t=new WeakMap;return{get:function(n,r=0){const i=t.get(n);let a;return void 0===i?(a=new eN(e),t.set(n,[a])):r>=i.length?(a=new eN(e),i.push(a)):a=i[r],a},dispose:function(){t=new WeakMap}}}class nN extends AR{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class rN extends AR{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}}function iN(e,t,n){let r=new RP;const i=new LA,a=new LA,o=new QA,s=new nN({depthPacking:3201}),l=new rN,c={},u=n.maxTextureSize,h={[lE]:1,[cE]:0,[uE]:2},d=new fP({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new LA},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const p=new VR;p.setAttribute("position",new LR(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new oP(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;function y(n,r){const a=t.update(m);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new tC(i.x,i.y)),d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,d,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,f,m,null)}function _(t,n,r,i){let a=null;const o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?l:s,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=a.uuid,t=n.uuid;let r=c[e];void 0===r&&(r={},c[e]=r);let i=r[t];void 0===i&&(i=a.clone(),r[t]=i,n.addEventListener("dispose",x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=3===i?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=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,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial){e.properties.get(a).light=r}return a}function b(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),l=n.material;if(Array.isArray(l)){const t=r.groups;for(let c=0,u=t.length;c<u;c++){const u=t[c],h=l[u.materialIndex];if(h&&h.visible){const t=_(n,h,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(l.visible){const t=_(n,l,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)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)b(l[e],i,a,o,s)}function x(e){e.target.removeEventListener("dispose",x);for(const t in c){const n=c[t],r=e.target.uuid;if(r in n){n[r].dispose(),delete n[r]}}}this.render=function(t,n,s){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);const f=3!==v&&3===this.type,p=3===v&&3!==this.type;for(let m=0,g=t.length;m<g;m++){const l=t[m],c=l.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;i.copy(c.mapSize);const h=c.getFrameExtents();if(i.multiply(h),a.copy(c.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/h.x),i.x=a.x*h.x,c.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/h.y),i.y=a.y*h.y,c.mapSize.y=a.y)),null===c.map||!0===f||!0===p){const e=3!==this.type?{minFilter:zE,magFilter:zE}:{};null!==c.map&&c.map.dispose(),c.map=new tC(i.x,i.y,e),c.map.texture.name=l.name+".shadowMap",c.camera.updateProjectionMatrix()}e.setRenderTarget(c.map),e.clear();const g=c.getViewportCount();for(let e=0;e<g;e++){const t=c.getViewport(e);o.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),d.viewport(o),c.updateMatrices(l,e),r=c.getFrustum(),b(n,s,c.camera,l,this.type)}!0!==c.isPointLightShadow&&3===this.type&&y(c,s),c.needsUpdate=!1}v=this.type,g.needsUpdate=!1,e.setRenderTarget(l,c,h)}}function aN(e){const t=new function(){let t=!1;const n=new QA;let r=null;const i=new QA(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){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},n=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(t){t?z(e.DEPTH_TEST):B(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==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:default: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)}r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},r=new function(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,c=null;return{setTest:function(n){t||(n?z(e.STENCIL_TEST):B(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&&l===r||(e.stencilOp(t,n,r),o=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,c=null}}},i=new WeakMap,a=new WeakMap;let o={},s={},l=new WeakMap,c=[],u=null,h=!1,d=null,f=null,p=null,m=null,g=null,v=null,y=null,_=new wR(0,0,0),b=0,x=!1,S=null,M=null,w=null,E=null,T=null;const A=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let C=!1,R=0;const P=e.getParameter(e.VERSION);-1!==P.indexOf("WebGL")?(R=parseFloat(/^WebGL (\d)/.exec(P)[1]),C=R>=1):-1!==P.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(P)[1]),C=R>=2);let L=null,I={};const N=e.getParameter(e.SCISSOR_BOX),O=e.getParameter(e.VIEWPORT),D=(new QA).fromArray(N),U=(new QA).fromArray(O);function k(t,n,r,i){const 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 s=0;s<r;s++)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+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}const F={};function z(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function B(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}F[e.TEXTURE_2D]=k(e.TEXTURE_2D,e.TEXTURE_2D,1),F[e.TEXTURE_CUBE_MAP]=k(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),F[e.TEXTURE_2D_ARRAY]=k(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),F[e.TEXTURE_3D]=k(e.TEXTURE_3D,e.TEXTURE_3D,1,1),t.setClear(0,0,0,1),n.setClear(1),r.setClear(0),z(e.DEPTH_TEST),n.setFunc(3),G(!1),W(1),z(e.CULL_FACE),j(0);const H={[fE]:e.FUNC_ADD,[pE]:e.FUNC_SUBTRACT,[mE]:e.FUNC_REVERSE_SUBTRACT};H[103]=e.MIN,H[104]=e.MAX;const V={[gE]:e.ZERO,[vE]:e.ONE,[yE]:e.SRC_COLOR,[bE]:e.SRC_ALPHA,[TE]:e.SRC_ALPHA_SATURATE,[wE]:e.DST_COLOR,[SE]:e.DST_ALPHA,[_E]:e.ONE_MINUS_SRC_COLOR,[xE]:e.ONE_MINUS_SRC_ALPHA,[EE]:e.ONE_MINUS_DST_COLOR,[ME]:e.ONE_MINUS_DST_ALPHA,[AE]:e.CONSTANT_COLOR,[CE]:e.ONE_MINUS_CONSTANT_COLOR,[RE]:e.CONSTANT_ALPHA,[PE]:e.ONE_MINUS_CONSTANT_ALPHA};function j(t,n,r,i,a,o,s,l,c,u){if(0!==t){if(!1===h&&(z(e.BLEND),h=!0),5===t)a=a||n,o=o||r,s=s||i,n===f&&a===g||(e.blendEquationSeparate(H[n],H[a]),f=n,g=a),r===p&&i===m&&o===v&&s===y||(e.blendFuncSeparate(V[r],V[i],V[o],V[s]),p=r,m=i,v=o,y=s),!1!==l.equals(_)&&c===b||(e.blendColor(l.r,l.g,l.b,c),_.copy(l),b=c),d=t,x=!1;else if(t!==d||u!==x){if(f===fE&&g===fE||(e.blendEquation(e.FUNC_ADD),f=fE,g=fE),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.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}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.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}p=null,m=null,v=null,y=null,_.set(0,0,0),b=0,d=t,x=u}}else!0===h&&(B(e.BLEND),h=!1)}function G(t){S!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),S=t)}function W(t){0!==t?(z(e.CULL_FACE),t!==M&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):B(e.CULL_FACE),M=t}function X(t,n,r){t?(z(e.POLYGON_OFFSET_FILL),E===n&&T===r||(e.polygonOffset(n,r),E=n,T=r)):B(e.POLYGON_OFFSET_FILL)}return{buffers:{color:t,depth:n,stencil:r},enable:z,disable:B,bindFramebuffer:function(t,n){return s[t]!==n&&(e.bindFramebuffer(t,n),s[t]=n,t===e.DRAW_FRAMEBUFFER&&(s[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(s[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let r=c,i=!1;if(t){r=l.get(n),void 0===r&&(r=[],l.set(n,r));const 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)},useProgram:function(t){return u!==t&&(e.useProgram(t),u=t,!0)},setBlending:j,setMaterial:function(i,a){2===i.side?B(e.CULL_FACE):z(e.CULL_FACE);let o=1===i.side;a&&(o=!o),G(o),1===i.blending&&!1===i.transparent?j(0):j(i.blending,i.blendEquation,i.blendSrc,i.blendDst,i.blendEquationAlpha,i.blendSrcAlpha,i.blendDstAlpha,i.blendColor,i.blendAlpha,i.premultipliedAlpha),n.setFunc(i.depthFunc),n.setTest(i.depthTest),n.setMask(i.depthWrite),t.setMask(i.colorWrite);const s=i.stencilWrite;r.setTest(s),s&&(r.setMask(i.stencilWriteMask),r.setFunc(i.stencilFunc,i.stencilRef,i.stencilFuncMask),r.setOp(i.stencilFail,i.stencilZFail,i.stencilZPass)),X(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits),!0===i.alphaToCoverage?z(e.SAMPLE_ALPHA_TO_COVERAGE):B(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:G,setCullFace:W,setLineWidth:function(t){t!==w&&(C&&e.lineWidth(t),w=t)},setPolygonOffset:X,setScissorTest:function(t){t?z(e.SCISSOR_TEST):B(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+A-1),L!==t&&(e.activeTexture(t),L=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===L?e.TEXTURE0+A-1:L);let i=I[r];void 0===i&&(i={type:void 0,texture:void 0},I[r]=i),i.type===t&&i.texture===n||(L!==r&&(e.activeTexture(r),L=r),e.bindTexture(t,n||F[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=I[L];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(t,n){let r=a.get(n);void 0===r&&(r=new WeakMap,a.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=a.get(n).get(t);i.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),i.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===D.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),D.copy(t))},viewport:function(t){!1===U.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),U.copy(t))},reset:function(){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),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),o={},L=null,I={},s={},l=new WeakMap,c=[],u=null,h=!1,d=null,f=null,p=null,m=null,g=null,v=null,y=null,_=new wR(0,0,0),b=0,x=!1,S=null,M=null,w=null,E=null,T=null,D.set(0,0,e.canvas.width,e.canvas.height),U.set(0,0,e.canvas.width,e.canvas.height),t.reset(),n.reset(),r.reset()}}}function oN(e,t,n,r){const i=function(e){switch(e){case WE:case XE:return{byteLength:1,components:1};case qE:case $E:case JE:return{byteLength:2,components:1};case QE:case eT:return{byteLength:2,components:4};case KE:case YE:case ZE:return{byteLength:4,components:1};case nT:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${e}.`)}(r);switch(n){case 1021:case 1024:return e*t;case 1025:return e*t*2;case oT:case sT:return e*t/i.components*i.byteLength;case 1030:case lT:return e*t*2/i.components*i.byteLength;case 1022:return e*t*3/i.components*i.byteLength;case rT:case cT:return e*t*4/i.components*i.byteLength;case uT:case hT:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case dT:case fT:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case mT:case vT:return Math.max(e,16)*Math.max(t,8)/4;case pT:case gT:return Math.max(e,8)*Math.max(t,8)/2;case yT:case _T:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case bT:case xT:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case ST:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case MT:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case wT:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case ET:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case TT:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case AT:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case CT:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case RT:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case PT:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case LT:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case IT:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case NT:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case OT:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case DT:case UT:case kT:return Math.ceil(e/4)*Math.ceil(t/4)*16;case 36283:case FT:return Math.ceil(e/4)*Math.ceil(t/4)*8;case zT:case BT:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function sN(e,t,n,r,i,a,o){const s=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new LA,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(H){}function p(e,t){return f?new OffscreenCanvas(e,t):DA("canvas")}function m(e,t,n){let r=1;const i=B(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(r*i.width),a=Math.floor(r*i.height);void 0===h&&(h=p(n,a));const o=t?p(n,a):h;o.width=n,o.height=a;return o.getContext("2d").drawImage(e,0,0,n,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+n+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+")."),e}return e}function g(e){return e.generateMipmaps&&e.minFilter!==zE&&e.minFilter!==VE}function v(t){e.generateMipmap(t)}function y(n,r,i,a,o=!1){if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.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&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),r===e.RGBA){const t=o?nA:jA.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===rA?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 _(t,n){let r;return t?null===n||n===KE||n===tT?r=e.DEPTH24_STENCIL8:n===ZE?r=e.DEPTH32F_STENCIL8:n===qE&&(r=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===KE||n===tT?r=e.DEPTH_COMPONENT24:n===ZE?r=e.DEPTH_COMPONENT32F:n===qE&&(r=e.DEPTH_COMPONENT16),r}function b(e,t){return!0===g(e)||e.isFramebufferTexture&&e.minFilter!==zE&&e.minFilter!==VE?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function x(e){const t=e.target;t.removeEventListener("dispose",x),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=d.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&M(e),0===Object.keys(i).length&&d.delete(n)}r.remove(e)}(t),t.isVideoTexture&&u.delete(t)}function S(t){const n=t.target;n.removeEventListener("dispose",S),function(t){const n=r.get(t);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let r=0;r<6;r++){if(Array.isArray(n.__webglFramebuffer[r]))for(let t=0;t<n.__webglFramebuffer[r].length;t++)e.deleteFramebuffer(n.__webglFramebuffer[r][t]);else e.deleteFramebuffer(n.__webglFramebuffer[r]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[r])}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)}const i=t.textures;for(let a=0,s=i.length;a<s;a++){const t=r.get(i[a]);t.__webglTexture&&(e.deleteTexture(t.__webglTexture),o.memory.textures--),r.remove(i[a])}r.remove(t)}(n)}function M(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete d.get(i)[n.__cacheKey],o.memory.textures--}let w=0;function E(t,i){const a=r.get(t);if(t.isVideoTexture&&function(e){const t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void L(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}const T={[UE]:e.REPEAT,[kE]:e.CLAMP_TO_EDGE,[FE]:e.MIRRORED_REPEAT},A={[zE]:e.NEAREST,[BE]:e.NEAREST_MIPMAP_NEAREST,[HE]:e.NEAREST_MIPMAP_LINEAR,[VE]:e.LINEAR,[jE]:e.LINEAR_MIPMAP_NEAREST,[GE]:e.LINEAR_MIPMAP_LINEAR},C={[sA]:e.NEVER,[pA]:e.ALWAYS,[lA]:e.LESS,[uA]:e.LEQUAL,[cA]:e.EQUAL,[fA]:e.GEQUAL,[hA]:e.GREATER,[dA]:e.NOTEQUAL};function R(n,a){if(a.type!==ZE||!1!==t.has("OES_texture_float_linear")||a.magFilter!==VE&&a.magFilter!==jE&&a.magFilter!==HE&&a.magFilter!==GE&&a.minFilter!==VE&&a.minFilter!==jE&&a.minFilter!==HE&&a.minFilter!==GE||console.warn("THREE.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,T[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,T[a.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,T[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(a.magFilter===zE)return;if(a.minFilter!==HE&&a.minFilter!==GE)return;if(a.type===ZE&&!1===t.has("OES_texture_float_linear"))return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){const 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 P(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",x));const i=n.source;let a=d.get(i);void 0===a&&(a={},d.set(i,a));const s=function(e){const 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()}(n);if(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;const i=a[t.__cacheKey];void 0!==i&&(a[t.__cacheKey].usedTimes--,0===i.usedTimes&&M(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function L(t,o,s){let l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);const c=P(t,o),u=o.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);const h=r.get(u);if(u.version!==h.__version||!0===c){n.activeTexture(e.TEXTURE0+s);const t=jA.getPrimaries(jA.workingColorSpace),r=o.colorSpace===ZT?null:jA.getPrimaries(o.colorSpace),d=o.colorSpace===ZT||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=m(o.image,!1,i.maxTextureSize);f=z(o,f);const p=a.convert(o.format,o.colorSpace),x=a.convert(o.type);let S,M=y(o.internalFormat,p,x,o.colorSpace,o.isVideoTexture);R(l,o);const w=o.mipmaps,E=!0!==o.isVideoTexture,T=void 0===h.__version||!0===c,A=u.dataReady,C=b(o,f);if(o.isDepthTexture)M=_(o.format===aT,o.type),T&&(E?n.texStorage2D(e.TEXTURE_2D,1,M,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,p,x,null));else if(o.isDataTexture)if(w.length>0){E&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,w[0].width,w[0].height);for(let t=0,r=w.length;t<r;t++)S=w[t],E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,x,S.data):n.texImage2D(e.TEXTURE_2D,t,M,S.width,S.height,0,p,x,S.data);o.generateMipmaps=!1}else E?(T&&n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height),A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,f.width,f.height,p,x,f.data)):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,p,x,f.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){E&&T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,M,w[0].width,w[0].height,f.depth);for(let t=0,r=w.length;t<r;t++)if(S=w[t],o.format!==rT)if(null!==p)if(E){if(A)if(o.layerUpdates.size>0){const r=oN(S.width,S.height,o.format,o.type);for(const i of o.layerUpdates){const a=S.data.subarray(i*r/S.data.BYTES_PER_ELEMENT,(i+1)*r/S.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,S.width,S.height,1,p,a,0,0)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,f.depth,p,S.data,0,0)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,M,S.width,S.height,f.depth,0,S.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else E?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,S.width,S.height,f.depth,p,x,S.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,M,S.width,S.height,f.depth,0,p,x,S.data)}else{E&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,w[0].width,w[0].height);for(let t=0,r=w.length;t<r;t++)S=w[t],o.format!==rT?null!==p?E?A&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,S.data):n.compressedTexImage2D(e.TEXTURE_2D,t,M,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,S.width,S.height,p,x,S.data):n.texImage2D(e.TEXTURE_2D,t,M,S.width,S.height,0,p,x,S.data)}else if(o.isDataArrayTexture)if(E){if(T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,M,f.width,f.height,f.depth),A)if(o.layerUpdates.size>0){const t=oN(f.width,f.height,o.format,o.type);for(const r of o.layerUpdates){const i=f.data.subarray(r*t/f.data.BYTES_PER_ELEMENT,(r+1)*t/f.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,f.width,f.height,1,p,x,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,p,x,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,M,f.width,f.height,f.depth,0,p,x,f.data);else if(o.isData3DTexture)E?(T&&n.texStorage3D(e.TEXTURE_3D,C,M,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,p,x,f.data)):n.texImage3D(e.TEXTURE_3D,0,M,f.width,f.height,f.depth,0,p,x,f.data);else if(o.isFramebufferTexture){if(T)if(E)n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height);else{let t=f.width,r=f.height;for(let i=0;i<C;i++)n.texImage2D(e.TEXTURE_2D,i,M,t,r,0,p,x,null),t>>=1,r>>=1}}else if(w.length>0){if(E&&T){const t=B(w[0]);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}for(let t=0,r=w.length;t<r;t++)S=w[t],E?A&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,p,x,S):n.texImage2D(e.TEXTURE_2D,t,M,p,x,S);o.generateMipmaps=!1}else if(E){if(T){const t=B(f);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,p,x,f)}else n.texImage2D(e.TEXTURE_2D,0,M,p,x,f);g(o)&&v(l),h.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function I(t,i,o,l,c,u){const h=a.convert(o.format,o.colorSpace),d=a.convert(o.type),f=y(o.internalFormat,h,d,o.colorSpace);if(!r.get(i).__hasExternalTextures){const t=Math.max(1,i.width>>u),r=Math.max(1,i.height>>u);c===e.TEXTURE_3D||c===e.TEXTURE_2D_ARRAY?n.texImage3D(c,u,f,t,r,i.depth,0,h,d,null):n.texImage2D(c,u,f,t,r,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,c,r.get(o).__webglTexture,0,k(i)):(c===e.TEXTURE_2D||c>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&c<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,c,r.get(o).__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function N(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){const i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=_(n.stencilBuffer,a),l=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=k(n);F(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,c,o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,c,o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=n.textures;for(let i=0;i<t.length;i++){const o=t[i],l=a.convert(o.format,o.colorSpace),c=a.convert(o.type),u=y(o.internalFormat,l,c,o.colorSpace),h=k(n);r&&!1===F(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,h,u,n.width,n.height):F(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,h,u,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,u,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function O(t){const i=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__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),E(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,o=k(i);if(i.depthTexture.format===iT)F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==aT)throw new Error("Unknown depthTexture format");F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,o):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,t)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),N(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),N(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}const D=[],U=[];function k(e){return Math.min(i.maxSamples,e.samples)}function F(e){const n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function z(e,t){const n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==QT&&n!==ZT&&(jA.getTransfer(n)===rA?r===rT&&i===WE||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function B(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWidth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){const e=w;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),w+=1,e},this.resetTextureUnits=function(){w=0},this.setTexture2D=E,this.setTexture2DArray=function(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?L(a,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?L(a,t,i):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){const s=r.get(t);t.version>0&&s.__version!==t.version?function(t,o,s){if(6!==o.image.length)return;const l=P(t,o),c=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);const u=r.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(e.TEXTURE0+s);const t=jA.getPrimaries(jA.workingColorSpace),r=o.colorSpace===ZT?null:jA.getPrimaries(o.colorSpace),h=o.colorSpace===ZT||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,h);const d=o.isCompressedTexture||o.image[0].isCompressedTexture,f=o.image[0]&&o.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=d||f?f?o.image[e].image:o.image[e]:m(o.image[e],!0,i.maxCubemapSize),p[e]=z(o,p[e]);const _=p[0],x=a.convert(o.format,o.colorSpace),S=a.convert(o.type),M=y(o.internalFormat,x,S,o.colorSpace),w=!0!==o.isVideoTexture,E=void 0===u.__version||!0===l,T=c.dataReady;let A,C=b(o,_);if(R(e.TEXTURE_CUBE_MAP,o),d){w&&E&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,M,_.width,_.height);for(let t=0;t<6;t++){A=p[t].mipmaps;for(let r=0;r<A.length;r++){const i=A[r];o.format!==rT?null!==x?w?T&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,x,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,M,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):w?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,x,S,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,M,i.width,i.height,0,x,S,i.data)}}}else{if(A=o.mipmaps,w&&E){A.length>0&&C++;const t=B(p[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,M,t.width,t.height)}for(let t=0;t<6;t++)if(f){w?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,p[t].width,p[t].height,x,S,p[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,M,p[t].width,p[t].height,0,x,S,p[t].data);for(let r=0;r<A.length;r++){const i=A[r].image[t].image;w?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,x,S,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,M,i.width,i.height,0,x,S,i.data)}}else{w?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,x,S,p[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,M,x,S,p[t]);for(let r=0;r<A.length;r++){const i=A[r];w?T&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,x,S,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,M,x,S,i.image[t])}}}g(o)&&v(e.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(s,t,o):n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,n,i){const a=r.get(t);void 0!==n&&I(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&O(t)},this.setupRenderTarget=function(t){const i=t.texture,s=r.get(t),l=r.get(i);t.addEventListener("dispose",S);const c=t.textures,u=!0===t.isWebGLCubeRenderTarget,h=c.length>1;if(h||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__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(h)for(let t=0,n=c.length;t<n;t++){const n=r.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===F(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){const r=c[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);const i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),l=y(r.internalFormat,i,o,r.colorSpace,!0===t.isXRRenderTarget),u=k(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,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(),N(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),R(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++)I(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else I(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(i)&&v(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(let i=0,a=c.length;i<a;i++){const a=c[i],o=r.get(a);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),R(e.TEXTURE_2D,a),I(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,e.TEXTURE_2D,0),g(a)&&v(e.TEXTURE_2D)}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,l.__webglTexture),R(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)I(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else I(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);g(i)&&v(r),n.unbindTexture()}t.depthBuffer&&O(t)},this.updateRenderTargetMipmap=function(t){const i=t.textures;for(let a=0,o=i.length;a<o;a++){const o=i[a];if(g(o)){const i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=r.get(o).__webglTexture;n.bindTexture(i,a),v(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===F(t)){const i=t.textures,a=t.width,o=t.height;let s=e.COLOR_BUFFER_BIT;const c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),h=i.length>1;if(h)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),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)),h){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,u.__webglColorRenderbuffer[n]);const 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),!0===l&&(D.length=0,U.length=0,D.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(D.push(c),U.push(c),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,U)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,D))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)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]);const 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&&!1===t.resolveDepthBuffer&&l){const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=O,this.setupFrameBufferTexture=I,this.useMultisampledRTT=F}function lN(e,t){return{convert:function(n,r=""){let i;const a=jA.getTransfer(r);if(n===WE)return e.UNSIGNED_BYTE;if(n===QE)return e.UNSIGNED_SHORT_4_4_4_4;if(n===eT)return e.UNSIGNED_SHORT_5_5_5_1;if(n===nT)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===XE)return e.BYTE;if(n===$E)return e.SHORT;if(n===qE)return e.UNSIGNED_SHORT;if(n===YE)return e.INT;if(n===KE)return e.UNSIGNED_INT;if(n===ZE)return e.FLOAT;if(n===JE)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(n===rT)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(n===iT)return e.DEPTH_COMPONENT;if(n===aT)return e.DEPTH_STENCIL;if(n===oT)return e.RED;if(n===sT)return e.RED_INTEGER;if(1030===n)return e.RG;if(n===lT)return e.RG_INTEGER;if(n===cT)return e.RGBA_INTEGER;if(n===uT||n===hT||n===dT||n===fT)if(a===rA){if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(n===uT)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===hT)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===dT)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===fT)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=t.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(n===uT)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===hT)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===dT)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===fT)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===pT||n===mT||n===gT||n===vT){if(i=t.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(n===pT)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===mT)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===gT)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===vT)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===yT||n===_T||n===bT){if(i=t.get("WEBGL_compressed_texture_etc"),null===i)return null;if(n===yT||n===_T)return a===rA?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===bT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(n===xT||n===ST||n===MT||n===wT||n===ET||n===TT||n===AT||n===CT||n===RT||n===PT||n===LT||n===IT||n===NT||n===OT){if(i=t.get("WEBGL_compressed_texture_astc"),null===i)return null;if(n===xT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ST)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===MT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===wT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===ET)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===TT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===AT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===CT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===RT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===PT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===LT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===IT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===NT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===OT)return a===rA?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===DT||n===UT||n===kT){if(i=t.get("EXT_texture_compression_bptc"),null===i)return null;if(n===DT)return a===rA?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===UT)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===kT)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||n===FT||n===zT||n===BT){if(i=t.get("EXT_texture_compression_rgtc"),null===i)return null;if(n===DT)return i.COMPRESSED_RED_RGTC1_EXT;if(n===FT)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===zT)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===BT)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===tT?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class cN extends yP{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class uN extends lR{constructor(){super(),this.isGroup=!0,this.type="Group"}}const hN={type:"move"};class dN{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new uN,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new uN,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new aC,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new aC),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new uN,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new aC,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new aC),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){a=!0;for(const a of e.hand.values()){const e=t.getJointPose(a,n),r=this._getHandJoint(l,a);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,c=.005;l.inputState.pinching&&o>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(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));null!==o&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(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(hN)))}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new uN;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class fN{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const r=new JA;e.properties.get(r).__webglTexture=t.texture,t.depthNear==n.depthNear&&t.depthFar==n.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new fP({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new oP(new IP(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class pN extends _A{constructor(e,t){super();const n=this;let r=null,i=1,a=null,o="local-floor",s=1,l=null,c=null,u=null,h=null,d=null,f=null;const p=new fN,m=t.getContextAttributes();let g=null,v=null;const y=[],_=[],b=new LA;let x=null;const S=new yP;S.layers.enable(1),S.viewport=new QA;const M=new yP;M.layers.enable(2),M.viewport=new QA;const w=[S,M],E=new cN;E.layers.enable(1),E.layers.enable(2);let T=null,A=null;function C(e){const t=_.indexOf(e.inputSource);if(-1===t)return;const n=y[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function R(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",P);for(let e=0;e<y.length;e++){const t=_[e];null!==t&&(_[e]=null,y[e].disconnect(t))}T=null,A=null,p.reset(),e.setRenderTarget(g),d=null,h=null,u=null,r=null,v=null,D.stop(),n.isPresenting=!1,e.setPixelRatio(x),e.setSize(b.width,b.height,!1),n.dispatchEvent({type:"sessionend"})}function P(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=_.indexOf(n);r>=0&&(_[r]=null,y[r].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=_.indexOf(n);if(-1===r){for(let e=0;e<y.length;e++){if(e>=_.length){_.push(n),r=e;break}if(null===_[e]){_[e]=n,r=e;break}}if(-1===r)break}const i=y[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new dN,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new dN,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new dN,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return u},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(c){if(r=c,null!==r){if(g=e.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",R),r.addEventListener("inputsourceschange",P),!0!==m.xrCompatible&&await t.makeXRCompatible(),x=e.getPixelRatio(),e.getSize(b),void 0===r.renderState.layers){const n={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),v=new tC(d.framebufferWidth,d.framebufferHeight,{format:rT,type:WE,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,a=null,o=null;m.depth&&(o=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=m.stencil?aT:iT,a=m.stencil?tT:KE);const s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};u=new XRWebGLBinding(r,t),h=u.createProjectionLayer(s),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),v=new tC(h.textureWidth,h.textureHeight,{format:rT,type:WE,depthTexture:new gL(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:!1===h.ignoreDepthValues})}v.isXRRenderTarget=!0,this.setFoveation(s),l=null,a=await r.requestReferenceSpace(o),D.setContext(r),D.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};const L=new aC,I=new aC;function N(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;null!==p.texture&&(e.near=p.depthNear,e.far=p.depthFar),E.near=M.near=S.near=e.near,E.far=M.far=S.far=e.far,T===E.near&&A===E.far||(r.updateRenderState({depthNear:E.near,depthFar:E.far}),T=E.near,A=E.far,S.near=T,S.far=A,M.near=T,M.far=A,S.updateProjectionMatrix(),M.updateProjectionMatrix(),e.updateProjectionMatrix());const t=e.parent,n=E.cameras;N(E,t);for(let r=0;r<n.length;r++)N(n[r],t);2===n.length?function(e,t,n){L.setFromMatrixPosition(t.matrixWorld),I.setFromMatrixPosition(n.matrixWorld);const r=L.distanceTo(I),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(a[8]+1)/a[0],d=o*u,f=o*h,p=r/(-u+h),m=p*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=o+p,v=s+p,y=d-m,_=f+(r-m),b=l*s/v*g,x=c*s/v*g;e.projectionMatrix.makePerspective(y,_,b,x,g,v),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(E,S,M):E.projectionMatrix.copy(S.projectionMatrix),function(e,t,n){null===n?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=2*MA*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,E,t)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==h||null!==d)return s},this.setFoveation=function(e){s=e,null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(E)};let O=null;const D=new PP;D.setAnimationLoop((function(t,i){if(c=i.getViewerPose(l||a),f=i,null!==c){const t=c.views;null!==d&&(e.setRenderTargetFramebuffer(v,d.framebuffer),e.setRenderTarget(v));let n=!1;t.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let a=null;if(null!==d)a=d.getViewport(i);else{const t=u.getViewSubImage(h,i);a=t.viewport,0===r&&(e.setRenderTargetTextures(v,t.colorTexture,h.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(v))}let o=w[r];void 0===o&&(o=new yP,o.layers.enable(r),o.viewport=new QA,w[r]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===r&&(E.matrix.copy(o.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(o)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=u.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&p.init(e,n,r.renderState)}}for(let e=0;e<y.length;e++){const t=_[e],n=y[e];null!==t&&void 0!==n&&n.update(t,i,l||a)}O&&O(t,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),f=null})),this.setAnimationLoop=function(e){O=e},this.dispose=function(){}}}const mN=new WC,gN=new DC;function vN(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(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,1===r.side&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),1===r.side&&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);const i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,mN.copy(o),mN.x*=-1,mN.y*=-1,mN.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(mN.y*=-1,mN.z*=-1),e.envMapRotation.value.setFromMatrix4(gN.makeRotationFromEuler(mN)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-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))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,hP(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(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)}(e,i),i.isMeshPhysicalMaterial&&function(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),1===t.side&&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))}(e,i,s)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){const 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}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(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))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,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)}(e,i,a,o):i.isSpriteMaterial?function(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)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function yN(e,t,n,r){let i={},a={},o=[];const s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,n,r){const i=e.value,a=t+"_"+n;if(void 0===r[a])return r[a]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const e=r[a];if("number"==typeof i||"boolean"==typeof i){if(e!==i)return r[a]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function c(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(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?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){const n=t.target;n.removeEventListener("dispose",u);const r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,h){let d=i[n.id];void 0===d&&(!function(e){const t=e.uniforms;let n=0;const r=16;for(let a=0,o=t.length;a<o;a++){const e=Array.isArray(t[a])?t[a]:[t[a]];for(let t=0,i=e.length;t<i;t++){const i=e[t],a=Array.isArray(i.value)?i.value:[i.value];for(let e=0,t=a.length;e<t;e++){const t=c(a[e]),o=n%r,s=o%t.boundary,l=o+s;n+=s,0!==l&&r-l<t.storage&&(n+=r-l),i.__data=new Float32Array(t.storage/Float32Array.BYTES_PER_ELEMENT),i.__offset=n,n+=t.storage}}}const i=n%r;i>0&&(n+=r-i);e.__size=n,e.__cache={}}(n),d=function(t){const n=function(){for(let e=0;e<s;e++)if(-1===o.indexOf(e))return o.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;const 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}(n),i[n.id]=d,n.addEventListener("dispose",u));const f=h.program;r.updateUBOMapping(n,f);const p=t.render.frame;a[n.id]!==p&&(!function(t){const n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let i=0,o=r.length;i<o;i++){const t=Array.isArray(r[i])?r[i]:[r[i]];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!0===l(r,i,n,a)){const t=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let a=0;a<n.length;a++){const o=n[a],s=c(o);"number"==typeof o||"boolean"==typeof o?(r.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+i,r.__data)):o.isMatrix3?(r.__data[0]=o.elements[0],r.__data[1]=o.elements[1],r.__data[2]=o.elements[2],r.__data[3]=0,r.__data[4]=o.elements[3],r.__data[5]=o.elements[4],r.__data[6]=o.elements[5],r.__data[7]=0,r.__data[8]=o.elements[6],r.__data[9]=o.elements[7],r.__data[10]=o.elements[8],r.__data[11]=0):(o.toArray(r.__data,i),i+=s.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,r.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=p)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}}}class _N{constructor(e={}){const{canvas:t=UA(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=e;let h;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=n.getContextAttributes().alpha}else h=a;const d=new Uint32Array(4),f=new Int32Array(4);let p=null,m=null;const g=[],v=[];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._outputColorSpace=JT,this.toneMapping=0,this.toneMappingExposure=1;const y=this;let _=!1,b=0,x=0,S=null,M=-1,w=null;const E=new QA,T=new QA;let A=null;const C=new wR(0);let R=0,P=t.width,L=t.height,I=1,N=null,O=null;const D=new QA(0,0,P,L),U=new QA(0,0,P,L);let k=!1;const F=new RP;let z=!1,B=!1;const H=new DC,V=new aC,j=new QA,G={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let W=!1;function X(){return null===S?I:1}let $,q,Y,K,Z,J,Q,ee,te,ne,re,ie,ae,oe,se,le,ce,ue,he,de,fe,pe,me,ge,ve=n;function ye(e,n){return t.getContext(e,n)}try{const e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${aE}`),t.addEventListener("webglcontextlost",xe,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",Me,!1),null===ve){const t="webgl2";if(ve=ye(t,e),null===ve)throw ye(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(Fe){throw console.error("THREE.WebGLRenderer: "+Fe.message),Fe}function _e(){$=new uL(ve),$.init(),pe=new lN(ve,$),q=new VP(ve,$,e,pe),Y=new aN(ve),K=new fL(ve),Z=new WI,J=new sN(ve,$,Y,Z,q,pe,K),Q=new GP(y),ee=new cL(y),te=new LP(ve),me=new BP(ve,te),ne=new hL(ve,te,K,me),re=new mL(ve,ne,te,K),he=new pL(ve,q,J),le=new jP(Z),ie=new GI(y,Q,ee,$,q,me,le),ae=new vN(y,Z),oe=new YI,se=new tN($),ue=new zP(y,Q,ee,Y,re,h,s),ce=new iN(y,re,q),ge=new yN(ve,K,q,Y),de=new HP(ve,$,K),fe=new dL(ve,$,K),K.programs=ie.programs,y.capabilities=q,y.extensions=$,y.properties=Z,y.renderLists=oe,y.shadowMap=ce,y.state=Y,y.info=K}_e();const be=new pN(y,ve);function xe(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),_=!0}function Se(){console.log("THREE.WebGLRenderer: Context Restored."),_=!1;const e=K.autoReset,t=ce.enabled,n=ce.autoUpdate,r=ce.needsUpdate,i=ce.type;_e(),K.autoReset=e,ce.enabled=t,ce.autoUpdate=n,ce.needsUpdate=r,ce.type=i}function Me(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function we(e){const t=e.target;t.removeEventListener("dispose",we),function(e){(function(e){const t=Z.get(e).programs;void 0!==t&&(t.forEach((function(e){ie.releaseProgram(e)})),e.isShaderMaterial&&ie.releaseShaderCache(e))})(e),Z.remove(e)}(t)}function Ee(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,De(e,t,n),e.side=0,e.needsUpdate=!0,De(e,t,n),e.side=2):De(e,t,n)}this.xr=be,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const e=$.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=$.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(e){void 0!==e&&(I=e,this.setSize(P,L,!1))},this.getSize=function(e){return e.set(P,L)},this.setSize=function(e,n,r=!0){be.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=e,L=n,t.width=Math.floor(e*I),t.height=Math.floor(n*I),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(P*I,L*I).floor()},this.setDrawingBufferSize=function(e,n,r){P=e,L=n,I=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(E)},this.getViewport=function(e){return e.copy(D)},this.setViewport=function(e,t,n,r){e.isVector4?D.set(e.x,e.y,e.z,e.w):D.set(e,t,n,r),Y.viewport(E.copy(D).multiplyScalar(I).round())},this.getScissor=function(e){return e.copy(U)},this.setScissor=function(e,t,n,r){e.isVector4?U.set(e.x,e.y,e.z,e.w):U.set(e,t,n,r),Y.scissor(T.copy(U).multiplyScalar(I).round())},this.getScissorTest=function(){return k},this.setScissorTest=function(e){Y.setScissorTest(k=e)},this.setOpaqueSort=function(e){N=e},this.setTransparentSort=function(e){O=e},this.getClearColor=function(e){return e.copy(ue.getClearColor())},this.setClearColor=function(){ue.setClearColor.apply(ue,arguments)},this.getClearAlpha=function(){return ue.getClearAlpha()},this.setClearAlpha=function(){ue.setClearAlpha.apply(ue,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(null!==S){const t=S.texture.format;e=t===cT||t===lT||t===sT}if(e){const e=S.texture.type,t=e===WE||e===KE||e===qE||e===tT||e===QE||e===eT,n=ue.getClearColor(),r=ue.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(d[0]=i,d[1]=a,d[2]=o,d[3]=r,ve.clearBufferuiv(ve.COLOR,0,d)):(f[0]=i,f[1]=a,f[2]=o,f[3]=r,ve.clearBufferiv(ve.COLOR,0,f))}else r|=ve.COLOR_BUFFER_BIT}t&&(r|=ve.DEPTH_BUFFER_BIT),n&&(r|=ve.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ve.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",xe,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",Me,!1),oe.dispose(),se.dispose(),Z.dispose(),Q.dispose(),ee.dispose(),re.dispose(),me.dispose(),ge.dispose(),ie.dispose(),be.dispose(),be.removeEventListener("sessionstart",Ae),be.removeEventListener("sessionend",Ce),Re.stop()},this.renderBufferDirect=function(e,t,n,r,i,a){null===t&&(t=G);const o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(e,t,n,r,i){!0!==t.isScene&&(t=G);J.resetTextureUnits();const a=t.fog,o=r.isMeshStandardMaterial?t.environment:null,s=null===S?y.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:QT,l=(r.isMeshStandardMaterial?ee:Q).get(r.envMap||o),c=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),h=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let p=0;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(p=y.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,_=Z.get(r),b=m.state.lights;if(!0===z&&(!0===B||e!==w)){const t=e===w&&r.id===M;le.setState(r,e,t)}let x=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==b.state.version||_.outputColorSpace!==s||i.isBatchedMesh&&!1===_.batching?x=!0:i.isBatchedMesh||!0!==_.batching?i.isBatchedMesh&&!0===_.batchingColor&&null===i.colorTexture||i.isBatchedMesh&&!1===_.batchingColor&&null!==i.colorTexture||i.isInstancedMesh&&!1===_.instancing?x=!0:i.isInstancedMesh||!0!==_.instancing?i.isSkinnedMesh&&!1===_.skinning?x=!0:i.isSkinnedMesh||!0!==_.skinning?i.isInstancedMesh&&!0===_.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===_.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===_.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===_.instancingMorph&&null!==i.morphTexture||_.envMap!==l||!0===r.fog&&_.fog!==a?x=!0:void 0===_.numClippingPlanes||_.numClippingPlanes===le.numPlanes&&_.numIntersection===le.numIntersection?(_.vertexAlphas!==c||_.vertexTangents!==u||_.morphTargets!==h||_.morphNormals!==d||_.morphColors!==f||_.toneMapping!==p||_.morphTargetsCount!==v)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,_.__version=r.version);let E=_.currentProgram;!0===x&&(E=De(r,t,i));let T=!1,A=!1,C=!1;const R=E.getUniforms(),P=_.uniforms;Y.useProgram(E.program)&&(T=!0,A=!0,C=!0);r.id!==M&&(M=r.id,A=!0);if(T||w!==e){R.setValue(ve,"projectionMatrix",e.projectionMatrix),R.setValue(ve,"viewMatrix",e.matrixWorldInverse);const t=R.map.cameraPosition;void 0!==t&&t.setValue(ve,V.setFromMatrixPosition(e.matrixWorld)),q.logarithmicDepthBuffer&&R.setValue(ve,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&R.setValue(ve,"isOrthographic",!0===e.isOrthographicCamera),w!==e&&(w=e,A=!0,C=!0)}if(i.isSkinnedMesh){R.setOptional(ve,i,"bindMatrix"),R.setOptional(ve,i,"bindMatrixInverse");const e=i.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),R.setValue(ve,"boneTexture",e.boneTexture,J))}i.isBatchedMesh&&(R.setOptional(ve,i,"batchingTexture"),R.setValue(ve,"batchingTexture",i._matricesTexture,J),R.setOptional(ve,i,"batchingIdTexture"),R.setValue(ve,"batchingIdTexture",i._indirectTexture,J),R.setOptional(ve,i,"batchingColorTexture"),null!==i._colorsTexture&&R.setValue(ve,"batchingColorTexture",i._colorsTexture,J));const N=n.morphAttributes;void 0===N.position&&void 0===N.normal&&void 0===N.color||he.update(i,n,E);(A||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,R.setValue(ve,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(P.envMap.value=l,P.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);r.isMeshStandardMaterial&&null===r.envMap&&null!==t.environment&&(P.envMapIntensity.value=t.environmentIntensity);A&&(R.setValue(ve,"toneMappingExposure",y.toneMappingExposure),_.needsLights&&(D=C,(O=P).ambientLightColor.needsUpdate=D,O.lightProbe.needsUpdate=D,O.directionalLights.needsUpdate=D,O.directionalLightShadows.needsUpdate=D,O.pointLights.needsUpdate=D,O.pointLightShadows.needsUpdate=D,O.spotLights.needsUpdate=D,O.spotLightShadows.needsUpdate=D,O.rectAreaLights.needsUpdate=D,O.hemisphereLights.needsUpdate=D),a&&!0===r.fog&&ae.refreshFogUniforms(P,a),ae.refreshMaterialUniforms(P,r,I,L,m.state.transmissionRenderTarget[e.id]),xI.upload(ve,Ue(_),P,J));var O,D;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(xI.upload(ve,Ue(_),P,J),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&R.setValue(ve,"center",i.center);if(R.setValue(ve,"modelViewMatrix",i.modelViewMatrix),R.setValue(ve,"normalMatrix",i.normalMatrix),R.setValue(ve,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];ge.update(n,E),ge.bind(n,E)}}return E}(e,t,n,r,i);Y.setMaterial(r,o);let l=n.index,c=1;if(!0===r.wireframe){if(l=ne.getWireframeAttribute(n),void 0===l)return;c=2}const u=n.drawRange,h=n.attributes.position;let d=u.start*c,f=(u.start+u.count)*c;null!==a&&(d=Math.max(d,a.start*c),f=Math.min(f,(a.start+a.count)*c)),null!==l?(d=Math.max(d,0),f=Math.min(f,l.count)):null!=h&&(d=Math.max(d,0),f=Math.min(f,h.count));const p=f-d;if(p<0||p===1/0)return;let g;me.setup(i,r,s,n,l);let v=de;if(null!==l&&(g=te.get(l),v=fe,v.setIndex(g)),i.isMesh)!0===r.wireframe?(Y.setLineWidth(r.wireframeLinewidth*X()),v.setMode(ve.LINES)):v.setMode(ve.TRIANGLES);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),Y.setLineWidth(e*X()),i.isLineSegments?v.setMode(ve.LINES):i.isLineLoop?v.setMode(ve.LINE_LOOP):v.setMode(ve.LINE_STRIP)}else i.isPoints?v.setMode(ve.POINTS):i.isSprite&&v.setMode(ve.TRIANGLES);if(i.isBatchedMesh)if(null!==i._multiDrawInstances)v.renderMultiDrawInstances(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount,i._multiDrawInstances);else if($.get("WEBGL_multi_draw"))v.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{const e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,a=l?te.get(l).bytesPerElement:1,o=Z.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)o.setValue(ve,"_gl_DrawID",r),v.render(e[r]/a,t[r])}else if(i.isInstancedMesh)v.renderInstances(d,p,i.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);v.renderInstances(d,p,t)}else v.render(d,p)},this.compile=function(e,t,n=null){null===n&&(n=e),m=se.get(n),m.init(t),v.push(m),n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),e!==n&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),m.setupLights();const r=new Set;return e.traverse((function(e){const t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){const a=t[i];Ee(a,n,e),r.add(a)}else Ee(t,n,e),r.add(t)})),v.pop(),m=null,r},this.compileAsync=function(e,t,n=null){const r=this.compile(e,t,n);return new Promise((t=>{function n(){r.forEach((function(e){Z.get(e).currentProgram.isReady()&&r.delete(e)})),0!==r.size?setTimeout(n,10):t(e)}null!==$.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Te=null;function Ae(){Re.stop()}function Ce(){Re.start()}const Re=new PP;function Pe(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)m.pushLight(e),e.castShadow&&m.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||F.intersectsSprite(e)){r&&j.setFromMatrixPosition(e.matrixWorld).applyMatrix4(H);const t=re.update(e),i=e.material;i.visible&&p.push(e,t,i,n,j.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||F.intersectsObject(e))){const t=re.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),j.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),j.copy(t.boundingSphere.center)),j.applyMatrix4(e.matrixWorld).applyMatrix4(H)),Array.isArray(i)){const r=t.groups;for(let a=0,o=r.length;a<o;a++){const o=r[a],s=i[o.materialIndex];s&&s.visible&&p.push(e,t,s,n,j.z,o)}}else i.visible&&p.push(e,t,i,n,j.z,null)}const i=e.children;for(let a=0,o=i.length;a<o;a++)Pe(i[a],t,n,r)}function Le(e,t,n,r){const i=e.opaque,a=e.transmissive,o=e.transparent;m.setupLightsView(n),!0===z&&le.setGlobalState(y.clippingPlanes,n),r&&Y.viewport(E.copy(r)),i.length>0&&Ne(i,t,n),a.length>0&&Ne(a,t,n),o.length>0&&Ne(o,t,n),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Ie(e,t,n,r){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===m.state.transmissionRenderTarget[r.id]&&(m.state.transmissionRenderTarget[r.id]=new tC(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?JE:WE,minFilter:GE,samples:4,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:jA.workingColorSpace}));const a=m.state.transmissionRenderTarget[r.id],o=r.viewport||E;a.setSize(o.z,o.w);const s=y.getRenderTarget();y.setRenderTarget(a),y.getClearColor(C),R=y.getClearAlpha(),R<1&&y.setClearColor(16777215,.5),y.clear(),W&&ue.render(n);const l=y.toneMapping;y.toneMapping=0;const c=r.viewport;if(void 0!==r.viewport&&(r.viewport=void 0),m.setupLightsView(r),!0===z&&le.setGlobalState(y.clippingPlanes,r),Ne(e,n,r),J.updateMultisampleRenderTarget(a),J.updateRenderTargetMipmap(a),!1===$.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let i=0,a=t.length;i<a;i++){const a=t[i],o=a.object,s=a.geometry,l=a.material,c=a.group;if(2===l.side&&o.layers.test(r.layers)){const t=l.side;l.side=1,l.needsUpdate=!0,Oe(o,n,r,s,l,c),l.side=t,l.needsUpdate=!0,e=!0}}!0===e&&(J.updateMultisampleRenderTarget(a),J.updateRenderTargetMipmap(a))}y.setRenderTarget(s),y.setClearColor(C,R),void 0!==c&&(r.viewport=c),y.toneMapping=l}function Ne(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){const a=e[i],o=a.object,s=a.geometry,l=null===r?a.material:r,c=a.group;o.layers.test(n.layers)&&Oe(o,t,n,s,l,c)}}function Oe(e,t,n,r,i,a){e.onBeforeRender(y,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=1,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,y.renderBufferDirect(n,t,r,i,e,a),i.side=2):y.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(y,t,n,r,i,a)}function De(e,t,n){!0!==t.isScene&&(t=G);const r=Z.get(e),i=m.state.lights,a=m.state.shadowsArray,o=i.state.version,s=ie.getParameters(e,i.state,a,t,n),l=ie.getProgramCacheKey(s);let c=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?ee:Q).get(e.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===c&&(e.addEventListener("dispose",we),c=new Map,r.programs=c);let u=c.get(l);if(void 0!==u){if(r.currentProgram===u&&r.lightsStateVersion===o)return ke(e,s),u}else s.uniforms=ie.getUniforms(e),e.onBeforeCompile(s,y),u=ie.acquireProgram(s,l),c.set(l,u),r.uniforms=s.uniforms;const h=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=le.uniform),ke(e,s),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotLightMatrix.value=i.state.spotLightMatrix,h.spotLightMap.value=i.state.spotLightMap,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=u,r.uniformsList=null,u}function Ue(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=xI.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function ke(e,t){const n=Z.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}Re.setAnimationLoop((function(e){Te&&Te(e)})),"undefined"!=typeof self&&Re.setContext(self),this.setAnimationLoop=function(e){Te=e,be.setAnimationLoop(e),null===e?Re.stop():Re.start()},be.addEventListener("sessionstart",Ae),be.addEventListener("sessionend",Ce),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===_)return;if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===be.enabled&&!0===be.isPresenting&&(!0===be.cameraAutoUpdate&&be.updateCamera(t),t=be.getCamera()),!0===e.isScene&&e.onBeforeRender(y,e,t,S),m=se.get(e,v.length),m.init(t),v.push(m),H.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),F.setFromProjectionMatrix(H),B=this.localClippingEnabled,z=le.init(this.clippingPlanes,B),p=oe.get(e,g.length),p.init(),g.push(p),!0===be.enabled&&!0===be.isPresenting){const e=y.xr.getDepthSensingMesh();null!==e&&Pe(e,t,-1/0,y.sortObjects)}Pe(e,t,0,y.sortObjects),p.finish(),!0===y.sortObjects&&p.sort(N,O),W=!1===be.enabled||!1===be.isPresenting||!1===be.hasDepthSensing(),W&&ue.addToRenderList(p,e),this.info.render.frame++,!0===z&&le.beginShadows();const n=m.state.shadowsArray;ce.render(n,e,t),!0===z&&le.endShadows(),!0===this.info.autoReset&&this.info.reset();const r=p.opaque,i=p.transmissive;if(m.setupLights(),t.isArrayCamera){const n=t.cameras;if(i.length>0)for(let t=0,a=n.length;t<a;t++){Ie(r,i,e,n[t])}W&&ue.render(e);for(let t=0,r=n.length;t<r;t++){const r=n[t];Le(p,e,r,r.viewport)}}else i.length>0&&Ie(r,i,e,t),W&&ue.render(e),Le(p,e,t);null!==S&&(J.updateMultisampleRenderTarget(S),J.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(y,e,t),me.resetDefaultState(),M=-1,w=null,v.pop(),v.length>0?(m=v[v.length-1],!0===z&&le.setGlobalState(y.clippingPlanes,m.state.camera)):m=null,g.pop(),p=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return x},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){Z.get(e.texture).__webglTexture=t,Z.get(e.depthTexture).__webglTexture=n;const r=Z.get(e);r.__hasExternalTextures=!0,r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===$.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){const n=Z.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){S=e,b=t,x=n;let r=!0,i=null,a=!1,o=!1;if(e){const s=Z.get(e);void 0!==s.__useDefaultFramebuffer?(Y.bindFramebuffer(ve.FRAMEBUFFER,null),r=!1):void 0===s.__webglFramebuffer?J.setupRenderTarget(e):s.__hasExternalTextures&&J.rebindTextures(e,Z.get(e.texture).__webglTexture,Z.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=Z.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(c[t])?c[t][n]:c[t],a=!0):i=e.samples>0&&!1===J.useMultisampledRTT(e)?Z.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,E.copy(e.viewport),T.copy(e.scissor),A=e.scissorTest}else E.copy(D).multiplyScalar(I).floor(),T.copy(U).multiplyScalar(I).floor(),A=k;if(Y.bindFramebuffer(ve.FRAMEBUFFER,i)&&r&&Y.drawBuffers(e,i),Y.viewport(E),Y.scissor(T),Y.setScissorTest(A),a){const r=Z.get(e.texture);ve.framebufferTexture2D(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,ve.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(o){const r=Z.get(e.texture),i=t||0;ve.framebufferTextureLayer(ve.FRAMEBUFFER,ve.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}M=-1},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){Y.bindFramebuffer(ve.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!q.textureFormatReadable(s))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!q.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ve.readPixels(t,n,r,i,pe.convert(s),pe.convert(l),a)}finally{const e=null!==S?Z.get(S).__webglFramebuffer:null;Y.bindFramebuffer(ve.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){Y.bindFramebuffer(ve.FRAMEBUFFER,s);try{const o=e.texture,s=o.format,l=o.type;if(!q.textureFormatReadable(s))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!q.textureTypeReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){const e=ve.createBuffer();ve.bindBuffer(ve.PIXEL_PACK_BUFFER,e),ve.bufferData(ve.PIXEL_PACK_BUFFER,a.byteLength,ve.STREAM_READ),ve.readPixels(t,n,r,i,pe.convert(s),pe.convert(l),0),ve.flush();const o=ve.fenceSync(ve.SYNC_GPU_COMMANDS_COMPLETE,0);await function(e,t,n){return new Promise((function(r,i){setTimeout((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()}}),n)}))}(ve,o,4);try{ve.bindBuffer(ve.PIXEL_PACK_BUFFER,e),ve.getBufferSubData(ve.PIXEL_PACK_BUFFER,0,a)}finally{ve.deleteBuffer(e),ve.deleteSync(o)}return a}}finally{const e=null!==S?Z.get(S).__webglFramebuffer:null;Y.bindFramebuffer(ve.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t=null,n=0){!0!==e.isTexture&&(FA("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=null!==t?t.x:0,s=null!==t?t.y:0;J.setTexture2D(e,0),ve.copyTexSubImage2D(ve.TEXTURE_2D,n,0,0,o,s,i,a),Y.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,r=null,i=0){let a,o,s,l,c,u;!0!==e.isTexture&&(FA("WebGLRenderer: copyTextureToTexture function signature has changed."),r=arguments[0]||null,e=arguments[1],t=arguments[2],i=arguments[3]||0,n=null),null!==n?(a=n.max.x-n.min.x,o=n.max.y-n.min.y,s=n.min.x,l=n.min.y):(a=e.image.width,o=e.image.height,s=0,l=0),null!==r?(c=r.x,u=r.y):(c=0,u=0);const h=pe.convert(t.format),d=pe.convert(t.type);J.setTexture2D(t,0),ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,t.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,t.unpackAlignment);const f=ve.getParameter(ve.UNPACK_ROW_LENGTH),p=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),m=ve.getParameter(ve.UNPACK_SKIP_PIXELS),g=ve.getParameter(ve.UNPACK_SKIP_ROWS),v=ve.getParameter(ve.UNPACK_SKIP_IMAGES),y=e.isCompressedTexture?e.mipmaps[i]:e.image;ve.pixelStorei(ve.UNPACK_ROW_LENGTH,y.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,y.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,s),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,l),e.isDataTexture?ve.texSubImage2D(ve.TEXTURE_2D,i,c,u,a,o,h,d,y.data):e.isCompressedTexture?ve.compressedTexSubImage2D(ve.TEXTURE_2D,i,c,u,y.width,y.height,h,y.data):ve.texSubImage2D(ve.TEXTURE_2D,i,c,u,a,o,h,d,y),ve.pixelStorei(ve.UNPACK_ROW_LENGTH,f),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,p),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,m),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,g),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,v),0===i&&t.generateMipmaps&&ve.generateMipmap(ve.TEXTURE_2D),Y.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n=null,r=null,i=0){let a,o,s,l,c,u,h,d,f;!0!==e.isTexture&&(FA("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,r=arguments[1]||null,e=arguments[2],t=arguments[3],i=arguments[4]||0);const p=e.isCompressedTexture?e.mipmaps[i]:e.image;null!==n?(a=n.max.x-n.min.x,o=n.max.y-n.min.y,s=n.max.z-n.min.z,l=n.min.x,c=n.min.y,u=n.min.z):(a=p.width,o=p.height,s=p.depth,l=0,c=0,u=0),null!==r?(h=r.x,d=r.y,f=r.z):(h=0,d=0,f=0);const m=pe.convert(t.format),g=pe.convert(t.type);let v;if(t.isData3DTexture)J.setTexture3D(t,0),v=ve.TEXTURE_3D;else{if(!t.isDataArrayTexture&&!t.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");J.setTexture2DArray(t,0),v=ve.TEXTURE_2D_ARRAY}ve.pixelStorei(ve.UNPACK_FLIP_Y_WEBGL,t.flipY),ve.pixelStorei(ve.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ve.pixelStorei(ve.UNPACK_ALIGNMENT,t.unpackAlignment);const y=ve.getParameter(ve.UNPACK_ROW_LENGTH),_=ve.getParameter(ve.UNPACK_IMAGE_HEIGHT),b=ve.getParameter(ve.UNPACK_SKIP_PIXELS),x=ve.getParameter(ve.UNPACK_SKIP_ROWS),S=ve.getParameter(ve.UNPACK_SKIP_IMAGES);ve.pixelStorei(ve.UNPACK_ROW_LENGTH,p.width),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,p.height),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,l),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,c),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,u),e.isDataTexture||e.isData3DTexture?ve.texSubImage3D(v,i,h,d,f,a,o,s,m,g,p.data):t.isCompressedArrayTexture?ve.compressedTexSubImage3D(v,i,h,d,f,a,o,s,m,p.data):ve.texSubImage3D(v,i,h,d,f,a,o,s,m,g,p),ve.pixelStorei(ve.UNPACK_ROW_LENGTH,y),ve.pixelStorei(ve.UNPACK_IMAGE_HEIGHT,_),ve.pixelStorei(ve.UNPACK_SKIP_PIXELS,b),ve.pixelStorei(ve.UNPACK_SKIP_ROWS,x),ve.pixelStorei(ve.UNPACK_SKIP_IMAGES,S),0===i&&t.generateMipmaps&&ve.generateMipmap(v),Y.unbindTexture()},this.initRenderTarget=function(e){void 0===Z.get(e).__webglFramebuffer&&J.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?J.setTextureCube(e,0):e.isData3DTexture?J.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?J.setTexture2DArray(e,0):J.setTexture2D(e,0),Y.unbindTexture()},this.resetState=function(){b=0,x=0,S=null,Y.reset(),me.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return vA}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===eA?"display-p3":"srgb",t.unpackColorSpace=jA.workingColorSpace===tA?"display-p3":"srgb"}}class bN extends lR{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 WC,this.environmentIntensity=1,this.environmentRotation=new WC,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(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),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class xN{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=mA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=wA()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return FA("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=wA()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=wA()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const SN=new aC;class MN{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++)SN.fromBufferAttribute(this,t),SN.applyMatrix4(e),this.setXYZ(t,SN.x,SN.y,SN.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)SN.fromBufferAttribute(this,t),SN.applyNormalMatrix(e),this.setXYZ(t,SN.x,SN.y,SN.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)SN.fromBufferAttribute(this,t),SN.transformDirection(e),this.setXYZ(t,SN.x,SN.y,SN.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=CA(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=RA(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=RA(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=RA(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=RA(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=RA(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=CA(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=CA(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=CA(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=CA(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=RA(t,this.array),n=RA(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=RA(t,this.array),n=RA(n,this.array),r=RA(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=RA(t,this.array),n=RA(n,this.array),r=RA(r,this.array),i=RA(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(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new LR(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new MN(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const 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}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class wN extends AR{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new wR(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let EN;const TN=new aC,AN=new aC,CN=new aC,RN=new LA,PN=new LA,LN=new DC,IN=new aC,NN=new aC,ON=new aC,DN=new LA,UN=new LA,kN=new LA;class FN extends lR{constructor(e=new wN){if(super(),this.isSprite=!0,this.type="Sprite",void 0===EN){EN=new VR;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new xN(e,5);EN.setIndex([0,1,2,0,2,3]),EN.setAttribute("position",new MN(t,3,0,!1)),EN.setAttribute("uv",new MN(t,2,3,!1))}this.geometry=EN,this.material=e,this.center=new LA(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),AN.setFromMatrixScale(this.matrixWorld),LN.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),CN.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&AN.multiplyScalar(-CN.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const a=this.center;zN(IN.set(-.5,-.5,0),CN,a,AN,r,i),zN(NN.set(.5,-.5,0),CN,a,AN,r,i),zN(ON.set(.5,.5,0),CN,a,AN,r,i),DN.set(0,0),UN.set(1,0),kN.set(1,1);let o=e.ray.intersectTriangle(IN,NN,ON,!1,TN);if(null===o&&(zN(NN.set(-.5,.5,0),CN,a,AN,r,i),UN.set(0,1),o=e.ray.intersectTriangle(IN,ON,NN,!1,TN),null===o))return;const s=e.ray.origin.distanceTo(TN);s<e.near||s>e.far||t.push({distance:s,point:TN.clone(),uv:_R.getInterpolation(TN,IN,NN,ON,DN,UN,kN,new LA),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function zN(e,t,n,r,i,a){RN.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(PN.x=a*RN.x-i*RN.y,PN.y=i*RN.x+a*RN.y):PN.copy(RN),e.copy(t),e.x+=PN.x,e.y+=PN.y,e.applyMatrix4(LN)}const BN=new aC,HN=new QA,VN=new QA,jN=new aC,GN=new DC,WN=new aC,XN=new TC,$N=new DC,qN=new OC;class YN extends oP{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=LE,this.bindMatrix=new DC,this.bindMatrixInverse=new DC,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;null===this.boundingBox&&(this.boundingBox=new lC),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,WN),this.boundingBox.expandByPoint(WN)}computeBoundingSphere(){const e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new TC),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,WN),this.boundingSphere.expandByPoint(WN)}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,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,r=this.matrixWorld;void 0!==n&&(null===this.boundingSphere&&this.computeBoundingSphere(),XN.copy(this.boundingSphere),XN.applyMatrix4(r),!1!==e.ray.intersectsSphere(XN)&&($N.copy(r).invert(),qN.copy(e.ray).applyMatrix4($N),null!==this.boundingBox&&!1===qN.intersectsBox(this.boundingBox)||this._computeIntersections(e,t,qN)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new QA,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===LE?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;HN.fromBufferAttribute(r.attributes.skinIndex,e),VN.fromBufferAttribute(r.attributes.skinWeight,e),BN.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let i=0;i<4;i++){const e=VN.getComponent(i);if(0!==e){const r=HN.getComponent(i);GN.multiplyMatrices(n.bones[r].matrixWorld,n.boneInverses[r]),t.addScaledVector(jN.copy(BN).applyMatrix4(GN),e)}}return t.applyMatrix4(this.bindMatrixInverse)}}class KN extends lR{constructor(){super(),this.isBone=!0,this.type="Bone"}}class ZN extends JA{constructor(e=null,t=1,n=1,r,i,a,o,s,l=1003,c=1003,u,h){super(null,a,o,s,l,c,r,i,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const JN=new DC,QN=new DC;class eO{constructor(e=[],t=[]){this.uuid=wA(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new DC)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new DC;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++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const 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(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let i=0,a=e.length;i<a;i++){const r=e[i]?e[i].matrixWorld:QN;JN.multiplyMatrices(r,t[i]),JN.toArray(n,16*i)}null!==r&&(r.needsUpdate=!0)}clone(){return new eO(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=4*Math.ceil(e/4),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ZN(t,e,e,rT,ZE);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new KN),this.bones.push(i),this.boneInverses.push((new DC).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const a=n[r];e.boneInverses.push(a.toArray())}return e}}class tO extends LR{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(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const nO=new DC,rO=new DC,iO=[],aO=new lC,oO=new DC,sO=new oP,lO=new TC;class cO extends oP{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new tO(new Float32Array(16*n),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,oO)}computeBoundingBox(){const e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new lC),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,nO),aO.copy(e.boundingBox).applyMatrix4(nO),this.boundingBox.union(aO)}computeBoundingSphere(){const e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new TC),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,nO),lO.copy(e.boundingSphere).applyMatrix4(nO),this.boundingSphere.union(lO)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}getMorphAt(e,t){const n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1;for(let a=0;a<n.length;a++)n[a]=r[i+a]}raycast(e,t){const n=this.matrixWorld,r=this.count;if(sO.geometry=this.geometry,sO.material=this.material,void 0!==sO.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),lO.copy(this.boundingSphere),lO.applyMatrix4(n),!1!==e.ray.intersectsSphere(lO)))for(let i=0;i<r;i++){this.getMatrixAt(i,nO),rO.multiplyMatrices(n,nO),sO.matrixWorld=rO,sO.raycast(e,iO);for(let e=0,n=iO.length;e<n;e++){const n=iO[e];n.instanceId=i,n.object=this,t.push(n)}iO.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new tO(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}setMorphAt(e,t){const n=t.morphTargetInfluences,r=n.length+1;null===this.morphTexture&&(this.morphTexture=new ZN(new Float32Array(r*this.count),r,this.count,oT,ZE));const i=this.morphTexture.source.data.data;let a=0;for(let l=0;l<n.length;l++)a+=n[l];const o=this.geometry.morphTargetsRelative?1:1-a,s=r*e;i[s]=o,i.set(n,s+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class uO extends AR{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new wR(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const hO=new aC,dO=new aC,fO=new DC,pO=new OC,mO=new TC,gO=new aC,vO=new aC;class yO extends lR{constructor(e=new VR,t=new uO){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)hO.fromBufferAttribute(t,e-1),dO.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=hO.distanceTo(dO);e.setAttribute("lineDistance",new OR(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),mO.copy(n.boundingSphere),mO.applyMatrix4(r),mO.radius+=i,!1===e.ray.intersectsSphere(mO))return;fO.copy(r).invert(),pO.copy(e.ray).applyMatrix4(fO);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=this.isLineSegments?2:1,c=n.index,u=n.attributes.position;if(null!==c){const n=Math.max(0,a.start),r=Math.min(c.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=l){const n=c.getX(i),r=c.getX(i+1),a=_O(this,e,pO,s,n,r);a&&t.push(a)}if(this.isLineLoop){const i=c.getX(r-1),a=c.getX(n),o=_O(this,e,pO,s,i,a);o&&t.push(o)}}else{const 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+=l){const n=_O(this,e,pO,s,i,i+1);n&&t.push(n)}if(this.isLineLoop){const i=_O(this,e,pO,s,r-1,n);i&&t.push(i)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function _O(e,t,n,r,i,a){const o=e.geometry.attributes.position;hO.fromBufferAttribute(o,i),dO.fromBufferAttribute(o,a);if(n.distanceSqToSegment(hO,dO,gO,vO)>r)return;gO.applyMatrix4(e.matrixWorld);const s=t.ray.origin.distanceTo(gO);return s<t.near||s>t.far?void 0:{distance:s,point:vO.clone().applyMatrix4(e.matrixWorld),index:i,face:null,faceIndex:null,object:e}}const bO=new aC,xO=new aC;class SO extends yO{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)bO.fromBufferAttribute(t,e),xO.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+bO.distanceTo(xO);e.setAttribute("lineDistance",new OR(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class MO extends yO{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class wO extends AR{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new wR(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const EO=new DC,TO=new OC,AO=new TC,CO=new aC;class RO extends lR{constructor(e=new VR,t=new wO){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),AO.copy(n.boundingSphere),AO.applyMatrix4(r),AO.radius+=i,!1===e.ray.intersectsSphere(AO))return;EO.copy(r).invert(),TO.copy(e.ray).applyMatrix4(EO);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);n<i;n++){const i=l.getX(n);CO.fromBufferAttribute(c,i),PO(CO,i,s,r,e,t,this)}}else{for(let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);n<i;n++)CO.fromBufferAttribute(c,n),PO(CO,n,s,r,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function PO(e,t,n,r,i,a,o){const s=TO.distanceSqToPoint(e);if(s<n){const n=new aC;TO.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o})}}class LO extends JA{constructor(e,t,n,r,i,a,o,s,l){super(e,t,n,r,i,a,o,s,l),this.isVideoTexture=!0,this.minFilter=void 0!==a?a:VE,this.magFilter=void 0!==i?i:VE,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class IO extends JA{constructor(e,t,n,r,i,a,o,s,l,c,u,h){super(null,a,o,s,l,c,r,i,u,h),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class NO extends JA{constructor(e,t,n,r,i,a,o,s,l){super(e,t,n,r,i,a,o,s,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class OO{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,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){const n=this.getLengths();let r=0;const i=n.length;let a;a=t||e*n[i-1];let o,s=0,l=i-1;for(;s<=l;)if(r=Math.floor(s+(l-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(r=l,n[r]===a)return r/(i-1);const c=n[r];return(r+(a-c)/(n[r+1]-c))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new LA:new aC);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new aC,r=[],i=[],a=[],o=new aC,s=new DC;for(let d=0;d<=e;d++){const t=d/e;r[d]=this.getTangentAt(t,new aC)}i[0]=new aC,a[0]=new aC;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),h=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&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 d=1;d<=e;d++){if(i[d]=i[d-1].clone(),a[d]=a[d-1].clone(),o.crossVectors(r[d-1],r[d]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(EA(r[d-1].dot(r[d]),-1,1));i[d].applyMatrix4(s.makeRotationAxis(o,e))}a[d].crossVectors(r[d],i[d])}if(!0===t){let t=Math.acos(EA(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(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class DO extends VR{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],u=[],h=[],d=[];let f=0;const p=[],m=n/2;let g=0;function v(n){const i=f,a=new LA,p=new aC;let v=0;const y=!0===n?e:t,_=!0===n?1:-1;for(let e=1;e<=r;e++)u.push(0,m*_,0),h.push(0,_,0),d.push(.5,.5),f++;const b=f;for(let e=0;e<=r;e++){const t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);p.x=y*i,p.y=m*_,p.z=y*n,u.push(p.x,p.y,p.z),h.push(0,_,0),a.x=.5*n+.5,a.y=.5*i*_+.5,d.push(a.x,a.y),f++}for(let e=0;e<r;e++){const t=i+e,r=b+e;!0===n?c.push(r,r+1,t):c.push(r+1,r,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}!function(){const a=new aC,v=new aC;let y=0;const _=(t-e)/n;for(let l=0;l<=i;l++){const c=[],g=l/i,y=g*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*s+o,l=Math.sin(i),p=Math.cos(i);v.x=y*l,v.y=-g*n+m,v.z=y*p,u.push(v.x,v.y,v.z),a.set(l,_,p).normalize(),h.push(a.x,a.y,a.z),d.push(t,1-g),c.push(f++)}p.push(c)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=p[t][e],r=p[t+1][e],i=p[t+1][e+1],a=p[t][e+1];c.push(n,r,a),c.push(r,i,a),y+=6}l.addGroup(g,y,0),g+=y}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new OR(u,3)),this.setAttribute("normal",new OR(h,3)),this.setAttribute("uv",new OR(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new DO(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class UO extends VR{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],a=[];function o(e,t,n,r){const i=r+1,a=[];for(let o=0;o<=i;o++){a[o]=[];const r=e.clone().lerp(n,o/i),s=t.clone().lerp(n,o/i),l=i-o;for(let e=0;e<=l;e++)a[o][e]=0===e&&o===i?r:r.clone().lerp(s,e/l)}for(let o=0;o<i;o++)for(let e=0;e<2*(i-o)-1;e++){const t=Math.floor(e/2);e%2==0?(s(a[o][t+1]),s(a[o+1][t]),s(a[o][t])):(s(a[o][t+1]),s(a[o+1][t+1]),s(a[o+1][t]))}}function s(e){i.push(e.x,e.y,e.z)}function l(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}!function(e){const n=new aC,r=new aC,i=new aC;for(let a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],r),l(t[a+2],i),o(n,r,i,e)}(r),function(e){const t=new aC;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}(n),function(){const e=new aC;for(let n=0;n<i.length;n+=3){e.x=i[n+0],e.y=i[n+1],e.z=i[n+2];const r=u(e)/2/Math.PI+.5,o=(t=e,Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5);a.push(r,1-o)}var t;(function(){const e=new aC,t=new aC,n=new aC,r=new aC,o=new LA,s=new LA,l=new LA;for(let h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),l.set(a[d+4],a[d+5]),r.copy(e).add(t).add(n).divideScalar(3);const f=u(r);c(o,d+0,e,f),c(s,d+2,t,f),c(l,d+4,n,f)}})(),function(){for(let e=0;e<a.length;e+=6){const t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new OR(i,3)),this.setAttribute("normal",new OR(i.slice(),3)),this.setAttribute("uv",new OR(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new UO(e.vertices,e.indices,e.radius,e.details)}}const kO=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let a=FO(e,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c,u,h,d,f;if(r&&(a=function(e,t,n,r){const i=[];let a,o,s,l,c;for(a=0,o=t.length;a<o;a++)s=t[a]*r,l=a<o-1?t[a+1]*r:e.length,c=FO(e,s,l,r,!1),c===c.next&&(c.steiner=!0),i.push(YO(c));for(i.sort(WO),a=0;a<i.length;a++)n=XO(i[a],n);return n}(e,t,a,n)),e.length>80*n){s=c=e[0],l=u=e[1];for(let t=n;t<i;t+=n)h=e[t],d=e[t+1],h<s&&(s=h),d<l&&(l=d),h>c&&(c=h),d>u&&(u=d);f=Math.max(c-s,u-l),f=0!==f?32767/f:0}return BO(a,o,n,s,l,f,0),o};function FO(e,t,n,r,i){let a,o;if(i===function(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}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=aD(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=aD(a,e[a],e[a+1],o);return o&&QO(o,o.next)&&(oD(o),o=o.next),o}function zO(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!QO(r,r.next)&&0!==JO(r.prev,r,r.next))r=r.next;else{if(oD(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function BO(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=qO(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,function(e){let t,n,r,i,a,o,s,l,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ,r);t++);for(l=c;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1)}(i)}(e,r,i,a);let s,l,c=e;for(;e.prev!==e.next;)if(s=e.prev,l=e.next,a?VO(e,r,i,a):HO(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),oD(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?BO(e=jO(zO(e),t,n),t,n,r,i,a,2):2===o&&GO(e,t,n,r,i,a):BO(zO(e),t,n,r,i,a,1);break}}function HO(e){const t=e.prev,n=e,r=e.next;if(JO(t,n,r)>=0)return!1;const i=t.x,a=n.x,o=r.x,s=t.y,l=n.y,c=r.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,d=i>a?i>o?i:o:a>o?a:o,f=s>l?s>c?s:c:l>c?l:c;let p=r.next;for(;p!==t;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&KO(i,s,a,l,o,c,p.x,p.y)&&JO(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function VO(e,t,n,r){const i=e.prev,a=e,o=e.next;if(JO(i,a,o)>=0)return!1;const s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,d=o.y,f=s<l?s<c?s:c:l<c?l:c,p=u<h?u<d?u:d:h<d?h:d,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,v=qO(f,p,t,n,r),y=qO(m,g,t,n,r);let _=e.prevZ,b=e.nextZ;for(;_&&_.z>=v&&b&&b.z<=y;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==i&&_!==o&&KO(s,u,l,h,c,d,_.x,_.y)&&JO(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,b.x>=f&&b.x<=m&&b.y>=p&&b.y<=g&&b!==i&&b!==o&&KO(s,u,l,h,c,d,b.x,b.y)&&JO(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;_&&_.z>=v;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==i&&_!==o&&KO(s,u,l,h,c,d,_.x,_.y)&&JO(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;b&&b.z<=y;){if(b.x>=f&&b.x<=m&&b.y>=p&&b.y<=g&&b!==i&&b!==o&&KO(s,u,l,h,c,d,b.x,b.y)&&JO(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function jO(e,t,n){let r=e;do{const i=r.prev,a=r.next.next;!QO(i,a)&&eD(i,r,r.next,a)&&rD(i,a)&&rD(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),oD(r),oD(r.next),r=e=a),r=r.next}while(r!==e);return zO(r)}function GO(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&ZO(o,e)){let s=iD(o,e);return o=zO(o,o.next),s=zO(s,s.next),BO(o,t,n,r,i,a,0),void BO(s,t,n,r,i,a,0)}e=e.next}o=o.next}while(o!==e)}function WO(e,t){return e.x-t.x}function XO(e,t){const n=function(e,t){let n,r=t,i=-1/0;const a=e.x,o=e.y;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const e=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=a&&e>i&&(i=e,n=r.x<r.next.x?r:r.next,e===a))return n}r=r.next}while(r!==t);if(!n)return null;const s=n,l=n.x,c=n.y;let u,h=1/0;r=n;do{a>=r.x&&r.x>=l&&a!==r.x&&KO(o<c?a:i,o,l,c,o<c?i:a,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(a-r.x),rD(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&$O(n,r)))&&(n=r,h=u)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;const r=iD(n,e);return zO(r,r.next),zO(n,n.next)}function $O(e,t){return JO(e.prev,e,t.prev)<0&&JO(t.next,e,e.next)<0}function qO(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function YO(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 KO(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 ZO(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(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&&eD(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(rD(e,t)&&rD(t,e)&&function(e,t){let n=e,r=!1;const 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}(e,t)&&(JO(e.prev,e,t.prev)||JO(e,t.prev,t))||QO(e,t)&&JO(e.prev,e,e.next)>0&&JO(t.prev,t,t.next)>0)}function JO(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function QO(e,t){return e.x===t.x&&e.y===t.y}function eD(e,t,n,r){const i=nD(JO(e,t,n)),a=nD(JO(e,t,r)),o=nD(JO(n,r,e)),s=nD(JO(n,r,t));return i!==a&&o!==s||(!(0!==i||!tD(e,n,t))||(!(0!==a||!tD(e,r,t))||(!(0!==o||!tD(n,e,r))||!(0!==s||!tD(n,t,r)))))}function tD(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 nD(e){return e>0?1:e<0?-1:0}function rD(e,t){return JO(e.prev,e,e.next)<0?JO(e,t,e.next)>=0&&JO(e,e.prev,t)>=0:JO(e,t,e.prev)<0||JO(e,e.next,t)<0}function iD(e,t){const n=new sD(e.i,e.x,e.y),r=new sD(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 aD(e,t,n,r){const i=new sD(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 oD(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 sD(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class lD{static area(e){const t=e.length;let 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.5*n}static isClockWise(e){return lD.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];cD(e),uD(n,e);let a=e.length;t.forEach(cD);for(let s=0;s<t.length;s++)r.push(a),a+=t[s].length,uD(n,t[s]);const o=kO(n,r);for(let s=0;s<o.length;s+=3)i.push(o.slice(s,s+3));return i}}function cD(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function uD(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class hD extends UO{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(e){return new hD(e.radius,e.detail)}}class dD extends VR{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,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));const s=Math.min(a+o,Math.PI);let l=0;const c=[],u=new aC,h=new aC,d=[],f=[],p=[],m=[];for(let g=0;g<=n;g++){const d=[],v=g/n;let y=0;0===g&&0===a?y=.5/t:g===n&&s===Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const s=n/t;u.x=-e*Math.cos(r+s*i)*Math.sin(a+v*o),u.y=e*Math.cos(a+v*o),u.z=e*Math.sin(r+s*i)*Math.sin(a+v*o),f.push(u.x,u.y,u.z),h.copy(u).normalize(),p.push(h.x,h.y,h.z),m.push(s+y,1-v),d.push(l++)}c.push(d)}for(let g=0;g<n;g++)for(let e=0;e<t;e++){const t=c[g][e+1],r=c[g][e],i=c[g+1][e],o=c[g+1][e+1];(0!==g||a>0)&&d.push(t,r,o),(g!==n-1||s<Math.PI)&&d.push(r,i,o)}this.setIndex(d),this.setAttribute("position",new OR(f,3)),this.setAttribute("normal",new OR(p,3)),this.setAttribute("uv",new OR(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new dD(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class fD extends VR{constructor(e=1,t=.4,n=12,r=48,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const a=[],o=[],s=[],l=[],c=new aC,u=new aC,h=new aC;for(let d=0;d<=n;d++)for(let a=0;a<=r;a++){const f=a/r*i,p=d/n*Math.PI*2;u.x=(e+t*Math.cos(p))*Math.cos(f),u.y=(e+t*Math.cos(p))*Math.sin(f),u.z=t*Math.sin(p),o.push(u.x,u.y,u.z),c.x=e*Math.cos(f),c.y=e*Math.sin(f),h.subVectors(u,c).normalize(),s.push(h.x,h.y,h.z),l.push(a/r),l.push(d/n)}for(let d=1;d<=n;d++)for(let e=1;e<=r;e++){const t=(r+1)*d+e-1,n=(r+1)*(d-1)+e-1,i=(r+1)*(d-1)+e,o=(r+1)*d+e;a.push(t,n,o),a.push(n,i,o)}this.setIndex(a),this.setAttribute("position",new OR(o,3)),this.setAttribute("normal",new OR(s,3)),this.setAttribute("uv",new OR(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fD(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class pD extends fP{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class mD extends AR{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new wR(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 wR(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new LA(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 WC,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class gD extends mD{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 LA(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return EA(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 wR(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 wR(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new wR(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class vD extends AR{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new wR(16777215),this.specular=new wR(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new wR(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new LA(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new WC,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}}class yD extends AR{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new wR(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new wR(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new LA(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new WC,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}}function _D(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)}function bD(e){const t=e.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n}function xD(e,t,n){const r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){const r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function SD(e,t,n,r){let i=1,a=e[0];for(;void 0!==a&&void 0===a[r];)a=e[i++];if(void 0===a)return;let o=a[r];if(void 0!==o)if(Array.isArray(o))do{o=a[r],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[r],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{o=a[r],void 0!==o&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}class MD{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let a;n:{r:if(!(e<r)){for(let a=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,r=t[++n],e<r)break t}a=t.length;break n}if(e>=i)break e;{const o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,i=t[--n-1],e>=i)break t}a=n,n=0}}for(;n<a;){const r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)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){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let a=0;a!==r;++a)t[a]=n[i+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class wD extends MD{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:GT,endingEnd:GT}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case WT:i=e,o=2*t-n;break;case XT:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case WT:a=e,s=2*n-t;break;case XT:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*c,this._offsetNext=a*c}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-t)/(r-t),p=f*f,m=p*f,g=-h*m+2*h*p-h*f,v=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,y=(-1-d)*m+(1.5+d)*p+.5*f,_=d*m-d*p;for(let b=0;b!==o;++b)i[b]=g*a[c+b]+v*a[l+b]+y*a[s+b]+_*a[u+b];return i}}class ED extends MD{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=(n-t)/(r-t),u=1-c;for(let h=0;h!==o;++h)i[h]=a[l+h]*u+a[s+h]*c;return i}}class TD extends MD{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class AD{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=_D(t,this.TimeBufferType),this.values=_D(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:_D(e.times,Array),values:_D(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new TD(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new ED(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new wD(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case HT:t=this.InterpolantFactoryMethodDiscrete;break;case VT:t=this.InterpolantFactoryMethodLinear;break;case jT:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return HT;case this.InterpolantFactoryMethodLinear:return VT;case this.InterpolantFactoryMethodSmooth:return jT}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==i;s++){const t=n[s];if("number"==typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,t),e=!1;break}if(null!==a&&a>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,t,a),e=!1;break}a=t}if(void 0!==r&&(o=r,ArrayBuffer.isView(o)&&!(o instanceof DataView)))for(let s=0,l=r.length;s!==l;++s){const t=r[s];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,t),e=!1;break}}var o;return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===jT,i=e.length-1;let a=1;for(let o=1;o<i;++o){let i=!1;const s=e[o];if(s!==e[o+1]&&(1!==o||s!==e[0]))if(r)i=!0;else{const e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){const 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];const 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.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}AD.prototype.TimeBufferType=Float32Array,AD.prototype.ValueBufferType=Float32Array,AD.prototype.DefaultInterpolation=VT;class CD extends AD{constructor(e,t,n){super(e,t,n)}}CD.prototype.ValueTypeName="bool",CD.prototype.ValueBufferType=Array,CD.prototype.DefaultInterpolation=HT,CD.prototype.InterpolantFactoryMethodLinear=void 0,CD.prototype.InterpolantFactoryMethodSmooth=void 0;class RD extends AD{}RD.prototype.ValueTypeName="color";class PD extends AD{}PD.prototype.ValueTypeName="number";class LD extends MD{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t);let l=e*o;for(let c=l+o;l!==c;l+=4)iC.slerpFlat(i,0,a,l-o,a,l,s);return i}}class ID extends AD{InterpolantFactoryMethodLinear(e){return new LD(this.times,this.values,this.getValueSize(),e)}}ID.prototype.ValueTypeName="quaternion",ID.prototype.InterpolantFactoryMethodSmooth=void 0;class ND extends AD{constructor(e,t,n){super(e,t,n)}}ND.prototype.ValueTypeName="string",ND.prototype.ValueBufferType=Array,ND.prototype.DefaultInterpolation=HT,ND.prototype.InterpolantFactoryMethodLinear=void 0,ND.prototype.InterpolantFactoryMethodSmooth=void 0;class OD extends AD{}OD.prototype.ValueTypeName="vector";class DD{constructor(e="",t=-1,n=[],r=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=wA(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(UD(n[a]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,a=n.length;i!==a;++i)t.push(AD.toJSON(n[i]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,a=[];for(let o=0;o<i;o++){let e=[],s=[];e.push((o+i-1)%i,o,(o+1)%i),s.push(0,1,0);const l=bD(e);e=xD(e,1,l),s=xD(s,1,l),r||0!==e[0]||(e.push(i),s.push(s[0])),a.push(new PD(".morphTargetInfluences["+t[o].name+"]",e,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let o=0,s=e.length;o<s;o++){const t=e[o],n=t.name.match(i);if(n&&n.length>1){const e=n[1];let i=r[e];i||(r[e]=i=[]),i.push(t)}}const a=[];for(const o in r)a.push(this.CreateFromMorphTargetSequence(o,r[o],t,n));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const a=[],o=[];SD(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode;let s=e.length||-1;const l=e.hierarchy||[];for(let c=0;c<l.length;c++){const e=l[c].keys;if(e&&0!==e.length)if(e[0].morphTargets){const t={};let n;for(n=0;n<e.length;n++)if(e[n].morphTargets)for(let r=0;r<e[n].morphTargets.length;r++)t[e[n].morphTargets[r]]=-1;for(const i in t){const t=[],a=[];for(let r=0;r!==e[n].morphTargets.length;++r){const r=e[n];t.push(r.time),a.push(r.morphTarget===i?1:0)}r.push(new PD(".morphTargetInfluence["+i+"]",t,a))}s=t.length*a}else{const i=".bones["+t[c].name+"]";n(OD,i+".position",e,"pos",r),n(ID,i+".quaternion",e,"rot",r),n(OD,i+".scale",e,"scl",r)}}if(0===r.length)return null;return new this(i,s,r,o)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function UD(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return PD;case"vector":case"vector2":case"vector3":case"vector4":return OD;case"color":return RD;case"quaternion":return ID;case"bool":case"boolean":return CD;case"string":return ND}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];SD(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const kD={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class FD{constructor(e,t,n){const r=this;let i,a=!1,o=0,s=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){s++,!1===a&&void 0!==r.onStart&&r.onStart(e,o,s),a=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,s),o===s&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const zD=new FD;class BD{constructor(e){this.manager=void 0!==e?e:zD,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const 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}}BD.DEFAULT_MATERIAL_NAME="__DEFAULT";const HD={};class VD extends Error{constructor(e,t){super(e),this.response=t}}class jD extends BD{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=kD.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==HD[e])return void HD[e].push({onLoad:t,onProgress:n,onError:r});HD[e]=[],HD[e].push({onLoad:t,onProgress:n,onError:r});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,s=this.responseType;fetch(a).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=HD[e],r=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=i?parseInt(i):0,o=0!==a;let s=0;const l=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}}),(t=>{e.error(t)}))}()}});return new Response(l)}throw new VD(`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(void 0===o)return e.text();{const 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=>{kD.add(e,t);const n=HD[e];delete HD[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=HD[e];if(void 0===n)throw this.manager.itemError(e),t;delete HD[e];for(let e=0,r=n.length;e<r;e++){const 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}}class GD extends BD{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=kD.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;const o=DA("img");function s(){c(),kD.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}class WD extends BD{constructor(e){super(e)}load(e,t,n,r){const i=this,a=new ZN,o=new jD(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(o){if(void 0===r)return void console.error(o);r(o)}void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:kE,a.wrapT=void 0!==n.wrapT?n.wrapT:kE,a.magFilter=void 0!==n.magFilter?n.magFilter:VE,a.minFilter=void 0!==n.minFilter?n.minFilter:VE,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace&&(a.colorSpace=n.colorSpace),void 0!==n.flipY&&(a.flipY=n.flipY),void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=GE),1===n.mipmapCount&&(a.minFilter=VE),void 0!==n.generateMipmaps&&(a.generateMipmaps=n.generateMipmaps),a.needsUpdate=!0,t&&t(a,n)}),n,r),a}}class XD extends BD{constructor(e){super(e)}load(e,t,n,r){const i=new JA,a=new GD(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class $D extends lR{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new wR(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(t.object.target=this.target.uuid),t}}class qD extends $D{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(lR.DEFAULT_UP),this.updateMatrix(),this.groundColor=new wR(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const YD=new DC,KD=new aC,ZD=new aC;class JD{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new LA(512,512),this.map=null,this.mapPass=null,this.matrix=new DC,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new RP,this._frameExtents=new LA(1,1),this._viewportCount=1,this._viewports=[new QA(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;KD.setFromMatrixPosition(e.matrixWorld),t.position.copy(KD),ZD.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(ZD),t.updateMatrixWorld(),YD.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(YD),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(YD)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class QD extends JD{constructor(){super(new yP(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*MA*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,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}}class eU extends $D{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(lR.DEFAULT_UP),this.updateMatrix(),this.target=new lR,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new QD}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const tU=new DC,nU=new aC,rU=new aC;class iU extends JD{constructor(){super(new yP(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new LA(4,2),this._viewportCount=6,this._viewports=[new QA(2,1,1,1),new QA(0,1,1,1),new QA(3,1,1,1),new QA(1,1,1,1),new QA(3,0,1,1),new QA(1,0,1,1)],this._cubeDirections=[new aC(1,0,0),new aC(-1,0,0),new aC(0,0,1),new aC(0,0,-1),new aC(0,1,0),new aC(0,-1,0)],this._cubeUps=[new aC(0,1,0),new aC(0,1,0),new aC(0,1,0),new aC(0,1,0),new aC(0,0,1),new aC(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),nU.setFromMatrixPosition(e.matrixWorld),n.position.copy(nU),rU.copy(n.position),rU.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(rU),n.updateMatrixWorld(),r.makeTranslation(-nU.x,-nU.y,-nU.z),tU.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(tU)}}let aU=class extends $D{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 iU}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}};class oU extends JD{constructor(){super(new WP(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class sU extends $D{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(lR.DEFAULT_UP),this.updateMatrix(),this.target=new lR,this.shadow=new oU}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class lU extends $D{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class cU{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(AB){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class uU extends BD{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,a=kD.get(e);if(void 0!==a)return i.manager.itemStart(e),a.then?void a.then((n=>{t&&t(n),i.manager.itemEnd(e)})).catch((e=>{r&&r(e)})):(setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a);const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader;const 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 kD.add(e,n),t&&t(n),i.manager.itemEnd(e),n})).catch((function(t){r&&r(t),kD.remove(e),i.manager.itemError(e),i.manager.itemEnd(e)}));kD.add(e,s),i.manager.itemStart(e)}}class hU{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=dU(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=dU();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function dU(){return("undefined"==typeof performance?Date:performance).now()}class fU{constructor(e,t,n){let r,i,a;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}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){const n=this.buffer,r=this.valueSize,i=e*r+r;let a=this.cumulativeWeight;if(0===a){for(let e=0;e!==r;++e)n[i+e]=n[e];a=t}else{a+=t;const e=t/a;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const 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){const 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 s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){o.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let a=0;a!==i;++a)e[t+a]=e[n+a]}_slerp(e,t,n,r){iC.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const a=this._workIndex*i;iC.multiplyQuaternionsFlat(e,a,e,t,e,n),iC.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){const a=1-r;for(let o=0;o!==i;++o){const 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){const i=t+a;e[i]=e[i]+e[n+a]*r}}}const pU="\\[\\]\\.:\\/",mU=new RegExp("["+pU+"]","g"),gU="[^"+pU+"]",vU="[^"+pU.replace("\\.","")+"]",yU=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",gU)+/(WCOD+)?/.source.replace("WCOD",vU)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",gU)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",gU)+"$"),_U=["material","materials","bones","map"];class bU{constructor(e,t,n){this.path=t,this.parsedPath=n||bU.parseTrackName(t),this.node=bU.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new bU.Composite(e,t,n):new bU(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(mU,"")}static parseTrackName(e){const t=yU.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==_U.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const 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){const 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){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const 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 e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=bU.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const a=e[r];if(void 0===a){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=i}else void 0!==a.fromArray&&void 0!==a.toArray?(s=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(s=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}bU.Composite=class{constructor(e,t,n){const r=n||bU.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},bU.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},bU.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},bU.prototype.GetterByBindingType=[bU.prototype._getValue_direct,bU.prototype._getValue_array,bU.prototype._getValue_arrayElement,bU.prototype._getValue_toArray],bU.prototype.SetterByBindingTypeAndVersioning=[[bU.prototype._setValue_direct,bU.prototype._setValue_direct_setNeedsUpdate,bU.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[bU.prototype._setValue_array,bU.prototype._setValue_array_setNeedsUpdate,bU.prototype._setValue_array_setMatrixWorldNeedsUpdate],[bU.prototype._setValue_arrayElement,bU.prototype._setValue_arrayElement_setNeedsUpdate,bU.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[bU.prototype._setValue_fromArray,bU.prototype._setValue_fromArray_setNeedsUpdate,bU.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class xU{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,a=i.length,o=new Array(a),s={endingStart:GT,endingEnd:GT};for(let l=0;l!==a;++l){const e=i[l].createInterpolant(null);o[l]=e,e.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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&&0!==this.timeScale&&null===this._startTime&&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}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const 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){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(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)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;r<0||0===n?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);else 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;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const a=2202===n;if(0===e)return-1===i||!a||1&~i?r:t-r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}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(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const 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(1===o){const 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&&!(1&~i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=WT,r.endingEnd=WT):(r.endingStart=e?this.zeroSlopeAtStart?WT:GT:XT,r.endingEnd=t?this.zeroSlopeAtEnd?WT:GT:XT)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}const SU=new Float32Array(1);class MU extends _A{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName;let c=l[s];void 0===c&&(c={},l[s]=c);for(let u=0;u!==i;++u){const e=r[u],i=e.name;let l=c[i];if(void 0!==l)++l.referenceCount,a[u]=l;else{if(l=a[u],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,s,i));continue}const r=t&&t._propertyBindings[u].binding.parsedPath;l=new fU(bU.create(n,i,r),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,s,i),a[u]=l}o[u].resultBuffer=l.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const 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)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(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;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{const t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,s[c]=l,s.pop(),e._byClipCacheIndex=null;delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const e=t[n];0==--e.referenceCount&&this._removeInactiveBinding(e)}}_lendAction(e){const 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){const 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){const r=this._bindingsByRootAndName,i=this._bindings;let a=r[t];void 0===a&&(a={},r[t]=a),a[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]}_lendBinding(e){const 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){const 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(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new ED(new Float32Array(2),new Float32Array(2),1,SU),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const 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){const r=t||this._root,i=r.uuid;let a="string"==typeof e?DD.findByName(r,e):e;const o=null!==a?a.uuid:e,s=this._actionsByClip[o];let l=null;if(void 0===n&&(n=null!==a?a.blendMode:$T),void 0!==s){const e=s.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;l=s.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;const c=new xU(this,a,t,n);return this._bindAction(c,l),this._addInactiveAction(c,o,i),c}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"==typeof e?DD.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let l=0;l!==n;++l){t[l]._update(r,e,i,a)}const o=this._bindings,s=this._nActiveBindings;for(let l=0;l!==s;++l)o[l].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const 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){const t=e.uuid,n=this._actionsByClip;for(const i in n){const e=n[i].actionByRoot[t];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const i in r){const e=r[i];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class wU{constructor(e){this.value=e}clone(){return new wU(void 0===this.value.clone?this.value:this.value.clone())}}const EU=new DC;class TU{constructor(e,t,n=0,r=1/0){this.ray=new OC(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new XC,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return EU.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(EU),this}intersectObject(e,t=!0,n=[]){return CU(e,this,n,t),n.sort(AU),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)CU(e[r],this,n,t);return n.sort(AU),n}}function AU(e,t){return e.distance-t.distance}function CU(e,t,n,r){let i=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,n)&&(i=!1)}if(!0===i&&!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)CU(r[e],t,n,!0)}}class RU{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}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(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),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),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(EA(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class PU extends SO{constructor(e=10,t=10,n=4473924,r=8947848){n=new wR(n),r=new wR(r);const i=t/2,a=e/t,o=e/2,s=[],l=[];for(let u=0,h=0,d=-o;u<=t;u++,d+=a){s.push(-o,0,d,o,0,d),s.push(d,0,-o,d,0,o);const e=u===i?n:r;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}const c=new VR;c.setAttribute("position",new OR(s,3)),c.setAttribute("color",new OR(l,3));super(c,new uO({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class LU extends SO{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new VR;n.setAttribute("position",new OR(t,3)),n.setAttribute("color",new OR([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new uO({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new wR,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()}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:aE}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=aE)
/**
 * lil-gui
 * https://lil-gui.georgealways.com
 * @version 0.17.0
 * @author George Michael Brower
 * @license MIT
 */;class IU{constructor(e,t,n,r,i="div"){this.parent=e,this.object=t,this.property=n,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),IU.nextNameID=IU.nextNameID||0,this.$name.id="lil-gui-name-"+ ++IU.nextNameID,this.$widget=document.createElement(i),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(n)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),void 0!==this._onChange&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),void 0!==this._onFinishChange&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled||(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e)),this}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,void 0!==this._listenCallbackID&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class NU extends IU{constructor(e,t,n){super(e,t,n,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",(()=>{this.setValue(this.$input.checked),this._callOnFinishChange()})),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function OU(e){let t,n;return(t=e.match(/(#|0x)?([a-f0-9]{6})/i))?n=t[2]:(t=e.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?n=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=e.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(n=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),!!n&&"#"+n}const DU={isPrimitive:!0,match:e=>"string"==typeof e,fromHexString:OU,toHexString:OU},UU={isPrimitive:!0,match:e=>"number"==typeof e,fromHexString:e=>parseInt(e.substring(1),16),toHexString:e=>"#"+e.toString(16).padStart(6,0)},kU={isPrimitive:!1,match:Array.isArray,fromHexString(e,t,n=1){const r=UU.fromHexString(e);t[0]=(r>>16&255)/255*n,t[1]=(r>>8&255)/255*n,t[2]=(255&r)/255*n},toHexString:([e,t,n],r=1)=>UU.toHexString(e*(r=255/r)<<16^t*r<<8^n*r)},FU={isPrimitive:!1,match:e=>Object(e)===e,fromHexString(e,t,n=1){const r=UU.fromHexString(e);t.r=(r>>16&255)/255*n,t.g=(r>>8&255)/255*n,t.b=(255&r)/255*n},toHexString:({r:e,g:t,b:n},r=1)=>UU.toHexString(e*(r=255/r)<<16^t*r<<8^n*r)},zU=[DU,UU,kU,FU];class BU extends IU{constructor(e,t,n,r){var i;super(e,t,n,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=(i=this.initialValue,zU.find((e=>e.match(i)))),this._rgbScale=r,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",(()=>{this._setValueFromHexString(this.$input.value)})),this.$input.addEventListener("blur",(()=>{this._callOnFinishChange()})),this.$text.addEventListener("input",(()=>{const e=OU(this.$text.value);e&&this._setValueFromHexString(e)})),this.$text.addEventListener("focus",(()=>{this._textFocused=!0,this.$text.select()})),this.$text.addEventListener("blur",(()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()})),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class HU extends IU{constructor(e,t,n){super(e,t,n,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",(e=>{e.preventDefault(),this.getValue().call(this.object)})),this.$button.addEventListener("touchstart",(()=>{}),{passive:!0}),this.$disable=this.$button}}class VU extends IU{constructor(e,t,n,r,i,a){super(e,t,n,"number"),this._initInput(),this.min(r),this.max(i);const o=void 0!==a;this.step(o?a:this._getImplicitStep(),o),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=100*t+"%"}return this._inputFocused||(this.$input.value=void 0===this._decimals?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input;const e=e=>{const t=parseFloat(this.$input.value);isNaN(t)||(this._snapClampSetValue(t+e),this.$input.value=this.getValue())};let t,n,r,i,a,o=!1;const s=e=>{if(o){const r=e.clientX-t,i=e.clientY-n;Math.abs(i)>5?(e.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(r)>5&&l()}if(!o){const t=e.clientY-r;a-=t*this._step*this._arrowKeyMultiplier(e),i+a>this._max?a=this._max-i:i+a<this._min&&(a=this._min-i),this._snapClampSetValue(i+a)}r=e.clientY},l=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",l)};this.$input.addEventListener("input",(()=>{let e=parseFloat(this.$input.value);isNaN(e)||(this._stepExplicit&&(e=this._snap(e)),this.setValue(this._clamp(e)))})),this.$input.addEventListener("keydown",(t=>{"Enter"===t.code&&this.$input.blur(),"ArrowUp"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t))),"ArrowDown"===t.code&&(t.preventDefault(),e(this._step*this._arrowKeyMultiplier(t)*-1))})),this.$input.addEventListener("wheel",(t=>{this._inputFocused&&(t.preventDefault(),e(this._step*this._normalizeMouseWheel(t)))}),{passive:!1}),this.$input.addEventListener("mousedown",(e=>{t=e.clientX,n=r=e.clientY,o=!0,i=this.getValue(),a=0,window.addEventListener("mousemove",s),window.addEventListener("mouseup",l)})),this.$input.addEventListener("focus",(()=>{this._inputFocused=!0})),this.$input.addEventListener("blur",(()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()}))}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=e=>{const t=this.$slider.getBoundingClientRect();let n=(r=e,i=t.left,a=t.right,o=this._min,(r-i)/(a-i)*(this._max-o)+o);var r,i,a,o;this._snapClampSetValue(n)},t=t=>{e(t.clientX)},n=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};let r,i,a=!1;const o=t=>{t.preventDefault(),this._setDraggingStyle(!0),e(t.touches[0].clientX),a=!1},s=t=>{if(a){const e=t.touches[0].clientX-r,n=t.touches[0].clientY-i;Math.abs(e)>Math.abs(n)?o(t):(window.removeEventListener("touchmove",s),window.removeEventListener("touchend",l))}else t.preventDefault(),e(t.touches[0].clientX)},l=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",s),window.removeEventListener("touchend",l)},c=this._callOnFinishChange.bind(this);let u;this.$slider.addEventListener("mousedown",(r=>{this._setDraggingStyle(!0),e(r.clientX),window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)})),this.$slider.addEventListener("touchstart",(e=>{e.touches.length>1||(this._hasScrollBar?(r=e.touches[0].clientX,i=e.touches[0].clientY,a=!0):o(e),window.addEventListener("touchmove",s,{passive:!1}),window.addEventListener("touchend",l))}),{passive:!1}),this.$slider.addEventListener("wheel",(e=>{if(Math.abs(e.deltaX)<Math.abs(e.deltaY)&&this._hasScrollBar)return;e.preventDefault();const t=this._normalizeMouseWheel(e)*this._step;this._snapClampSetValue(this.getValue()+t),this.$input.value=this.getValue(),clearTimeout(u),u=setTimeout(c,400)}),{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle("lil-gui-"+t,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:n}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,n=-e.wheelDelta/120,n*=this._stepExplicit?1:10),t+-n}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){const t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return void 0!==this._min}get _hasMax(){return void 0!==this._max}}class jU extends IU{constructor(e,t,n,r){super(e,t,n,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(r)?r:Object.values(r),this._names=Array.isArray(r)?r:Object.keys(r),this._names.forEach((e=>{const t=document.createElement("option");t.innerHTML=e,this.$select.appendChild(t)})),this.$select.addEventListener("change",(()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()})),this.$select.addEventListener("focus",(()=>{this.$display.classList.add("focus")})),this.$select.addEventListener("blur",(()=>{this.$display.classList.remove("focus")})),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=-1===t?e:this._names[t],this}}class GU extends IU{constructor(e,t,n){super(e,t,n,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",(()=>{this.setValue(this.$input.value)})),this.$input.addEventListener("keydown",(e=>{"Enter"===e.code&&this.$input.blur()})),this.$input.addEventListener("blur",(()=>{this._callOnFinishChange()})),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}let WU=!1;class XU{constructor({parent:e,autoPlace:t=void 0===e,container:n,width:r,title:i="Controls",injectStyles:a=!0,touchStyles:o=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",(()=>this.openAnimated(this._closed))),this.$title.addEventListener("keydown",(e=>{"Enter"!==e.code&&"Space"!==e.code||(e.preventDefault(),this.$title.click())})),this.$title.addEventListener("touchstart",(()=>{}),{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(i),o&&this.domElement.classList.add("allow-touch-styles"),this.parent)return this.parent.children.push(this),this.parent.folders.push(this),void this.parent.$children.appendChild(this.domElement);this.domElement.classList.add("root"),!WU&&a&&(function(){const e=document.createElement("style");e.innerHTML='.lil-gui{--background-color:#1f1f1f;--text-color:#ebebeb;--title-background-color:#111;--title-text-color:#ebebeb;--widget-color:#424242;--hover-color:#4f4f4f;--focus-color:#595959;--number-color:#2cc9ff;--string-color:#a2db3c;--font-size:11px;--input-font-size:11px;--font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;--font-family-mono:Menlo,Monaco,Consolas,"Droid Sans Mono",monospace;--padding:4px;--spacing:4px;--widget-height:20px;--name-width:45%;--slider-knob-width:2px;--slider-input-width:27%;--color-input-width:27%;--slider-input-min-width:45px;--color-input-min-width:45px;--folder-indent:7px;--widget-padding:0 0 0 3px;--widget-border-radius:2px;--checkbox-size:calc(var(--widget-height)*0.75);--scrollbar-width:5px;background-color:var(--background-color);color:var(--text-color);font-family:var(--font-family);font-size:var(--font-size);font-style:normal;font-weight:400;line-height:1;text-align:left;touch-action:manipulation;user-select:none;-webkit-user-select:none}.lil-gui,.lil-gui *{box-sizing:border-box;margin:0;padding:0}.lil-gui.root{display:flex;flex-direction:column;width:var(--width,245px)}.lil-gui.root>.title{background:var(--title-background-color);color:var(--title-text-color)}.lil-gui.root>.children{overflow-x:hidden;overflow-y:auto}.lil-gui.root>.children::-webkit-scrollbar{background:var(--background-color);height:var(--scrollbar-width);width:var(--scrollbar-width)}.lil-gui.root>.children::-webkit-scrollbar-thumb{background:var(--focus-color);border-radius:var(--scrollbar-width)}.lil-gui.force-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}.lil-gui.autoPlace{max-height:100%;position:fixed;right:15px;top:0;z-index:1001}.lil-gui .controller{align-items:center;display:flex;margin:var(--spacing) 0;padding:0 var(--padding)}.lil-gui .controller.disabled{opacity:.5}.lil-gui .controller.disabled,.lil-gui .controller.disabled *{pointer-events:none!important}.lil-gui .controller>.name{flex-shrink:0;line-height:var(--widget-height);min-width:var(--name-width);padding-right:var(--spacing);white-space:pre}.lil-gui .controller .widget{align-items:center;display:flex;min-height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.string input{color:var(--string-color)}.lil-gui .controller.boolean .widget{cursor:pointer}.lil-gui .controller.color .display{border-radius:var(--widget-border-radius);height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.color input[type=color]{cursor:pointer;height:100%;opacity:0;width:100%}.lil-gui .controller.color input[type=text]{flex-shrink:0;font-family:var(--font-family-mono);margin-left:var(--spacing);min-width:var(--color-input-min-width);width:var(--color-input-width)}.lil-gui .controller.option select{max-width:100%;opacity:0;position:absolute;width:100%}.lil-gui .controller.option .display{background:var(--widget-color);border-radius:var(--widget-border-radius);height:var(--widget-height);line-height:var(--widget-height);max-width:100%;overflow:hidden;padding-left:.55em;padding-right:1.75em;pointer-events:none;position:relative;word-break:break-all}.lil-gui .controller.option .display.active{background:var(--focus-color)}.lil-gui .controller.option .display:after{bottom:0;content:"↕";font-family:lil-gui;padding-right:.375em;position:absolute;right:0;top:0}.lil-gui .controller.option .widget,.lil-gui .controller.option select{cursor:pointer}.lil-gui .controller.number input{color:var(--number-color)}.lil-gui .controller.number.hasSlider input{flex-shrink:0;margin-left:var(--spacing);min-width:var(--slider-input-min-width);width:var(--slider-input-width)}.lil-gui .controller.number .slider{background-color:var(--widget-color);border-radius:var(--widget-border-radius);cursor:ew-resize;height:var(--widget-height);overflow:hidden;padding-right:var(--slider-knob-width);touch-action:pan-y;width:100%}.lil-gui .controller.number .slider.active{background-color:var(--focus-color)}.lil-gui .controller.number .slider.active .fill{opacity:.95}.lil-gui .controller.number .fill{border-right:var(--slider-knob-width) solid var(--number-color);box-sizing:content-box;height:100%}.lil-gui-dragging .lil-gui{--hover-color:var(--widget-color)}.lil-gui-dragging *{cursor:ew-resize!important}.lil-gui-dragging.lil-gui-vertical *{cursor:ns-resize!important}.lil-gui .title{--title-height:calc(var(--widget-height) + var(--spacing)*1.25);-webkit-tap-highlight-color:transparent;text-decoration-skip:objects;cursor:pointer;font-weight:600;height:var(--title-height);line-height:calc(var(--title-height) - 4px);outline:none;padding:0 var(--padding)}.lil-gui .title:before{content:"▾";display:inline-block;font-family:lil-gui;padding-right:2px}.lil-gui .title:active{background:var(--title-background-color);opacity:.75}.lil-gui.root>.title:focus{text-decoration:none!important}.lil-gui.closed>.title:before{content:"▸"}.lil-gui.closed>.children{opacity:0;transform:translateY(-7px)}.lil-gui.closed:not(.transition)>.children{display:none}.lil-gui.transition>.children{overflow:hidden;pointer-events:none;transition-duration:.3s;transition-property:height,opacity,transform;transition-timing-function:cubic-bezier(.2,.6,.35,1)}.lil-gui .children:empty:before{content:"Empty";display:block;font-style:italic;height:var(--widget-height);line-height:var(--widget-height);margin:var(--spacing) 0;opacity:.5;padding:0 var(--padding)}.lil-gui.root>.children>.lil-gui>.title{border-width:0;border-bottom:1px solid var(--widget-color);border-left:0 solid var(--widget-color);border-right:0 solid var(--widget-color);border-top:1px solid var(--widget-color);transition:border-color .3s}.lil-gui.root>.children>.lil-gui.closed>.title{border-bottom-color:transparent}.lil-gui+.controller{border-top:1px solid var(--widget-color);margin-top:0;padding-top:var(--spacing)}.lil-gui .lil-gui .lil-gui>.title{border:none}.lil-gui .lil-gui .lil-gui>.children{border:none;border-left:2px solid var(--widget-color);margin-left:var(--folder-indent)}.lil-gui .lil-gui .controller{border:none}.lil-gui input{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:0;border-radius:var(--widget-border-radius);color:var(--text-color);font-family:var(--font-family);font-size:var(--input-font-size);height:var(--widget-height);outline:none;width:100%}.lil-gui input:disabled{opacity:1}.lil-gui input[type=number],.lil-gui input[type=text]{padding:var(--widget-padding)}.lil-gui input[type=number]:focus,.lil-gui input[type=text]:focus{background:var(--focus-color)}.lil-gui input::-webkit-inner-spin-button,.lil-gui input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.lil-gui input[type=number]{-moz-appearance:textfield}.lil-gui input[type=checkbox]{appearance:none;-webkit-appearance:none;border-radius:var(--widget-border-radius);cursor:pointer;height:var(--checkbox-size);text-align:center;width:var(--checkbox-size)}.lil-gui input[type=checkbox]:checked:before{content:"✓";font-family:lil-gui;font-size:var(--checkbox-size);line-height:var(--checkbox-size)}.lil-gui button{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:1px solid var(--widget-color);border-radius:var(--widget-border-radius);color:var(--text-color);cursor:pointer;font-family:var(--font-family);font-size:var(--font-size);height:var(--widget-height);line-height:calc(var(--widget-height) - 4px);outline:none;text-align:center;text-transform:none;width:100%}.lil-gui button:active{background:var(--focus-color)}@font-face{font-family:lil-gui;src:url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff")}@media (pointer:coarse){.lil-gui.allow-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}}@media (hover:hover){.lil-gui .controller.color .display:hover:before{border:1px solid #fff9;border-radius:var(--widget-border-radius);bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.lil-gui .controller.option .display.focus{background:var(--focus-color)}.lil-gui .controller.option .widget:hover .display{background:var(--hover-color)}.lil-gui .controller.number .slider:hover{background-color:var(--hover-color)}body:not(.lil-gui-dragging) .lil-gui .title:hover{background:var(--title-background-color);opacity:.85}.lil-gui .title:focus{text-decoration:underline var(--focus-color)}.lil-gui input:hover{background:var(--hover-color)}.lil-gui input:active{background:var(--focus-color)}.lil-gui input[type=checkbox]:focus{box-shadow:inset 0 0 0 1px var(--focus-color)}.lil-gui button:hover{background:var(--hover-color);border-color:var(--hover-color)}.lil-gui button:focus{border-color:var(--focus-color)}}';const t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}(),WU=!0),n?n.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),r&&this.domElement.style.setProperty("--width",r+"px"),this.domElement.addEventListener("keydown",(e=>e.stopPropagation())),this.domElement.addEventListener("keyup",(e=>e.stopPropagation()))}add(e,t,n,r,i){if(Object(n)===n)return new jU(this,e,t,n);const a=e[t];switch(typeof a){case"number":return new VU(this,e,t,n,r,i);case"boolean":return new NU(this,e,t);case"string":return new GU(this,e,t);case"function":return new HU(this,e,t)}console.error("gui.add failed\n\tproperty:",t,"\n\tobject:",e,"\n\tvalue:",a)}addColor(e,t,n=1){return new BU(this,e,t,n)}addFolder(e){return new XU({parent:this,title:e})}load(e,t=!0){return e.controllers&&this.controllers.forEach((t=>{t instanceof HU||t._name in e.controllers&&t.load(e.controllers[t._name])})),t&&e.folders&&this.folders.forEach((t=>{t._title in e.folders&&t.load(e.folders[t._title])})),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach((e=>{if(!(e instanceof HU)){if(e._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${e._name}"`);t.controllers[e._name]=e.save()}})),e&&this.folders.forEach((e=>{if(e._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${e._title}"`);t.folders[e._title]=e.save()})),t}open(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame((()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");const n=e=>{e.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",n))};this.$children.addEventListener("transitionend",n);const r=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame((()=>{this.$children.style.height=r+"px"}))})),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach((e=>e.reset())),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),void 0!==this._onChange&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),void 0!==this._onFinishChange&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach((e=>e.destroy()))}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach((t=>{e=e.concat(t.controllersRecursive())})),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach((t=>{e=e.concat(t.foldersRecursive())})),e}}var $U={},qU={},YU={};let KU;Object.defineProperty(YU,"__esModule",{value:!0}),YU.default=function(){if(!KU&&(KU="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!KU))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return KU(ZU)};const ZU=new Uint8Array(16);var JU={},QU={},ek={};Object.defineProperty(ek,"__esModule",{value:!0}),ek.default=void 0;ek.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Object.defineProperty(QU,"__esModule",{value:!0}),QU.default=void 0;var tk,nk=(tk=ek)&&tk.__esModule?tk:{default:tk};var rk=function(e){return"string"==typeof e&&nk.default.test(e)};QU.default=rk,Object.defineProperty(JU,"__esModule",{value:!0}),JU.default=void 0,JU.unsafeStringify=ok;var ik=function(e){return e&&e.__esModule?e:{default:e}}(QU);const ak=[];for(let CB=0;CB<256;++CB)ak.push((CB+256).toString(16).slice(1));function ok(e,t=0){return ak[e[t+0]]+ak[e[t+1]]+ak[e[t+2]]+ak[e[t+3]]+"-"+ak[e[t+4]]+ak[e[t+5]]+"-"+ak[e[t+6]]+ak[e[t+7]]+"-"+ak[e[t+8]]+ak[e[t+9]]+"-"+ak[e[t+10]]+ak[e[t+11]]+ak[e[t+12]]+ak[e[t+13]]+ak[e[t+14]]+ak[e[t+15]]}var sk=function(e,t=0){const n=ok(e,t);if(!(0,ik.default)(n))throw TypeError("Stringified UUID is invalid");return n};JU.default=sk,Object.defineProperty(qU,"__esModule",{value:!0}),qU.default=void 0;var lk=function(e){return e&&e.__esModule?e:{default:e}}(YU),ck=JU;let uk,hk,dk=0,fk=0;var pk=function(e,t,n){let r=t&&n||0;const i=t||new Array(16);let a=(e=e||{}).node||uk,o=void 0!==e.clockseq?e.clockseq:hk;if(null==a||null==o){const t=e.random||(e.rng||lk.default)();null==a&&(a=uk=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==o&&(o=hk=16383&(t[6]<<8|t[7]))}let s=void 0!==e.msecs?e.msecs:Date.now(),l=void 0!==e.nsecs?e.nsecs:fk+1;const c=s-dk+(l-fk)/1e4;if(c<0&&void 0===e.clockseq&&(o=o+1&16383),(c<0||s>dk)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");dk=s,fk=l,hk=o,s+=122192928e5;const u=(1e4*(268435455&s)+l)%4294967296;i[r++]=u>>>24&255,i[r++]=u>>>16&255,i[r++]=u>>>8&255,i[r++]=255&u;const h=s/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=o>>>8|128,i[r++]=255&o;for(let d=0;d<6;++d)i[r+d]=a[d];return t||(0,ck.unsafeStringify)(i)};qU.default=pk;var mk={},gk={},vk={};Object.defineProperty(vk,"__esModule",{value:!0}),vk.default=void 0;var yk=function(e){return e&&e.__esModule?e:{default:e}}(QU);var _k=function(e){if(!(0,yk.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};vk.default=_k,Object.defineProperty(gk,"__esModule",{value:!0}),gk.URL=gk.DNS=void 0,gk.default=function(e,t,n){function r(e,r,i,a){var o;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,xk.default)(r)),16!==(null===(o=r)||void 0===o?void 0:o.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+e.length);if(s.set(r),s.set(e,r.length),s=n(s),s[6]=15&s[6]|t,s[8]=63&s[8]|128,i){a=a||0;for(let e=0;e<16;++e)i[a+e]=s[e];return i}return(0,bk.unsafeStringify)(s)}try{r.name=e}catch(i){}return r.DNS=Sk,r.URL=Mk,r};var bk=JU,xk=function(e){return e&&e.__esModule?e:{default:e}}(vk);const Sk="6ba7b810-9dad-11d1-80b4-00c04fd430c8";gk.DNS=Sk;const Mk="6ba7b811-9dad-11d1-80b4-00c04fd430c8";gk.URL=Mk;var wk={};function Ek(e){return 14+(e+64>>>9<<4)+1}function Tk(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function Ak(e,t,n,r,i,a){return Tk((o=Tk(Tk(t,e),Tk(r,a)))<<(s=i)|o>>>32-s,n);var o,s}function Ck(e,t,n,r,i,a,o){return Ak(t&n|~t&r,e,t,i,a,o)}function Rk(e,t,n,r,i,a,o){return Ak(t&r|n&~r,e,t,i,a,o)}function Pk(e,t,n,r,i,a,o){return Ak(t^n^r,e,t,i,a,o)}function Lk(e,t,n,r,i,a,o){return Ak(n^(t|~r),e,t,i,a,o)}Object.defineProperty(wk,"__esModule",{value:!0}),wk.default=void 0;var Ik=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,a=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[Ek(t)-1]=t;let n=1732584193,r=-271733879,i=-1732584194,a=271733878;for(let o=0;o<e.length;o+=16){const t=n,s=r,l=i,c=a;n=Ck(n,r,i,a,e[o],7,-680876936),a=Ck(a,n,r,i,e[o+1],12,-389564586),i=Ck(i,a,n,r,e[o+2],17,606105819),r=Ck(r,i,a,n,e[o+3],22,-1044525330),n=Ck(n,r,i,a,e[o+4],7,-176418897),a=Ck(a,n,r,i,e[o+5],12,1200080426),i=Ck(i,a,n,r,e[o+6],17,-1473231341),r=Ck(r,i,a,n,e[o+7],22,-45705983),n=Ck(n,r,i,a,e[o+8],7,1770035416),a=Ck(a,n,r,i,e[o+9],12,-1958414417),i=Ck(i,a,n,r,e[o+10],17,-42063),r=Ck(r,i,a,n,e[o+11],22,-1990404162),n=Ck(n,r,i,a,e[o+12],7,1804603682),a=Ck(a,n,r,i,e[o+13],12,-40341101),i=Ck(i,a,n,r,e[o+14],17,-1502002290),r=Ck(r,i,a,n,e[o+15],22,1236535329),n=Rk(n,r,i,a,e[o+1],5,-165796510),a=Rk(a,n,r,i,e[o+6],9,-1069501632),i=Rk(i,a,n,r,e[o+11],14,643717713),r=Rk(r,i,a,n,e[o],20,-373897302),n=Rk(n,r,i,a,e[o+5],5,-701558691),a=Rk(a,n,r,i,e[o+10],9,38016083),i=Rk(i,a,n,r,e[o+15],14,-660478335),r=Rk(r,i,a,n,e[o+4],20,-405537848),n=Rk(n,r,i,a,e[o+9],5,568446438),a=Rk(a,n,r,i,e[o+14],9,-1019803690),i=Rk(i,a,n,r,e[o+3],14,-187363961),r=Rk(r,i,a,n,e[o+8],20,1163531501),n=Rk(n,r,i,a,e[o+13],5,-1444681467),a=Rk(a,n,r,i,e[o+2],9,-51403784),i=Rk(i,a,n,r,e[o+7],14,1735328473),r=Rk(r,i,a,n,e[o+12],20,-1926607734),n=Pk(n,r,i,a,e[o+5],4,-378558),a=Pk(a,n,r,i,e[o+8],11,-2022574463),i=Pk(i,a,n,r,e[o+11],16,1839030562),r=Pk(r,i,a,n,e[o+14],23,-35309556),n=Pk(n,r,i,a,e[o+1],4,-1530992060),a=Pk(a,n,r,i,e[o+4],11,1272893353),i=Pk(i,a,n,r,e[o+7],16,-155497632),r=Pk(r,i,a,n,e[o+10],23,-1094730640),n=Pk(n,r,i,a,e[o+13],4,681279174),a=Pk(a,n,r,i,e[o],11,-358537222),i=Pk(i,a,n,r,e[o+3],16,-722521979),r=Pk(r,i,a,n,e[o+6],23,76029189),n=Pk(n,r,i,a,e[o+9],4,-640364487),a=Pk(a,n,r,i,e[o+12],11,-421815835),i=Pk(i,a,n,r,e[o+15],16,530742520),r=Pk(r,i,a,n,e[o+2],23,-995338651),n=Lk(n,r,i,a,e[o],6,-198630844),a=Lk(a,n,r,i,e[o+7],10,1126891415),i=Lk(i,a,n,r,e[o+14],15,-1416354905),r=Lk(r,i,a,n,e[o+5],21,-57434055),n=Lk(n,r,i,a,e[o+12],6,1700485571),a=Lk(a,n,r,i,e[o+3],10,-1894986606),i=Lk(i,a,n,r,e[o+10],15,-1051523),r=Lk(r,i,a,n,e[o+1],21,-2054922799),n=Lk(n,r,i,a,e[o+8],6,1873313359),a=Lk(a,n,r,i,e[o+15],10,-30611744),i=Lk(i,a,n,r,e[o+6],15,-1560198380),r=Lk(r,i,a,n,e[o+13],21,1309151649),n=Lk(n,r,i,a,e[o+4],6,-145523070),a=Lk(a,n,r,i,e[o+11],10,-1120210379),i=Lk(i,a,n,r,e[o+2],15,718787259),r=Lk(r,i,a,n,e[o+9],21,-343485551),n=Tk(n,t),r=Tk(r,s),i=Tk(i,l),a=Tk(a,c)}return[n,r,i,a]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(Ek(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))};wk.default=Ik,Object.defineProperty(mk,"__esModule",{value:!0}),mk.default=void 0;var Nk=Dk(gk),Ok=Dk(wk);function Dk(e){return e&&e.__esModule?e:{default:e}}var Uk=(0,Nk.default)("v3",48,Ok.default);mk.default=Uk;var kk={},Fk={};Object.defineProperty(Fk,"__esModule",{value:!0}),Fk.default=void 0;var zk={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};Fk.default=zk,Object.defineProperty(kk,"__esModule",{value:!0}),kk.default=void 0;var Bk=jk(Fk),Hk=jk(YU),Vk=JU;function jk(e){return e&&e.__esModule?e:{default:e}}var Gk=function(e,t,n){if(Bk.default.randomUUID&&!t&&!e)return Bk.default.randomUUID();const r=(e=e||{}).random||(e.rng||Hk.default)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return(0,Vk.unsafeStringify)(r)};kk.default=Gk;var Wk={},Xk={};function $k(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function qk(e,t){return e<<t|e>>>32-t}Object.defineProperty(Xk,"__esModule",{value:!0}),Xk.default=void 0;var Yk=function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const r=e.length/4+2,i=Math.ceil(r/16),a=new Array(i);for(let o=0;o<i;++o){const t=new Uint32Array(16);for(let n=0;n<16;++n)t[n]=e[64*o+4*n]<<24|e[64*o+4*n+1]<<16|e[64*o+4*n+2]<<8|e[64*o+4*n+3];a[o]=t}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(let o=0;o<i;++o){const e=new Uint32Array(80);for(let t=0;t<16;++t)e[t]=a[o][t];for(let t=16;t<80;++t)e[t]=qk(e[t-3]^e[t-8]^e[t-14]^e[t-16],1);let r=n[0],i=n[1],s=n[2],l=n[3],c=n[4];for(let n=0;n<80;++n){const a=Math.floor(n/20),o=qk(r,5)+$k(a,i,s,l)+c+t[a]+e[n]>>>0;c=l,l=s,s=qk(i,30)>>>0,i=r,r=o}n[0]=n[0]+r>>>0,n[1]=n[1]+i>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+c>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]};Xk.default=Yk,Object.defineProperty(Wk,"__esModule",{value:!0}),Wk.default=void 0;var Kk=Jk(gk),Zk=Jk(Xk);function Jk(e){return e&&e.__esModule?e:{default:e}}var Qk=(0,Kk.default)("v5",80,Zk.default);Wk.default=Qk;var eF={};Object.defineProperty(eF,"__esModule",{value:!0}),eF.default=void 0;eF.default="00000000-0000-0000-0000-000000000000";var tF={};Object.defineProperty(tF,"__esModule",{value:!0}),tF.default=void 0;var nF=function(e){return e&&e.__esModule?e:{default:e}}(QU);var rF=function(e){if(!(0,nF.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};function iF(e,t){if(!(e&&t&&e.length&&t.length))throw new Error("Bad alphabet");this.srcAlphabet=e,this.dstAlphabet=t}tF.default=rF,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return o.default}});var t=u(qU),n=u(mk),r=u(kk),i=u(Wk),a=u(eF),o=u(tF),s=u(QU),l=u(JU),c=u(vk);function u(e){return e&&e.__esModule?e:{default:e}}}($U),iF.prototype.convert=function(e){var t,n,r,i={},a=this.srcAlphabet.length,o=this.dstAlphabet.length,s=e.length,l="string"==typeof e?"":[];if(!this.isValid(e))throw new Error('Number "'+e+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return e;for(t=0;t<s;t++)i[t]=this.srcAlphabet.indexOf(e[t]);do{for(n=0,r=0,t=0;t<s;t++)(n=n*a+i[t])>=o?(i[r++]=parseInt(n/o,10),n%=o):r>0&&(i[r++]=0);s=r,l=this.dstAlphabet.slice(n,n+1).concat(l)}while(0!==r);return l},iF.prototype.isValid=function(e){for(var t=0;t<e.length;++t)if(-1===this.srcAlphabet.indexOf(e[t]))return!1;return!0};var aF=iF;function oF(e,t){var n=new aF(e,t);return function(e){return n.convert(e)}}oF.BIN="01",oF.OCT="01234567",oF.DEC="0123456789",oF.HEX="0123456789abcdef";var sF=oF;const{v4:lF,validate:cF}=$U,uF=sF,hF={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},dF={consistentLength:!0};let fF;const pF=(e,t,n)=>{const r=t(e.toLowerCase().replace(/-/g,""));return n&&n.consistentLength?r.padStart(n.shortIdLength,n.paddingChar):r},mF=(e,t)=>{const n=t(e).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[n[1],n[2],n[3],n[4],n[5]].join("-")};const gF=a((()=>{const e=(e,t)=>{const n=e||hF.flickrBase58,r={...dF,...t};if([...new Set(Array.from(n))].length!==n.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const i=(a=n.length,Math.ceil(Math.log(2**128)/Math.log(a)));var a;const o={shortIdLength:i,consistentLength:r.consistentLength,paddingChar:n[0]},s=uF(uF.HEX,n),l=uF(n,uF.HEX),c=()=>pF(lF(),s,o),u={alphabet:n,fromUUID:e=>pF(e,s,o),maxLength:i,generate:c,new:c,toUUID:e=>mF(e,l),uuid:lF,validate:(e,t=!1)=>{if(!e||"string"!=typeof e)return!1;const a=r.consistentLength?e.length===i:e.length<=i,o=e.split("").every((e=>n.includes(e)));return!1===t?a&&o:a&&o&&cF(mF(e,l))}};return Object.freeze(u),u};return e.constants=hF,e.uuid=lF,e.generate=()=>(fF||(fF=e(hF.flickrBase58).generate),fF()),e})());const vF=new class extends _A{constructor(){super(),t(this,"isProd",!0),t(this,"isTest",!1),t(this,"isDev",!1),t(this,"getQueryString",(e=>n.parse(location.search)[e])),t(this,"preControlPanel"),this.uuid()}uuid(){return gF.generate()}thousand(e,t=0){let n=String(Number(Number(e).toFixed(t)));for(;n!==n.replace(/(\d)(\d{3})(\.|,|$)/,"$1,$2$3");)n=n.replace(/(\d)(\d{3})(\.|,|$)/,"$1,$2$3");return n}numToUnit(e,t=2){let n="",r="";return Math.abs(e)>=1e12?(n=this.thousand(e/1e12,t),r="万亿"):Math.abs(e)>=1e8?(n=this.thousand(e/1e8,t),r="亿"):Math.abs(e)>=1e4?(n=this.thousand(e/1e4,t),r="万"):(n=this.thousand(e,t),r=""),{value:n,unit:r,valueUnit:n+r}}rand(e,t){return Math.floor(Math.random()*(t-e+1)+e)}getSuffix(e){return(pS(e.match(new RegExp("(?<=\\.)\\w+(?=(\\?|$))")),[0])||"").toLowerCase()}getWeekDay(){return["天","一","二","三","四","五","六"][(new Date).getDay()]}getDate(e="."){let t=new Date,n=t.getMonth()+1,r=t.getDate();return n>=1&&n<=9&&(n="0"+n),r>=0&&r<=9&&(r="0"+r),t.getFullYear()+e+n+e+r}getHourMinuteSecond(e=":"){let t=new Date,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return r=r<10?"0"+r:r,i=i<10?"0"+i:i,n+e+r+e+i}ossSuffix(e,t){let n=(e||"").replace(/\?x-oss-process=image\/resize\,w\_\d+/,"").replace(/^https?:/,"");return t&&(n+=`?x-oss-process=image/resize,w_${t}`),n}async selectFiles(e=".jpg,.jpeg,.png,.tga"){return new Promise(((t,n)=>{const r=document.createElement("input");r.style.display="none",r.type="file",r.multiple=!0,r.accept=e,r.onchange=e=>{const n=[...e.target.files];t(n)},document.body.append(r),r.click(),setTimeout((()=>{r.remove()}),100)}))}async selectFile(e=".jpg,.jpeg,.png,.tga"){return new Promise(((t,n)=>{const r=document.createElement("input");r.style.display="none",r.type="file",r.multiple=!1,r.accept=e,r.onchange=e=>{const n=e.target.files;t(n[0])},r.oncancel=()=>{t(void 0)},document.body.append(r),r.click(),setTimeout((()=>{r.remove()}),100)}))}async selectFileToBlobs(e=".jpg,.jpeg,.png,.tga"){return(await this.selectFiles(e)).map((e=>window.URL.createObjectURL(e)))}async selectFileToBlob(e=".jpg,.jpeg,.png,.tga"){const t=await this.selectFile(e);if(t)return window.URL.createObjectURL(t)}async fileToArrayBuffer(e=".jpg,.jpeg,.png,.tga"){const t=await this.selectFile(e);return await new Promise(((e,n)=>{const r=new FileReader;r.onload=t=>{const n=t.target.result;e(n)},r.readAsArrayBuffer(t)}))}isEqualWidth(e,t,n=[]){return Ub(n)?DM(e,t):DM(Rw(e,n),Rw(t,n))}editorMaterial(e,t="",n=()=>{}){const r={name:t};this.preControlPanel&&this.preControlPanel.destroy();const i=this.preControlPanel=new XU({width:400});i.title("材质编辑器"),i.show(!0),console.log("material",e),i.addColor(e,"color").name("材质颜色").onChange((e=>{r.color=`#${e.getHexString()}`,n()})),e.hasOwnProperty("metalness")&&i.add(e,"metalness",0,1,.01).name("金属性").onChange((e=>{r.metalness=e,n()})),e.hasOwnProperty("roughness")&&i.add(e,"roughness",0,1,.01).name("粗糙度").onChange((e=>{r.roughness=e,n()})),i.add({click:()=>{navigator.clipboard.writeText(function(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t+=`${r}: ${n=e[r],"string"==typeof n?`"${n}"`:"object"==typeof n&&null!==n?"...":String(n)}, `);var n;return t.trim().slice(0,-1)}(r)),i.destroy(),iE.success("参数已复制到剪贴板")}},"click").name("确定,并复制配置到剪贴板")}};function yF(e,t){return function(){return e.apply(t,arguments)}}const{toString:_F}=Object.prototype,{getPrototypeOf:bF}=Object,xF=(e=>t=>{const n=_F.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),SF=e=>(e=e.toLowerCase(),t=>xF(t)===e),MF=e=>t=>typeof t===e,{isArray:wF}=Array,EF=MF("undefined");const TF=SF("ArrayBuffer");const AF=MF("string"),CF=MF("function"),RF=MF("number"),PF=e=>null!==e&&"object"==typeof e,LF=e=>{if("object"!==xF(e))return!1;const t=bF(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},IF=SF("Date"),NF=SF("File"),OF=SF("Blob"),DF=SF("FileList"),UF=SF("URLSearchParams"),[kF,FF,zF,BF]=["ReadableStream","Request","Response","Headers"].map(SF);function HF(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),wF(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function VF(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const jF="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,GF=e=>!EF(e)&&e!==jF;const WF=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&bF(Uint8Array)),XF=SF("HTMLFormElement"),$F=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qF=SF("RegExp"),YF=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};HF(n,((n,i)=>{let a;!1!==(a=t(n,i,e))&&(r[i]=a||n)})),Object.defineProperties(e,r)},KF="abcdefghijklmnopqrstuvwxyz",ZF="0123456789",JF={DIGIT:ZF,ALPHA:KF,ALPHA_DIGIT:KF+KF.toUpperCase()+ZF};const QF=SF("AsyncFunction"),ez=(tz="function"==typeof setImmediate,nz=CF(jF.postMessage),tz?setImmediate:nz?(rz=`axios@${Math.random()}`,iz=[],jF.addEventListener("message",(({source:e,data:t})=>{e===jF&&t===rz&&iz.length&&iz.shift()()}),!1),e=>{iz.push(e),jF.postMessage(rz,"*")}):e=>setTimeout(e));var tz,nz,rz,iz;const az="undefined"!=typeof queueMicrotask?queueMicrotask.bind(jF):"undefined"!=typeof process&&process.nextTick||ez,oz={isArray:wF,isArrayBuffer:TF,isBuffer:function(e){return null!==e&&!EF(e)&&null!==e.constructor&&!EF(e.constructor)&&CF(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||CF(e.append)&&("formdata"===(t=xF(e))||"object"===t&&CF(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&TF(e.buffer),t},isString:AF,isNumber:RF,isBoolean:e=>!0===e||!1===e,isObject:PF,isPlainObject:LF,isReadableStream:kF,isRequest:FF,isResponse:zF,isHeaders:BF,isUndefined:EF,isDate:IF,isFile:NF,isBlob:OF,isRegExp:qF,isFunction:CF,isStream:e=>PF(e)&&CF(e.pipe),isURLSearchParams:UF,isTypedArray:WF,isFileList:DF,forEach:HF,merge:function e(){const{caseless:t}=GF(this)&&this||{},n={},r=(r,i)=>{const a=t&&VF(n,i)||i;LF(n[a])&&LF(r)?n[a]=e(n[a],r):LF(r)?n[a]=e({},r):wF(r)?n[a]=r.slice():n[a]=r};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&HF(arguments[i],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(HF(t,((t,r)=>{n&&CF(t)?e[r]=yF(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&bF(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:xF,kindOfTest:SF,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(wF(e))return e;let t=e.length;if(!RF(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:XF,hasOwnProperty:$F,hasOwnProp:$F,reduceDescriptors:YF,freezeMethods:e=>{YF(e,((t,n)=>{if(CF(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];CF(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return wF(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:VF,global:jF,isContextDefined:GF,ALPHABET:JF,generateString:(e=16,t=JF.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&CF(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(PF(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=wF(e)?[]:{};return HF(e,((e,t)=>{const a=n(e,r+1);!EF(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:QF,isThenable:e=>e&&(PF(e)||CF(e))&&CF(e.then)&&CF(e.catch),setImmediate:ez,asap:az};function sz(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}oz.inherits(sz,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oz.toJSONObject(this.config),code:this.code,status:this.status}}});const lz=sz.prototype,cz={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{cz[e]={value:e}})),Object.defineProperties(sz,cz),Object.defineProperty(lz,"isAxiosError",{value:!0}),sz.from=(e,t,n,r,i,a)=>{const o=Object.create(lz);return oz.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),sz.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function uz(e){return oz.isPlainObject(e)||oz.isArray(e)}function hz(e){return oz.endsWith(e,"[]")?e.slice(0,-2):e}function dz(e,t,n){return e?e.concat(t).map((function(e,t){return e=hz(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const fz=oz.toFlatObject(oz,{},null,(function(e){return/^is[A-Z]/.test(e)}));function pz(e,t,n){if(!oz.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=oz.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!oz.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&oz.isSpecCompliantForm(t);if(!oz.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(oz.isDate(e))return e.toISOString();if(!s&&oz.isBlob(e))throw new sz("Blob is not supported. Use a Buffer instead.");return oz.isArrayBuffer(e)||oz.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(oz.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(oz.isArray(e)&&function(e){return oz.isArray(e)&&!e.some(uz)}(e)||(oz.isFileList(e)||oz.endsWith(n,"[]"))&&(s=oz.toArray(e)))return n=hz(n),s.forEach((function(e,r){!oz.isUndefined(e)&&null!==e&&t.append(!0===o?dz([n],r,a):null===o?n:n+"[]",l(e))})),!1;return!!uz(e)||(t.append(dz(i,n,a),l(e)),!1)}const u=[],h=Object.assign(fz,{defaultVisitor:c,convertValue:l,isVisitable:uz});if(!oz.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!oz.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),oz.forEach(n,(function(n,a){!0===(!(oz.isUndefined(n)||null===n)&&i.call(t,n,oz.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a])})),u.pop()}}(e),t}function mz(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function gz(e,t){this._pairs=[],e&&pz(e,this,t)}const vz=gz.prototype;function yz(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _z(e,t,n){if(!t)return e;const r=n&&n.encode||yz,i=n&&n.serialize;let a;if(a=i?i(t,n):oz.isURLSearchParams(t)?t.toString():new gz(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}vz.append=function(e,t){this._pairs.push([e,t])},vz.toString=function(e){const t=e?function(t){return e.call(this,t,mz)}:mz;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class bz{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oz.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}const xz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Sz={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:gz,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Mz="undefined"!=typeof window&&"undefined"!=typeof document,wz="object"==typeof navigator&&navigator||void 0,Ez=Mz&&(!wz||["ReactNative","NativeScript","NS"].indexOf(wz.product)<0),Tz="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Az=Mz&&window.location.href||"http://localhost",Cz={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Mz,hasStandardBrowserEnv:Ez,hasStandardBrowserWebWorkerEnv:Tz,navigator:wz,origin:Az},Symbol.toStringTag,{value:"Module"})),...Sz};function Rz(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&oz.isArray(r)?r.length:a,s)return oz.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&oz.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&oz.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(oz.isFormData(e)&&oz.isFunction(e.entries)){const n={};return oz.forEachEntry(e,((e,r)=>{t(function(e){return oz.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const Pz={transitional:xz,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=oz.isObject(e);i&&oz.isHTMLForm(e)&&(e=new FormData(e));if(oz.isFormData(e))return r?JSON.stringify(Rz(e)):e;if(oz.isArrayBuffer(e)||oz.isBuffer(e)||oz.isStream(e)||oz.isFile(e)||oz.isBlob(e)||oz.isReadableStream(e))return e;if(oz.isArrayBufferView(e))return e.buffer;if(oz.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return pz(e,new Cz.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Cz.isNode&&oz.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=oz.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return pz(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t){if(oz.isString(e))try{return(t||JSON.parse)(e),oz.trim(e)}catch(AB){if("SyntaxError"!==AB.name)throw AB}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Pz.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(oz.isResponse(e)||oz.isReadableStream(e))return e;if(e&&oz.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(AB){if(n){if("SyntaxError"===AB.name)throw sz.from(AB,sz.ERR_BAD_RESPONSE,this,null,this.response);throw AB}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cz.classes.FormData,Blob:Cz.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oz.forEach(["delete","get","head","post","put","patch"],(e=>{Pz.headers[e]={}}));const Lz=oz.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Iz=Symbol("internals");function Nz(e){return e&&String(e).trim().toLowerCase()}function Oz(e){return!1===e||null==e?e:oz.isArray(e)?e.map(Oz):String(e)}function Dz(e,t,n,r,i){return oz.isFunction(r)?r.call(this,t,n):(i&&(t=n),oz.isString(t)?oz.isString(r)?-1!==t.indexOf(r):oz.isRegExp(r)?r.test(t):void 0:void 0)}class Uz{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Nz(t);if(!i)throw new Error("header name must be a non-empty string");const a=oz.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Oz(e))}const a=(e,t)=>oz.forEach(e,((e,n)=>i(e,n,t)));if(oz.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(oz.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Lz[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(oz.isHeaders(e))for(const[o,s]of e.entries())i(s,o,n);else null!=e&&i(t,e,n);return this}get(e,t){if(e=Nz(e)){const n=oz.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(oz.isFunction(t))return t.call(this,e,n);if(oz.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Nz(e)){const n=oz.findKey(this,e);return!(!n||void 0===this[n]||t&&!Dz(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Nz(e)){const i=oz.findKey(n,e);!i||t&&!Dz(0,n[i],i,t)||(delete n[i],r=!0)}}return oz.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Dz(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return oz.forEach(this,((r,i)=>{const a=oz.findKey(n,i);if(a)return t[a]=Oz(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Oz(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return oz.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&oz.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Iz]=this[Iz]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Nz(e);t[r]||(!function(e,t){const n=oz.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return oz.isArray(e)?e.forEach(r):r(e),this}}function kz(e,t){const n=this||Pz,r=t||n,i=Uz.from(r.headers);let a=r.data;return oz.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function Fz(e){return!(!e||!e.__CANCEL__)}function zz(e,t,n){sz.call(this,null==e?"canceled":e,sz.ERR_CANCELED,t,n),this.name="CanceledError"}function Bz(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new sz("Request failed with status code "+n.status,[sz.ERR_BAD_REQUEST,sz.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Uz.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oz.reduceDescriptors(Uz.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),oz.freezeMethods(Uz),oz.inherits(zz,sz,{__CANCEL__:!0});const Hz=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[o];i||(i=l),n[a]=s,r[a]=l;let u=o,h=0;for(;u!==a;)h+=n[u++],u%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),l-i<t)return;const d=c&&l-c;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let n,r,i=0,a=1e3/t;const o=(t,a=Date.now())=>{i=a,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-i;s>=a?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),a-s)))},()=>n&&o(n)]}((n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,l=i(s);r=a;e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:l||void 0,estimated:l&&o&&a<=o?(o-a)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},Vz=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},jz=e=>(...t)=>oz.asap((()=>e(...t))),Gz=Cz.hasStandardBrowserEnv?function(){const e=Cz.navigator&&/(msie|trident)/i.test(Cz.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=oz.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return function(){return!0}}(),Wz=Cz.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];oz.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),oz.isString(r)&&o.push("path="+r),oz.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Xz(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const $z=e=>e instanceof Uz?{...e}:e;function qz(e,t){t=t||{};const n={};function r(e,t,n){return oz.isPlainObject(e)&&oz.isPlainObject(t)?oz.merge.call({caseless:n},e,t):oz.isPlainObject(t)?oz.merge({},t):oz.isArray(t)?t.slice():t}function i(e,t,n){return oz.isUndefined(t)?oz.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!oz.isUndefined(t))return r(void 0,t)}function o(e,t){return oz.isUndefined(t)?oz.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i($z(e),$z(t),!0)};return oz.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=l[r]||i,o=a(e[r],t[r],r);oz.isUndefined(o)&&a!==s||(n[r]=o)})),n}const Yz=e=>{const t=qz({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:o,headers:s,auth:l}=t;if(t.headers=s=Uz.from(s),t.url=_z(Xz(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),oz.isFormData(r))if(Cz.hasStandardBrowserEnv||Cz.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(Cz.hasStandardBrowserEnv&&(i&&oz.isFunction(i)&&(i=i(t)),i||!1!==i&&Gz(t.url))){const e=a&&o&&Wz.read(o);e&&s.set(a,e)}return t},Kz="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Yz(e);let i=r.data;const a=Uz.from(r.headers).normalize();let o,s,l,c,u,{responseType:h,onUploadProgress:d,onDownloadProgress:f}=r;function p(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Uz.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Bz((function(e){t(e),p()}),(function(e){n(e),p()}),{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new sz("Request aborted",sz.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new sz("Network Error",sz.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||xz;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new sz(t,i.clarifyTimeoutError?sz.ETIMEDOUT:sz.ECONNABORTED,e,m)),m=null},void 0===i&&a.setContentType(null),"setRequestHeader"in m&&oz.forEach(a.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),oz.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),f&&([l,u]=Hz(f,!0),m.addEventListener("progress",l)),d&&m.upload&&([s,c]=Hz(d),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new zz(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===Cz.protocols.indexOf(v)?n(new sz("Unsupported protocol "+v+":",sz.ERR_BAD_REQUEST,e)):m.send(i||null)}))},Zz=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof sz?t:new zz(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,i(new sz(`timeout ${t} of ms exceeded`,sz.ETIMEDOUT))}),t);const o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i)));const{signal:s}=r;return s.unsubscribe=()=>oz.asap(o),s}},Jz=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Qz=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},eB=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Qz(e))yield*Jz(n,t)}(e,t);let a,o=0,s=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return s(),void e.close();let a=r.byteLength;if(n){let e=o+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw s(t),t}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},tB="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,nB=tB&&"function"==typeof ReadableStream,rB=tB&&("function"==typeof TextEncoder?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),iB=(e,...t)=>{try{return!!e(...t)}catch(AB){return!1}},aB=nB&&iB((()=>{let e=!1;const t=new Request(Cz.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),oB=nB&&iB((()=>oz.isReadableStream(new Response("").body))),sB={stream:oB&&(e=>e.body)};var lB;tB&&(lB=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!sB[e]&&(sB[e]=oz.isFunction(lB[e])?t=>t[e]():(t,n)=>{throw new sz(`Response type '${e}' is not supported`,sz.ERR_NOT_SUPPORT,n)})})));const cB=async(e,t)=>{const n=oz.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(oz.isBlob(e))return e.size;if(oz.isSpecCompliantForm(e)){const t=new Request(Cz.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return oz.isArrayBufferView(e)||oz.isArrayBuffer(e)?e.byteLength:(oz.isURLSearchParams(e)&&(e+=""),oz.isString(e)?(await rB(e)).byteLength:void 0)})(t):n},uB={http:null,xhr:Kz,fetch:tB&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:u,withCredentials:h="same-origin",fetchOptions:d}=Yz(e);c=c?(c+"").toLowerCase():"text";let f,p=Zz([i,a&&a.toAbortSignal()],o);const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let g;try{if(l&&aB&&"get"!==n&&"head"!==n&&0!==(g=await cB(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(oz.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Vz(g,Hz(jz(l)));r=eB(n.body,65536,e,t)}}oz.isString(h)||(h=h?"include":"omit");const i="credentials"in Request.prototype;f=new Request(t,{...d,signal:p,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?h:void 0});let a=await fetch(f);const o=oB&&("stream"===c||"response"===c);if(oB&&(s||o&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=oz.toFiniteNumber(a.headers.get("content-length")),[n,r]=s&&Vz(t,Hz(jz(s),!0))||[];a=new Response(eB(a.body,65536,n,(()=>{r&&r(),m&&m()})),e)}c=c||"text";let v=await sB[oz.findKey(sB,c)||"text"](a,e);return!o&&m&&m(),await new Promise(((t,n)=>{Bz(t,n,{data:v,headers:Uz.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:f})}))}catch(v){if(m&&m(),v&&"TypeError"===v.name&&/fetch/i.test(v.message))throw Object.assign(new sz("Network Error",sz.ERR_NETWORK,e,f),{cause:v.cause||v});throw sz.from(v,v&&v.code,e,f)}})};oz.forEach(uB,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(AB){}Object.defineProperty(e,"adapterName",{value:t})}}));const hB=e=>`- ${e}`,dB=e=>oz.isFunction(e)||null===e||!1===e,fB=e=>{e=oz.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!dB(n)&&(r=uB[(t=String(n)).toLowerCase()],void 0===r))throw new sz(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+a]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new sz("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(hB).join("\n"):" "+hB(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function pB(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new zz(null,e)}function mB(e){pB(e),e.headers=Uz.from(e.headers),e.data=kz.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return fB(e.adapter||Pz.adapter)(e).then((function(t){return pB(e),t.data=kz.call(e,e.transformResponse,t),t.headers=Uz.from(t.headers),t}),(function(t){return Fz(t)||(pB(e),t&&t.response&&(t.response.data=kz.call(e,e.transformResponse,t.response),t.response.headers=Uz.from(t.response.headers))),Promise.reject(t)}))}const gB="1.7.7",vB={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{vB[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const yB={};vB.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new sz(r(i," has been removed"+(t?" in "+t:"")),sz.ERR_DEPRECATED);return t&&!yB[i]&&(yB[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};const _B={assertOptions:function(e,t,n){if("object"!=typeof e)throw new sz("options must be an object",sz.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new sz("option "+a+" must be "+n,sz.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new sz("Unknown option "+a,sz.ERR_BAD_OPTION)}},validators:vB},bB=_B.validators;class xB{constructor(e){this.defaults=e,this.interceptors={request:new bz,response:new bz}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(AB){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=qz(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&_B.assertOptions(n,{silentJSONParsing:bB.transitional(bB.boolean),forcedJSONParsing:bB.transitional(bB.boolean),clarifyTimeoutError:bB.transitional(bB.boolean)},!1),null!=r&&(oz.isFunction(r)?t.paramsSerializer={serialize:r}:_B.assertOptions(r,{encode:bB.function,serialize:bB.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&oz.merge(i.common,i[t.method]);i&&oz.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Uz.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,h=0;if(!s){const e=[mB.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);h<u;)c=c.then(e[h++],e[h++]);return c}u=o.length;let d=t;for(h=0;h<u;){const e=o[h++],t=o[h++];try{d=e(d)}catch(f){t.call(this,f);break}}try{c=mB.call(this,d)}catch(f){return Promise.reject(f)}for(h=0,u=l.length;h<u;)c=c.then(l[h++],l[h++]);return c}getUri(e){return _z(Xz((e=qz(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}oz.forEach(["delete","get","head","options"],(function(e){xB.prototype[e]=function(t,n){return this.request(qz(n||{},{method:e,url:t,data:(n||{}).data}))}})),oz.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(qz(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}xB.prototype[e]=t(),xB.prototype[e+"Form"]=t(!0)}));class SB{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new zz(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new SB((function(t){e=t})),cancel:e}}}const MB={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(MB).forEach((([e,t])=>{MB[t]=e}));const wB=function e(t){const n=new xB(t),r=yF(xB.prototype.request,n);return oz.extend(r,xB.prototype,n,{allOwnKeys:!0}),oz.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(qz(t,n))},r}(Pz);wB.Axios=xB,wB.CanceledError=zz,wB.CancelToken=SB,wB.isCancel=Fz,wB.VERSION=gB,wB.toFormData=pz,wB.AxiosError=sz,wB.Cancel=wB.CanceledError,wB.all=function(e){return Promise.all(e)},wB.spread=function(e){return function(t){return e.apply(null,t)}},wB.isAxiosError=function(e){return oz.isObject(e)&&!0===e.isAxiosError},wB.mergeConfig=qz,wB.AxiosHeaders=Uz,wB.formToJSON=e=>Rz(oz.isHTMLForm(e)?new FormData(e):e),wB.getAdapter=fB,wB.HttpStatusCode=MB,wB.default=wB;class EB{constructor(){t(this,"baseURL","//api.open3dcloud.com/"+(vF.isProd?"klbg":"test/klbg")),t(this,"devBaseURL","/api"),t(this,"timeout",6e4),t(this,"withCredentials",!1)}_createInstance(){const e={};localStorage.token&&Object.assign(e,{Authorization:`Bearer ${localStorage.token}`});const t=wB.create({baseURL:vF.isDev?this.devBaseURL:this.baseURL,timeout:this.timeout,headers:e});return t.interceptors.response.use((e=>this._responseInterceptors(e))),t}_requestInterceptors(e){return e}_responseInterceptors(e){if(!pS(e,["data","success"])){const t=pS(e,["data","message"]);console.error(t),iE.error(t)}return e.data}_get(e,t){const n={"Content-Type":"application/x-www-form-urlencoded"};return localStorage.token&&Object.assign(n,{Authorization:`Bearer ${localStorage.token}`}),this._createInstance().get(e,{params:t,headers:{"Content-Type":"application/x-www-form-urlencoded"}})}_post(e,t={}){return this._createInstance().post(e,t)}_upload(e,t){return wB.create({baseURL:vF.isDev?this.devBaseURL:this.baseURL,timeout:this.timeout,headers:{"Content-Type":"application/x-www-form-urlencoded"},withCredentials:this.withCredentials}).post(e,t)}}const TB=new class extends EB{constructor(){super()}async send_sms(e,t=1){return this._post(`/auth/sendSMS?phone=${e}&type=${t}`)}async sms_login(e,t){return await this._post("/auth/loginByPhone",{phone:e,code:t})}loginOut(){return this._post("/auth/logout")}async get_user_info(){const e={"Content-Type":"application/x-www-form-urlencoded"};return localStorage.token&&Object.assign(e,{Authorization:`Bearer ${localStorage.token}`}),wB.create({baseURL:vF.isDev?this.devBaseURL:this.baseURL,timeout:this.timeout,headers:e,withCredentials:this.withCredentials}).get("/auth/getUserInfo")}updateUser(e){return this._post("/auth/user/update",e)}checkPhone(e){return this._post("/auth/user/checkPhone",e)}updatePhone(e){return this._post("/auth/user/updatePhone",e)}wx_Login_get_access_token(e){return this._post("/wx_Login_get_access_token",{...e})}};export{ye as $,Cy as A,ne as B,Tv as C,ke as D,Be as E,Ce as F,Pe as G,be as H,oe as I,ee as J,pn as K,xg as L,ly as M,Ry as N,Te as O,Iy as P,ie as Q,j as R,Ag as S,yn as T,xr as U,Di as V,Eg as W,le as X,it as Y,_e as Z,W as _,q as a,iE as a$,er as a0,Wm as a1,G as a2,ce as a3,ze as a4,Fe as a5,Fi as a6,Ui as a7,ur as a8,ir as a9,TB as aA,pS as aB,vF as aC,gn as aD,Mn as aE,Br as aF,xe as aG,Xm as aH,xn as aI,rr as aJ,Me as aK,ar as aL,hg as aM,TS as aN,NM as aO,o_ as aP,fM as aQ,fS as aR,iw as aS,Xb as aT,lS as aU,hS as aV,_w as aW,sb as aX,hb as aY,Hb as aZ,EB as a_,sr as aa,Ae as ab,Dy as ac,bg as ad,Tg as ae,Uy as af,Ey as ag,by as ah,_n as ai,qv as aj,gy as ak,fy as al,uy as am,_y as an,Sy as ao,Xv as ap,Ub as aq,Uv as ar,Ug as as,ug as at,kg as au,Jn as av,Dg as aw,Zv as ax,lg as ay,Pi as az,X as b,SO as b$,$y as b0,tS as b1,BD as b2,jD as b3,JT as b4,QT as b5,VR as b6,LR as b7,wR as b8,QA as b9,lU as bA,OR as bB,IR as bC,IA as bD,LA as bE,lD as bF,DD as bG,iC as bH,OD as bI,WC as bJ,ID as bK,PD as bL,qT as bM,KT as bN,YT as bO,CR as bP,gD as bQ,cO as bR,tO as bS,uU as bT,xN as bU,VE as bV,GE as bW,wO as bX,AR as bY,mD as bZ,uE as b_,aC as ba,OO as bb,cU as bc,XD as bd,UE as be,kE as bf,JA as bg,vD as bh,yD as bi,OE as bj,DC as bk,uN as bl,KN as bm,bU as bn,lR as bo,WP as bp,yP as bq,aU as br,PA as bs,eU as bt,sU as bu,YN as bv,oP as bw,uO as bx,yO as by,eO as bz,$ as c,MU as c$,MO as c0,RO as c1,VT as c2,jA as c3,zE as c4,BE as c5,jE as c6,HE as c7,FE as c8,HT as c9,DO as cA,lP as cB,hD as cC,dD as cD,fD as cE,WD as cF,LO as cG,wB as cH,gL as cI,iT as cJ,qE as cK,tC as cL,NP as cM,hE as cN,pD as cO,dE as cP,PU as cQ,LU as cR,FN as cS,wN as cT,I_ as cU,kS as cV,LS as cW,IS as cX,a_ as cY,J_ as cZ,qD as c_,lE as ca,MN as cb,lC as cc,TC as cd,MD as ce,zD as cf,ZT as cg,i as ch,IP as ci,fP as cj,wU as ck,bN as cl,_N as cm,NO as cn,aE as co,IO as cp,YA as cq,rT as cr,_A as cs,hU as ct,OC as cu,TP as cv,oE as cw,sE as cx,RU as cy,TU as cz,Q as d,qr as d0,Ln as e,at as f,a as g,Ni as h,Je as i,vn as j,Sn as k,gg as l,pr as m,Ci as n,Oi as o,eg as p,ig as q,V as r,Qn as s,Og as t,In as u,Li as v,_v as w,Ai as x,tr as y,Zn as z};
