chunk-vendors.f4c95e77.js 591 KB

1234567891011121314151617181920
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{2877:function(t,e,n){"use strict";function i(t,e,n,i,r,a,s,o){var l,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),s?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):r&&(l=o?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}n.d(e,"a",(function(){return i}))},"2b0e":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return $i}));
  2. /*!
  3. * Vue.js v2.7.10
  4. * (c) 2014-2022 Evan You
  5. * Released under the MIT License.
  6. */
  7. var i=Object.freeze({}),r=Array.isArray;function a(t){return void 0===t||null===t}function s(t){return void 0!==t&&null!==t}function o(t){return!0===t}function l(t){return!1===t}function c(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function u(t){return"function"===typeof t}function h(t){return null!==t&&"object"===typeof t}var d=Object.prototype.toString;function p(t){return"[object Object]"===d.call(t)}function f(t){return"[object RegExp]"===d.call(t)}function m(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function g(t){return s(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function v(t){return null==t?"":Array.isArray(t)||p(t)&&t.toString===d?JSON.stringify(t,null,2):String(t)}function _(t){var e=parseFloat(t);return isNaN(e)?t:e}function x(t,e){for(var n=Object.create(null),i=t.split(","),r=0;r<i.length;r++)n[i[r]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}x("slot,component",!0);var y=x("key,ref,slot,slot-scope,is");function b(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var M=Object.prototype.hasOwnProperty;function w(t,e){return M.call(t,e)}function S(t){var e=Object.create(null);return function(n){var i=e[n];return i||(e[n]=t(n))}}var T=/-(\w)/g,E=S((function(t){return t.replace(T,(function(t,e){return e?e.toUpperCase():""}))})),A=S((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),C=/\B([A-Z])/g,L=S((function(t){return t.replace(C,"-$1").toLowerCase()}));function P(t,e){function n(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function D(t,e){return t.bind(e)}var R=Function.prototype.bind?D:P;function I(t,e){e=e||0;var n=t.length-e,i=new Array(n);while(n--)i[n]=t[n+e];return i}function O(t,e){for(var n in e)t[n]=e[n];return t}function N(t){for(var e={},n=0;n<t.length;n++)t[n]&&O(e,t[n]);return e}function U(t,e,n){}var k=function(t,e,n){return!1},z=function(t){return t};function F(t,e){if(t===e)return!0;var n=h(t),i=h(e);if(!n||!i)return!n&&!i&&String(t)===String(e);try{var r=Array.isArray(t),a=Array.isArray(e);if(r&&a)return t.length===e.length&&t.every((function(t,n){return F(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(r||a)return!1;var s=Object.keys(t),o=Object.keys(e);return s.length===o.length&&s.every((function(n){return F(t[n],e[n])}))}catch(l){return!1}}function B(t,e){for(var n=0;n<t.length;n++)if(F(t[n],e))return n;return-1}function V(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function H(t,e){return t===e?0===t&&1/t!==1/e:t===t||e===e}var G="data-server-rendered",W=["component","directive","filter"],j=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],X={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:k,isReservedAttr:k,isUnknownElement:k,getTagNamespace:U,parsePlatformTagName:z,mustUseProp:k,async:!0,_lifecycleHooks:j},q=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function $(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function Y(t,e,n,i){Object.defineProperty(t,e,{value:n,enumerable:!!i,writable:!0,configurable:!0})}var Z=new RegExp("[^".concat(q.source,".$_\\d]"));function K(t){if(!Z.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}var J="__proto__"in{},Q="undefined"!==typeof window,tt=Q&&window.navigator.userAgent.toLowerCase(),et=tt&&/msie|trident/.test(tt),nt=tt&&tt.indexOf("msie 9.0")>0,it=tt&&tt.indexOf("edge/")>0;tt&&tt.indexOf("android");var rt=tt&&/iphone|ipad|ipod|ios/.test(tt);tt&&/chrome\/\d+/.test(tt),tt&&/phantomjs/.test(tt);var at,st=tt&&tt.match(/firefox\/(\d+)/),ot={}.watch,lt=!1;if(Q)try{var ct={};Object.defineProperty(ct,"passive",{get:function(){lt=!0}}),window.addEventListener("test-passive",null,ct)}catch($s){}var ut=function(){return void 0===at&&(at=!Q&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),at},ht=Q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function dt(t){return"function"===typeof t&&/native code/.test(t.toString())}var pt,ft="undefined"!==typeof Symbol&&dt(Symbol)&&"undefined"!==typeof Reflect&&dt(Reflect.ownKeys);pt="undefined"!==typeof Set&&dt(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var mt=null;function gt(t){void 0===t&&(t=null),t||mt&&mt._scope.off(),mt=t,t&&t._scope.on()}var vt=function(){function t(t,e,n,i,r,a,s,o){this.tag=t,this.data=e,this.children=n,this.text=i,this.elm=r,this.ns=void 0,this.context=a,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=o,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),_t=function(t){void 0===t&&(t="");var e=new vt;return e.text=t,e.isComment=!0,e};function xt(t){return new vt(void 0,void 0,void 0,String(t))}function yt(t){var e=new vt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var bt=0,Mt=function(){function t(){this.id=bt++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){b(this.subs,t)},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.slice();for(var n=0,i=e.length;n<i;n++){e[n].update()}},t}();Mt.target=null;var wt=[];function St(t){wt.push(t),Mt.target=t}function Tt(){wt.pop(),Mt.target=wt[wt.length-1]}var Et=Array.prototype,At=Object.create(Et),Ct=["push","pop","shift","unshift","splice","sort","reverse"];Ct.forEach((function(t){var e=Et[t];Y(At,t,(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r,a=e.apply(this,n),s=this.__ob__;switch(t){case"push":case"unshift":r=n;break;case"splice":r=n.slice(2);break}return r&&s.observeArray(r),s.dep.notify(),a}))}));var Lt=Object.getOwnPropertyNames(At),Pt={},Dt=!0;function Rt(t){Dt=t}var It={notify:U,depend:U,addSub:U,removeSub:U},Ot=function(){function t(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!1),this.value=t,this.shallow=e,this.mock=n,this.dep=n?It:new Mt,this.vmCount=0,Y(t,"__ob__",this),r(t)){if(!n)if(J)t.__proto__=At;else for(var i=0,a=Lt.length;i<a;i++){var s=Lt[i];Y(t,s,At[s])}e||this.observeArray(t)}else{var o=Object.keys(t);for(i=0;i<o.length;i++){s=o[i];Ut(t,s,Pt,void 0,e,n)}}}return t.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)Nt(t[e],!1,this.mock)},t}();function Nt(t,e,n){var i;if(!(!h(t)||Gt(t)||t instanceof vt))return w(t,"__ob__")&&t.__ob__ instanceof Ot?i=t.__ob__:!Dt||!n&&ut()||!r(t)&&!p(t)||!Object.isExtensible(t)||t.__v_skip||(i=new Ot(t,e,n)),i}function Ut(t,e,n,i,a,s){var o=new Mt,l=Object.getOwnPropertyDescriptor(t,e);if(!l||!1!==l.configurable){var c=l&&l.get,u=l&&l.set;c&&!u||n!==Pt&&2!==arguments.length||(n=t[e]);var h=!a&&Nt(n,!1,s);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=c?c.call(t):n;return Mt.target&&(o.depend(),h&&(h.dep.depend(),r(e)&&Ft(e))),Gt(e)&&!a?e.value:e},set:function(e){var i=c?c.call(t):n;if(H(i,e)){if(u)u.call(t,e);else{if(c)return;if(!a&&Gt(i)&&!Gt(e))return void(i.value=e);n=e}h=!a&&Nt(e,!1,s),o.notify()}}}),o}}function kt(t,e,n){if(!Ht(t)){var i=t.__ob__;return r(t)&&m(e)?(t.length=Math.max(t.length,e),t.splice(e,1,n),i&&!i.shallow&&i.mock&&Nt(n,!1,!0),n):e in t&&!(e in Object.prototype)?(t[e]=n,n):t._isVue||i&&i.vmCount?n:i?(Ut(i.value,e,n,void 0,i.shallow,i.mock),i.dep.notify(),n):(t[e]=n,n)}}function zt(t,e){if(r(t)&&m(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount||Ht(t)||w(t,e)&&(delete t[e],n&&n.dep.notify())}}function Ft(t){for(var e=void 0,n=0,i=t.length;n<i;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),r(e)&&Ft(e)}function Bt(t){return Vt(t,!0),Y(t,"__v_isShallow",!0),t}function Vt(t,e){if(!Ht(t)){Nt(t,e,ut());0}}function Ht(t){return!(!t||!t.__v_isReadonly)}function Gt(t){return!(!t||!0!==t.__v_isRef)}function Wt(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var t=e[n];if(Gt(t))return t.value;var i=t&&t.__ob__;return i&&i.dep.depend(),t},set:function(t){var i=e[n];Gt(i)&&!Gt(t)?i.value=t:e[n]=t}})}var jt="watcher";"".concat(jt," callback"),"".concat(jt," getter"),"".concat(jt," cleanup");var Xt;var qt=function(){function t(t){void 0===t&&(t=!1),this.active=!0,this.effects=[],this.cleanups=[],!t&&Xt&&(this.parent=Xt,this.index=(Xt.scopes||(Xt.scopes=[])).push(this)-1)}return t.prototype.run=function(t){if(this.active){var e=Xt;try{return Xt=this,t()}finally{Xt=e}}else 0},t.prototype.on=function(){Xt=this},t.prototype.off=function(){Xt=this.parent},t.prototype.stop=function(t){if(this.active){var e=void 0,n=void 0;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].teardown();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(this.parent&&!t){var i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.active=!1}},t}();function $t(t,e){void 0===e&&(e=Xt),e&&e.active&&e.effects.push(t)}function Yt(t){var e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}var Zt=S((function(t){var e="&"===t.charAt(0);t=e?t.slice(1):t;var n="~"===t.charAt(0);t=n?t.slice(1):t;var i="!"===t.charAt(0);return t=i?t.slice(1):t,{name:t,once:n,capture:i,passive:e}}));function Kt(t,e){function n(){var t=n.fns;if(!r(t))return qe(t,null,arguments,e,"v-on handler");for(var i=t.slice(),a=0;a<i.length;a++)qe(i[a],null,arguments,e,"v-on handler")}return n.fns=t,n}function Jt(t,e,n,i,r,s){var l,c,u,h;for(l in t)c=t[l],u=e[l],h=Zt(l),a(c)||(a(u)?(a(c.fns)&&(c=t[l]=Kt(c,s)),o(h.once)&&(c=t[l]=r(h.name,c,h.capture)),n(h.name,c,h.capture,h.passive,h.params)):c!==u&&(u.fns=c,t[l]=u));for(l in e)a(t[l])&&(h=Zt(l),i(h.name,e[l],h.capture))}function Qt(t,e,n){var i;t instanceof vt&&(t=t.data.hook||(t.data.hook={}));var r=t[e];function l(){n.apply(this,arguments),b(i.fns,l)}a(r)?i=Kt([l]):s(r.fns)&&o(r.merged)?(i=r,i.fns.push(l)):i=Kt([r,l]),i.merged=!0,t[e]=i}function te(t,e,n){var i=e.options.props;if(!a(i)){var r={},o=t.attrs,l=t.props;if(s(o)||s(l))for(var c in i){var u=L(c);ee(r,l,c,u,!0)||ee(r,o,c,u,!1)}return r}}function ee(t,e,n,i,r){if(s(e)){if(w(e,n))return t[n]=e[n],r||delete e[n],!0;if(w(e,i))return t[n]=e[i],r||delete e[i],!0}return!1}function ne(t){for(var e=0;e<t.length;e++)if(r(t[e]))return Array.prototype.concat.apply([],t);return t}function ie(t){return c(t)?[xt(t)]:r(t)?ae(t):void 0}function re(t){return s(t)&&s(t.text)&&l(t.isComment)}function ae(t,e){var n,i,l,u,h=[];for(n=0;n<t.length;n++)i=t[n],a(i)||"boolean"===typeof i||(l=h.length-1,u=h[l],r(i)?i.length>0&&(i=ae(i,"".concat(e||"","_").concat(n)),re(i[0])&&re(u)&&(h[l]=xt(u.text+i[0].text),i.shift()),h.push.apply(h,i)):c(i)?re(u)?h[l]=xt(u.text+i):""!==i&&h.push(xt(i)):re(i)&&re(u)?h[l]=xt(u.text+i.text):(o(t._isVList)&&s(i.tag)&&a(i.key)&&s(e)&&(i.key="__vlist".concat(e,"_").concat(n,"__")),h.push(i)));return h}function se(t,e){var n,i,a,o,l=null;if(r(t)||"string"===typeof t)for(l=new Array(t.length),n=0,i=t.length;n<i;n++)l[n]=e(t[n],n);else if("number"===typeof t)for(l=new Array(t),n=0;n<t;n++)l[n]=e(n+1,n);else if(h(t))if(ft&&t[Symbol.iterator]){l=[];var c=t[Symbol.iterator](),u=c.next();while(!u.done)l.push(e(u.value,l.length)),u=c.next()}else for(a=Object.keys(t),l=new Array(a.length),n=0,i=a.length;n<i;n++)o=a[n],l[n]=e(t[o],o,n);return s(l)||(l=[]),l._isVList=!0,l}function oe(t,e,n,i){var r,a=this.$scopedSlots[t];a?(n=n||{},i&&(n=O(O({},i),n)),r=a(n)||(u(e)?e():e)):r=this.$slots[t]||(u(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},r):r}function le(t){return bi(this.$options,"filters",t,!0)||z}function ce(t,e){return r(t)?-1===t.indexOf(e):t!==e}function ue(t,e,n,i,r){var a=X.keyCodes[e]||n;return r&&i&&!X.keyCodes[e]?ce(r,i):a?ce(a,t):i?L(i)!==e:void 0===t}function he(t,e,n,i,a){if(n)if(h(n)){r(n)&&(n=N(n));var s=void 0,o=function(r){if("class"===r||"style"===r||y(r))s=t;else{var o=t.attrs&&t.attrs.type;s=i||X.mustUseProp(e,o,r)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var l=E(r),c=L(r);if(!(l in s)&&!(c in s)&&(s[r]=n[r],a)){var u=t.on||(t.on={});u["update:".concat(r)]=function(t){n[r]=t}}};for(var l in n)o(l)}else;return t}function de(t,e){var n=this._staticTrees||(this._staticTrees=[]),i=n[t];return i&&!e||(i=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),fe(i,"__static__".concat(t),!1)),i}function pe(t,e,n){return fe(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function fe(t,e,n){if(r(t))for(var i=0;i<t.length;i++)t[i]&&"string"!==typeof t[i]&&me(t[i],"".concat(e,"_").concat(i),n);else me(t,e,n)}function me(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function ge(t,e){if(e)if(p(e)){var n=t.on=t.on?O({},t.on):{};for(var i in e){var r=n[i],a=e[i];n[i]=r?[].concat(r,a):a}}else;return t}function ve(t,e,n,i){e=e||{$stable:!n};for(var a=0;a<t.length;a++){var s=t[a];r(s)?ve(s,e,n):s&&(s.proxy&&(s.fn.proxy=!0),e[s.key]=s.fn)}return i&&(e.$key=i),e}function _e(t,e){for(var n=0;n<e.length;n+=2){var i=e[n];"string"===typeof i&&i&&(t[e[n]]=e[n+1])}return t}function xe(t,e){return"string"===typeof t?e+t:t}function ye(t){t._o=pe,t._n=_,t._s=v,t._l=se,t._t=oe,t._q=F,t._i=B,t._m=de,t._f=le,t._k=ue,t._b=he,t._v=xt,t._e=_t,t._u=ve,t._g=ge,t._d=_e,t._p=xe}function be(t,e){if(!t||!t.length)return{};for(var n={},i=0,r=t.length;i<r;i++){var a=t[i],s=a.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,a.context!==e&&a.fnContext!==e||!s||null==s.slot)(n.default||(n.default=[])).push(a);else{var o=s.slot,l=n[o]||(n[o]=[]);"template"===a.tag?l.push.apply(l,a.children||[]):l.push(a)}}for(var c in n)n[c].every(Me)&&delete n[c];return n}function Me(t){return t.isComment&&!t.asyncFactory||" "===t.text}function we(t){return t.isComment&&t.asyncFactory}function Se(t,e,n,r){var a,s=Object.keys(n).length>0,o=e?!!e.$stable:!s,l=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(o&&r&&r!==i&&l===r.$key&&!s&&!r.$hasNormal)return r;for(var c in a={},e)e[c]&&"$"!==c[0]&&(a[c]=Te(t,n,c,e[c]))}else a={};for(var u in n)u in a||(a[u]=Ee(n,u));return e&&Object.isExtensible(e)&&(e._normalized=a),Y(a,"$stable",o),Y(a,"$key",l),Y(a,"$hasNormal",s),a}function Te(t,e,n,i){var a=function(){var e=mt;gt(t);var n=arguments.length?i.apply(null,arguments):i({});n=n&&"object"===typeof n&&!r(n)?[n]:ie(n);var a=n&&n[0];return gt(e),n&&(!a||1===n.length&&a.isComment&&!we(a))?void 0:n};return i.proxy&&Object.defineProperty(e,n,{get:a,enumerable:!0,configurable:!0}),a}function Ee(t,e){return function(){return t[e]}}function Ae(t){var e=t.$options,n=e.setup;if(n){var i=t._setupContext=Ce(t);gt(t),St();var r=qe(n,null,[t._props||Bt({}),i],t,"setup");if(Tt(),gt(),u(r))e.render=r;else if(h(r))if(t._setupState=r,r.__sfc){var a=t._setupProxy={};for(var s in r)"__sfc"!==s&&Wt(a,r,s)}else for(var s in r)$(s)||Wt(t,r,s);else 0}}function Ce(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};Y(e,"_v_attr_proxy",!0),Le(e,t.$attrs,i,t,"$attrs")}return t._attrsProxy},get listeners(){if(!t._listenersProxy){var e=t._listenersProxy={};Le(e,t.$listeners,i,t,"$listeners")}return t._listenersProxy},get slots(){return De(t)},emit:R(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return Wt(t,e,n)}))}}}function Le(t,e,n,i,r){var a=!1;for(var s in e)s in t?e[s]!==n[s]&&(a=!0):(a=!0,Pe(t,s,i,r));for(var s in t)s in e||(a=!0,delete t[s]);return a}function Pe(t,e,n,i){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[i][e]}})}function De(t){return t._slotsProxy||Re(t._slotsProxy={},t.$scopedSlots),t._slotsProxy}function Re(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}function Ie(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,r=n&&n.context;t.$slots=be(e._renderChildren,r),t.$scopedSlots=n?Se(t.$parent,n.data.scopedSlots,t.$slots):i,t._c=function(e,n,i,r){return He(t,e,n,i,r,!1)},t.$createElement=function(e,n,i,r){return He(t,e,n,i,r,!0)};var a=n&&n.data;Ut(t,"$attrs",a&&a.attrs||i,null,!0),Ut(t,"$listeners",e._parentListeners||i,null,!0)}var Oe=null;function Ne(t){ye(t.prototype),t.prototype.$nextTick=function(t){return sn(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,i=n.render,a=n._parentVnode;a&&e._isMounted&&(e.$scopedSlots=Se(e.$parent,a.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Re(e._slotsProxy,e.$scopedSlots)),e.$vnode=a;try{gt(e),Oe=e,t=i.call(e._renderProxy,e.$createElement)}catch($s){Xe($s,e,"render"),t=e._vnode}finally{Oe=null,gt()}return r(t)&&1===t.length&&(t=t[0]),t instanceof vt||(t=_t()),t.parent=a,t}}function Ue(t,e){return(t.__esModule||ft&&"Module"===t[Symbol.toStringTag])&&(t=t.default),h(t)?e.extend(t):t}function ke(t,e,n,i,r){var a=_t();return a.asyncFactory=t,a.asyncMeta={data:e,context:n,children:i,tag:r},a}function ze(t,e){if(o(t.error)&&s(t.errorComp))return t.errorComp;if(s(t.resolved))return t.resolved;var n=Oe;if(n&&s(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),o(t.loading)&&s(t.loadingComp))return t.loadingComp;if(n&&!s(t.owners)){var i=t.owners=[n],r=!0,l=null,c=null;n.$on("hook:destroyed",(function(){return b(i,n)}));var u=function(t){for(var e=0,n=i.length;e<n;e++)i[e].$forceUpdate();t&&(i.length=0,null!==l&&(clearTimeout(l),l=null),null!==c&&(clearTimeout(c),c=null))},d=V((function(n){t.resolved=Ue(n,e),r?i.length=0:u(!0)})),p=V((function(e){s(t.errorComp)&&(t.error=!0,u(!0))})),f=t(d,p);return h(f)&&(g(f)?a(t.resolved)&&f.then(d,p):g(f.component)&&(f.component.then(d,p),s(f.error)&&(t.errorComp=Ue(f.error,e)),s(f.loading)&&(t.loadingComp=Ue(f.loading,e),0===f.delay?t.loading=!0:l=setTimeout((function(){l=null,a(t.resolved)&&a(t.error)&&(t.loading=!0,u(!1))}),f.delay||200)),s(f.timeout)&&(c=setTimeout((function(){c=null,a(t.resolved)&&p(null)}),f.timeout)))),r=!1,t.loading?t.loadingComp:t.resolved}}function Fe(t){if(r(t))for(var e=0;e<t.length;e++){var n=t[e];if(s(n)&&(s(n.componentOptions)||we(n)))return n}}var Be=1,Ve=2;function He(t,e,n,i,a,s){return(r(n)||c(n))&&(a=i,i=n,n=void 0),o(s)&&(a=Ve),Ge(t,e,n,i,a)}function Ge(t,e,n,i,a){if(s(n)&&s(n.__ob__))return _t();if(s(n)&&s(n.is)&&(e=n.is),!e)return _t();var o,l;if(r(i)&&u(i[0])&&(n=n||{},n.scopedSlots={default:i[0]},i.length=0),a===Ve?i=ie(i):a===Be&&(i=ne(i)),"string"===typeof e){var c=void 0;l=t.$vnode&&t.$vnode.ns||X.getTagNamespace(e),o=X.isReservedTag(e)?new vt(X.parsePlatformTagName(e),n,i,void 0,void 0,t):n&&n.pre||!s(c=bi(t.$options,"components",e))?new vt(e,n,i,void 0,void 0,t):ri(c,n,t,i,e)}else o=ri(e,n,t,i);return r(o)?o:s(o)?(s(l)&&We(o,l),s(n)&&je(n),o):_t()}function We(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),s(t.children))for(var i=0,r=t.children.length;i<r;i++){var l=t.children[i];s(l.tag)&&(a(l.ns)||o(n)&&"svg"!==l.tag)&&We(l,e,n)}}function je(t){h(t.style)&&hn(t.style),h(t.class)&&hn(t.class)}function Xe(t,e,n){St();try{if(e){var i=e;while(i=i.$parent){var r=i.$options.errorCaptured;if(r)for(var a=0;a<r.length;a++)try{var s=!1===r[a].call(i,t,e,n);if(s)return}catch($s){$e($s,i,"errorCaptured hook")}}}$e(t,e,n)}finally{Tt()}}function qe(t,e,n,i,r){var a;try{a=n?t.apply(e,n):t.call(e),a&&!a._isVue&&g(a)&&!a._handled&&(a.catch((function(t){return Xe(t,i,r+" (Promise/async)")})),a._handled=!0)}catch($s){Xe($s,i,r)}return a}function $e(t,e,n){if(X.errorHandler)try{return X.errorHandler.call(null,t,e,n)}catch($s){$s!==t&&Ye($s,null,"config.errorHandler")}Ye(t,e,n)}function Ye(t,e,n){if(!Q||"undefined"===typeof console)throw t;console.error(t)}var Ze,Ke=!1,Je=[],Qe=!1;function tn(){Qe=!1;var t=Je.slice(0);Je.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!==typeof Promise&&dt(Promise)){var en=Promise.resolve();Ze=function(){en.then(tn),rt&&setTimeout(U)},Ke=!0}else if(et||"undefined"===typeof MutationObserver||!dt(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Ze="undefined"!==typeof setImmediate&&dt(setImmediate)?function(){setImmediate(tn)}:function(){setTimeout(tn,0)};else{var nn=1,rn=new MutationObserver(tn),an=document.createTextNode(String(nn));rn.observe(an,{characterData:!0}),Ze=function(){nn=(nn+1)%2,an.data=String(nn)},Ke=!0}function sn(t,e){var n;if(Je.push((function(){if(t)try{t.call(e)}catch($s){Xe($s,e,"nextTick")}else n&&n(e)})),Qe||(Qe=!0,Ze()),!t&&"undefined"!==typeof Promise)return new Promise((function(t){n=t}))}function on(t){return function(e,n){if(void 0===n&&(n=mt),n)return ln(n,t,e)}}function ln(t,e,n){var i=t.$options;i[e]=pi(i[e],n)}on("beforeMount"),on("mounted"),on("beforeUpdate"),on("updated"),on("beforeDestroy"),on("destroyed"),on("activated"),on("deactivated"),on("serverPrefetch"),on("renderTracked"),on("renderTriggered"),on("errorCaptured");var cn="2.7.10";var un=new pt;function hn(t){return dn(t,un),un.clear(),t}function dn(t,e){var n,i,a=r(t);if(!(!a&&!h(t)||Object.isFrozen(t)||t instanceof vt)){if(t.__ob__){var s=t.__ob__.dep.id;if(e.has(s))return;e.add(s)}if(a){n=t.length;while(n--)dn(t[n],e)}else if(Gt(t))dn(t.value,e);else{i=Object.keys(t),n=i.length;while(n--)dn(t[i[n]],e)}}}var pn,fn=0,mn=function(){function t(t,e,n,i,r){$t(this,Xt&&!Xt._vm?Xt:t?t._scope:void 0),(this.vm=t)&&r&&(t._watcher=this),i?(this.deep=!!i.deep,this.user=!!i.user,this.lazy=!!i.lazy,this.sync=!!i.sync,this.before=i.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++fn,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new pt,this.newDepIds=new pt,this.expression="",u(e)?this.getter=e:(this.getter=K(e),this.getter||(this.getter=U)),this.value=this.lazy?void 0:this.get()}return t.prototype.get=function(){var t;St(this);var e=this.vm;try{t=this.getter.call(e,e)}catch($s){if(!this.user)throw $s;Xe($s,e,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&hn(t),Tt(),this.cleanupDeps()}return t},t.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},t.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},t.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():qn(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||h(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');qe(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&b(this.vm._scope.effects,this),this.active){var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();function gn(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&yn(t,e)}function vn(t,e){pn.$on(t,e)}function _n(t,e){pn.$off(t,e)}function xn(t,e){var n=pn;return function i(){var r=e.apply(null,arguments);null!==r&&n.$off(t,i)}}function yn(t,e,n){pn=t,Jt(e,n||{},vn,_n,xn,t),pn=void 0}function bn(t){var e=/^hook:/;t.prototype.$on=function(t,n){var i=this;if(r(t))for(var a=0,s=t.length;a<s;a++)i.$on(t[a],n);else(i._events[t]||(i._events[t]=[])).push(n),e.test(t)&&(i._hasHookEvent=!0);return i},t.prototype.$once=function(t,e){var n=this;function i(){n.$off(t,i),e.apply(n,arguments)}return i.fn=e,n.$on(t,i),n},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(r(t)){for(var i=0,a=t.length;i<a;i++)n.$off(t[i],e);return n}var s,o=n._events[t];if(!o)return n;if(!e)return n._events[t]=null,n;var l=o.length;while(l--)if(s=o[l],s===e||s.fn===e){o.splice(l,1);break}return n},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?I(n):n;for(var i=I(arguments,1),r='event handler for "'.concat(t,'"'),a=0,s=n.length;a<s;a++)qe(n[a],e,i,e,r)}return e}}var Mn=null;function wn(t){var e=Mn;return Mn=t,function(){Mn=e}}function Sn(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){while(n.$options.abstract&&n.$parent)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function Tn(t){t.prototype._update=function(t,e){var n=this,i=n.$el,r=n._vnode,a=wn(n);n._vnode=t,n.$el=r?n.__patch__(r,t):n.__patch__(n.$el,t,e,!1),a(),i&&(i.__vue__=null),n.$el&&(n.$el.__vue__=n);var s=n;while(s&&s.$vnode&&s.$parent&&s.$vnode===s.$parent._vnode)s.$parent.$el=s.$el,s=s.$parent},t.prototype.$forceUpdate=function(){var t=this;t._watcher&&t._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){Dn(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||b(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),Dn(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}function En(t,e,n){var i;t.$el=e,t.$options.render||(t.$options.render=_t),Dn(t,"beforeMount"),i=function(){t._update(t._render(),n)};var r={before:function(){t._isMounted&&!t._isDestroyed&&Dn(t,"beforeUpdate")}};new mn(t,i,U,r,!0),n=!1;var a=t._preWatchers;if(a)for(var s=0;s<a.length;s++)a[s].run();return null==t.$vnode&&(t._isMounted=!0,Dn(t,"mounted")),t}function An(t,e,n,r,a){var s=r.data.scopedSlots,o=t.$scopedSlots,l=!!(s&&!s.$stable||o!==i&&!o.$stable||s&&t.$scopedSlots.$key!==s.$key||!s&&t.$scopedSlots.$key),c=!!(a||t.$options._renderChildren||l),u=t.$vnode;t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=a;var h=r.data.attrs||i;t._attrsProxy&&Le(t._attrsProxy,h,u.data&&u.data.attrs||i,t,"$attrs")&&(c=!0),t.$attrs=h,n=n||i;var d=t.$options._parentListeners;if(t._listenersProxy&&Le(t._listenersProxy,n,d||i,t,"$listeners"),t.$listeners=t.$options._parentListeners=n,yn(t,n,d),e&&t.$options.props){Rt(!1);for(var p=t._props,f=t.$options._propKeys||[],m=0;m<f.length;m++){var g=f[m],v=t.$options.props;p[g]=Mi(g,v,e,t)}Rt(!0),t.$options.propsData=e}c&&(t.$slots=be(a,r.context),t.$forceUpdate())}function Cn(t){while(t&&(t=t.$parent))if(t._inactive)return!0;return!1}function Ln(t,e){if(e){if(t._directInactive=!1,Cn(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)Ln(t.$children[n]);Dn(t,"activated")}}function Pn(t,e){if((!e||(t._directInactive=!0,!Cn(t)))&&!t._inactive){t._inactive=!0;for(var n=0;n<t.$children.length;n++)Pn(t.$children[n]);Dn(t,"deactivated")}}function Dn(t,e,n,i){void 0===i&&(i=!0),St();var r=mt;i&&gt(t);var a=t.$options[e],s="".concat(e," hook");if(a)for(var o=0,l=a.length;o<l;o++)qe(a[o],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),i&&gt(r),Tt()}var Rn=[],In=[],On={},Nn=!1,Un=!1,kn=0;function zn(){kn=Rn.length=In.length=0,On={},Nn=Un=!1}var Fn=0,Bn=Date.now;if(Q&&!et){var Vn=window.performance;Vn&&"function"===typeof Vn.now&&Bn()>document.createEvent("Event").timeStamp&&(Bn=function(){return Vn.now()})}var Hn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Gn(){var t,e;for(Fn=Bn(),Un=!0,Rn.sort(Hn),kn=0;kn<Rn.length;kn++)t=Rn[kn],t.before&&t.before(),e=t.id,On[e]=null,t.run();var n=In.slice(),i=Rn.slice();zn(),Xn(n),Wn(i),ht&&X.devtools&&ht.emit("flush")}function Wn(t){var e=t.length;while(e--){var n=t[e],i=n.vm;i&&i._watcher===n&&i._isMounted&&!i._isDestroyed&&Dn(i,"updated")}}function jn(t){t._inactive=!1,In.push(t)}function Xn(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Ln(t[e],!0)}function qn(t){var e=t.id;if(null==On[e]&&(t!==Mt.target||!t.noRecurse)){if(On[e]=!0,Un){var n=Rn.length-1;while(n>kn&&Rn[n].id>t.id)n--;Rn.splice(n+1,0,t)}else Rn.push(t);Nn||(Nn=!0,sn(Gn))}}function $n(t){var e=t.$options.provide;if(e){var n=u(e)?e.call(t):e;if(!h(n))return;for(var i=Yt(t),r=ft?Reflect.ownKeys(n):Object.keys(n),a=0;a<r.length;a++){var s=r[a];Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(n,s))}}}function Yn(t){var e=Zn(t.$options.inject,t);e&&(Rt(!1),Object.keys(e).forEach((function(n){Ut(t,n,e[n])})),Rt(!0))}function Zn(t,e){if(t){for(var n=Object.create(null),i=ft?Reflect.ownKeys(t):Object.keys(t),r=0;r<i.length;r++){var a=i[r];if("__ob__"!==a){var s=t[a].from;if(s in e._provided)n[a]=e._provided[s];else if("default"in t[a]){var o=t[a].default;n[a]=u(o)?o.call(e):o}else 0}}return n}}function Kn(t,e,n,a,s){var l,c=this,u=s.options;w(a,"_uid")?(l=Object.create(a),l._original=a):(l=a,a=a._original);var h=o(u._compiled),d=!h;this.data=t,this.props=e,this.children=n,this.parent=a,this.listeners=t.on||i,this.injections=Zn(u.inject,a),this.slots=function(){return c.$slots||Se(a,t.scopedSlots,c.$slots=be(n,a)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return Se(a,t.scopedSlots,this.slots())}}),h&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=Se(a,t.scopedSlots,this.$slots)),u._scopeId?this._c=function(t,e,n,i){var s=He(l,t,e,n,i,d);return s&&!r(s)&&(s.fnScopeId=u._scopeId,s.fnContext=a),s}:this._c=function(t,e,n,i){return He(l,t,e,n,i,d)}}function Jn(t,e,n,a,o){var l=t.options,c={},u=l.props;if(s(u))for(var h in u)c[h]=Mi(h,u,e||i);else s(n.attrs)&&ti(c,n.attrs),s(n.props)&&ti(c,n.props);var d=new Kn(n,c,o,a,t),p=l.render.call(null,d._c,d);if(p instanceof vt)return Qn(p,n,d.parent,l,d);if(r(p)){for(var f=ie(p)||[],m=new Array(f.length),g=0;g<f.length;g++)m[g]=Qn(f[g],n,d.parent,l,d);return m}}function Qn(t,e,n,i,r){var a=yt(t);return a.fnContext=n,a.fnOptions=i,e.slot&&((a.data||(a.data={})).slot=e.slot),a}function ti(t,e){for(var n in e)t[E(n)]=e[n]}function ei(t){return t.name||t.__name||t._componentTag}ye(Kn.prototype);var ni={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;ni.prepatch(n,n)}else{var i=t.componentInstance=ai(t,Mn);i.$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var n=e.componentOptions,i=e.componentInstance=t.componentInstance;An(i,n.propsData,n.listeners,e,n.children)},insert:function(t){var e=t.context,n=t.componentInstance;n._isMounted||(n._isMounted=!0,Dn(n,"mounted")),t.data.keepAlive&&(e._isMounted?jn(n):Ln(n,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?Pn(e,!0):e.$destroy())}},ii=Object.keys(ni);function ri(t,e,n,i,r){if(!a(t)){var l=n.$options._base;if(h(t)&&(t=l.extend(t)),"function"===typeof t){var c;if(a(t.cid)&&(c=t,t=ze(c,l),void 0===t))return ke(c,e,n,i,r);e=e||{},Xi(t),s(e.model)&&li(t.options,e);var u=te(e,t,r);if(o(t.options.functional))return Jn(t,u,e,n,i);var d=e.on;if(e.on=e.nativeOn,o(t.options.abstract)){var p=e.slot;e={},p&&(e.slot=p)}si(e);var f=ei(t.options)||r,m=new vt("vue-component-".concat(t.cid).concat(f?"-".concat(f):""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:u,listeners:d,tag:r,children:i},c);return m}}}function ai(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},i=t.data.inlineTemplate;return s(i)&&(n.render=i.render,n.staticRenderFns=i.staticRenderFns),new t.componentOptions.Ctor(n)}function si(t){for(var e=t.hook||(t.hook={}),n=0;n<ii.length;n++){var i=ii[n],r=e[i],a=ni[i];r===a||r&&r._merged||(e[i]=r?oi(a,r):a)}}function oi(t,e){var n=function(n,i){t(n,i),e(n,i)};return n._merged=!0,n}function li(t,e){var n=t.model&&t.model.prop||"value",i=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var a=e.on||(e.on={}),o=a[i],l=e.model.callback;s(o)?(r(o)?-1===o.indexOf(l):o!==l)&&(a[i]=[l].concat(o)):a[i]=l}var ci=U,ui=X.optionMergeStrategies;function hi(t,e){if(!e)return t;for(var n,i,r,a=ft?Reflect.ownKeys(e):Object.keys(e),s=0;s<a.length;s++)n=a[s],"__ob__"!==n&&(i=t[n],r=e[n],w(t,n)?i!==r&&p(i)&&p(r)&&hi(i,r):kt(t,n,r));return t}function di(t,e,n){return n?function(){var i=u(e)?e.call(n,n):e,r=u(t)?t.call(n,n):t;return i?hi(i,r):r}:e?t?function(){return hi(u(e)?e.call(this,this):e,u(t)?t.call(this,this):t)}:e:t}function pi(t,e){var n=e?t?t.concat(e):r(e)?e:[e]:t;return n?fi(n):n}function fi(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}function mi(t,e,n,i){var r=Object.create(t||null);return e?O(r,e):r}ui.data=function(t,e,n){return n?di(t,e,n):e&&"function"!==typeof e?t:di(t,e)},j.forEach((function(t){ui[t]=pi})),W.forEach((function(t){ui[t+"s"]=mi})),ui.watch=function(t,e,n,i){if(t===ot&&(t=void 0),e===ot&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var a={};for(var s in O(a,t),e){var o=a[s],l=e[s];o&&!r(o)&&(o=[o]),a[s]=o?o.concat(l):r(l)?l:[l]}return a},ui.props=ui.methods=ui.inject=ui.computed=function(t,e,n,i){if(!t)return e;var r=Object.create(null);return O(r,t),e&&O(r,e),r},ui.provide=di;var gi=function(t,e){return void 0===e?t:e};function vi(t,e){var n=t.props;if(n){var i,a,s,o={};if(r(n)){i=n.length;while(i--)a=n[i],"string"===typeof a&&(s=E(a),o[s]={type:null})}else if(p(n))for(var l in n)a=n[l],s=E(l),o[s]=p(a)?a:{type:a};else 0;t.props=o}}function _i(t,e){var n=t.inject;if(n){var i=t.inject={};if(r(n))for(var a=0;a<n.length;a++)i[n[a]]={from:n[a]};else if(p(n))for(var s in n){var o=n[s];i[s]=p(o)?O({from:s},o):{from:o}}else 0}}function xi(t){var e=t.directives;if(e)for(var n in e){var i=e[n];u(i)&&(e[n]={bind:i,update:i})}}function yi(t,e,n){if(u(e)&&(e=e.options),vi(e,n),_i(e,n),xi(e),!e._base&&(e.extends&&(t=yi(t,e.extends,n)),e.mixins))for(var i=0,r=e.mixins.length;i<r;i++)t=yi(t,e.mixins[i],n);var a,s={};for(a in t)o(a);for(a in e)w(t,a)||o(a);function o(i){var r=ui[i]||gi;s[i]=r(t[i],e[i],n,i)}return s}function bi(t,e,n,i){if("string"===typeof n){var r=t[e];if(w(r,n))return r[n];var a=E(n);if(w(r,a))return r[a];var s=A(a);if(w(r,s))return r[s];var o=r[n]||r[a]||r[s];return o}}function Mi(t,e,n,i){var r=e[t],a=!w(n,t),s=n[t],o=Ai(Boolean,r.type);if(o>-1)if(a&&!w(r,"default"))s=!1;else if(""===s||s===L(t)){var l=Ai(String,r.type);(l<0||o<l)&&(s=!0)}if(void 0===s){s=wi(i,r,t);var c=Dt;Rt(!0),Nt(s),Rt(c)}return s}function wi(t,e,n){if(w(e,"default")){var i=e.default;return t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n]?t._props[n]:u(i)&&"Function"!==Ti(e.type)?i.call(t):i}}var Si=/^\s*function (\w+)/;function Ti(t){var e=t&&t.toString().match(Si);return e?e[1]:""}function Ei(t,e){return Ti(t)===Ti(e)}function Ai(t,e){if(!r(e))return Ei(e,t)?0:-1;for(var n=0,i=e.length;n<i;n++)if(Ei(e[n],t))return n;return-1}var Ci={enumerable:!0,configurable:!0,get:U,set:U};function Li(t,e,n){Ci.get=function(){return this[e][n]},Ci.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Ci)}function Pi(t){var e=t.$options;if(e.props&&Di(t,e.props),Ae(t),e.methods&&Fi(t,e.methods),e.data)Ri(t);else{var n=Nt(t._data={});n&&n.vmCount++}e.computed&&Ni(t,e.computed),e.watch&&e.watch!==ot&&Bi(t,e.watch)}function Di(t,e){var n=t.$options.propsData||{},i=t._props=Bt({}),r=t.$options._propKeys=[],a=!t.$parent;a||Rt(!1);var s=function(a){r.push(a);var s=Mi(a,e,n,t);Ut(i,a,s),a in t||Li(t,"_props",a)};for(var o in e)s(o);Rt(!0)}function Ri(t){var e=t.$options.data;e=t._data=u(e)?Ii(e,t):e||{},p(e)||(e={});var n=Object.keys(e),i=t.$options.props,r=(t.$options.methods,n.length);while(r--){var a=n[r];0,i&&w(i,a)||$(a)||Li(t,"_data",a)}var s=Nt(e);s&&s.vmCount++}function Ii(t,e){St();try{return t.call(e,e)}catch($s){return Xe($s,e,"data()"),{}}finally{Tt()}}var Oi={lazy:!0};function Ni(t,e){var n=t._computedWatchers=Object.create(null),i=ut();for(var r in e){var a=e[r],s=u(a)?a:a.get;0,i||(n[r]=new mn(t,s||U,U,Oi)),r in t||Ui(t,r,a)}}function Ui(t,e,n){var i=!ut();u(n)?(Ci.get=i?ki(e):zi(n),Ci.set=U):(Ci.get=n.get?i&&!1!==n.cache?ki(e):zi(n.get):U,Ci.set=n.set||U),Object.defineProperty(t,e,Ci)}function ki(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Mt.target&&e.depend(),e.value}}function zi(t){return function(){return t.call(this,this)}}function Fi(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?U:R(e[n],t)}function Bi(t,e){for(var n in e){var i=e[n];if(r(i))for(var a=0;a<i.length;a++)Vi(t,n,i[a]);else Vi(t,n,i)}}function Vi(t,e,n,i){return p(n)&&(i=n,n=n.handler),"string"===typeof n&&(n=t[n]),t.$watch(e,n,i)}function Hi(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=kt,t.prototype.$delete=zt,t.prototype.$watch=function(t,e,n){var i=this;if(p(e))return Vi(i,t,e,n);n=n||{},n.user=!0;var r=new mn(i,t,e,n);if(n.immediate){var a='callback for immediate watcher "'.concat(r.expression,'"');St(),qe(e,i,[r.value],i,a),Tt()}return function(){r.teardown()}}}var Gi=0;function Wi(t){t.prototype._init=function(t){var e=this;e._uid=Gi++,e._isVue=!0,e.__v_skip=!0,e._scope=new qt(!0),e._scope._vm=!0,t&&t._isComponent?ji(e,t):e.$options=yi(Xi(e.constructor),t||{},e),e._renderProxy=e,e._self=e,Sn(e),gn(e),Ie(e),Dn(e,"beforeCreate",void 0,!1),Yn(e),Pi(e),$n(e),Dn(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}function ji(t,e){var n=t.$options=Object.create(t.constructor.options),i=e._parentVnode;n.parent=e.parent,n._parentVnode=i;var r=i.componentOptions;n.propsData=r.propsData,n._parentListeners=r.listeners,n._renderChildren=r.children,n._componentTag=r.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}function Xi(t){var e=t.options;if(t.super){var n=Xi(t.super),i=t.superOptions;if(n!==i){t.superOptions=n;var r=qi(t);r&&O(t.extendOptions,r),e=t.options=yi(n,t.extendOptions),e.name&&(e.components[e.name]=t)}}return e}function qi(t){var e,n=t.options,i=t.sealedOptions;for(var r in n)n[r]!==i[r]&&(e||(e={}),e[r]=n[r]);return e}function $i(t){this._init(t)}function Yi(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=I(arguments,1);return n.unshift(this),u(t.install)?t.install.apply(t,n):u(t)&&t.apply(null,n),e.push(t),this}}function Zi(t){t.mixin=function(t){return this.options=yi(this.options,t),this}}function Ki(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,i=n.cid,r=t._Ctor||(t._Ctor={});if(r[i])return r[i];var a=ei(t)||ei(n.options);var s=function(t){this._init(t)};return s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.cid=e++,s.options=yi(n.options,t),s["super"]=n,s.options.props&&Ji(s),s.options.computed&&Qi(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,W.forEach((function(t){s[t]=n[t]})),a&&(s.options.components[a]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=O({},s.options),r[i]=s,s}}function Ji(t){var e=t.options.props;for(var n in e)Li(t.prototype,"_props",n)}function Qi(t){var e=t.options.computed;for(var n in e)Ui(t.prototype,n,e[n])}function tr(t){W.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&p(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&u(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function er(t){return t&&(ei(t.Ctor.options)||t.tag)}function nr(t,e){return r(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function ir(t,e){var n=t.cache,i=t.keys,r=t._vnode;for(var a in n){var s=n[a];if(s){var o=s.name;o&&!e(o)&&rr(n,a,i,r)}}}function rr(t,e,n,i){var r=t[e];!r||i&&r.tag===i.tag||r.componentInstance.$destroy(),t[e]=null,b(n,e)}Wi($i),Hi($i),bn($i),Tn($i),Ne($i);var ar=[String,RegExp,Array],sr={name:"keep-alive",abstract:!0,props:{include:ar,exclude:ar,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,i=t.vnodeToCache,r=t.keyToCache;if(i){var a=i.tag,s=i.componentInstance,o=i.componentOptions;e[r]={name:er(o),tag:a,componentInstance:s},n.push(r),this.max&&n.length>parseInt(this.max)&&rr(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)rr(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){ir(t,(function(t){return nr(e,t)}))})),this.$watch("exclude",(function(e){ir(t,(function(t){return!nr(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Fe(t),n=e&&e.componentOptions;if(n){var i=er(n),r=this,a=r.include,s=r.exclude;if(a&&(!i||!nr(a,i))||s&&i&&nr(s,i))return e;var o=this,l=o.cache,c=o.keys,u=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;l[u]?(e.componentInstance=l[u].componentInstance,b(c,u),c.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||t&&t[0]}},or={KeepAlive:sr};function lr(t){var e={get:function(){return X}};Object.defineProperty(t,"config",e),t.util={warn:ci,extend:O,mergeOptions:yi,defineReactive:Ut},t.set=kt,t.delete=zt,t.nextTick=sn,t.observable=function(t){return Nt(t),t},t.options=Object.create(null),W.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,O(t.options.components,or),Yi(t),Zi(t),Ki(t),tr(t)}lr($i),Object.defineProperty($i.prototype,"$isServer",{get:ut}),Object.defineProperty($i.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty($i,"FunctionalRenderContext",{value:Kn}),$i.version=cn;var cr=x("style,class"),ur=x("input,textarea,option,select,progress"),hr=function(t,e,n){return"value"===n&&ur(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},dr=x("contenteditable,draggable,spellcheck"),pr=x("events,caret,typing,plaintext-only"),fr=function(t,e){return xr(e)||"false"===e?"false":"contenteditable"===t&&pr(e)?e:"true"},mr=x("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),gr="http://www.w3.org/1999/xlink",vr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},_r=function(t){return vr(t)?t.slice(6,t.length):""},xr=function(t){return null==t||!1===t};function yr(t){var e=t.data,n=t,i=t;while(s(i.componentInstance))i=i.componentInstance._vnode,i&&i.data&&(e=br(i.data,e));while(s(n=n.parent))n&&n.data&&(e=br(e,n.data));return Mr(e.staticClass,e.class)}function br(t,e){return{staticClass:wr(t.staticClass,e.staticClass),class:s(t.class)?[t.class,e.class]:e.class}}function Mr(t,e){return s(t)||s(e)?wr(t,Sr(e)):""}function wr(t,e){return t?e?t+" "+e:t:e||""}function Sr(t){return Array.isArray(t)?Tr(t):h(t)?Er(t):"string"===typeof t?t:""}function Tr(t){for(var e,n="",i=0,r=t.length;i<r;i++)s(e=Sr(t[i]))&&""!==e&&(n&&(n+=" "),n+=e);return n}function Er(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}var Ar={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Cr=x("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Lr=x("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Pr=function(t){return Cr(t)||Lr(t)};function Dr(t){return Lr(t)?"svg":"math"===t?"math":void 0}var Rr=Object.create(null);function Ir(t){if(!Q)return!0;if(Pr(t))return!1;if(t=t.toLowerCase(),null!=Rr[t])return Rr[t];var e=document.createElement(t);return t.indexOf("-")>-1?Rr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Rr[t]=/HTMLUnknownElement/.test(e.toString())}var Or=x("text,number,password,search,email,tel,url");function Nr(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function Ur(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function kr(t,e){return document.createElementNS(Ar[t],e)}function zr(t){return document.createTextNode(t)}function Fr(t){return document.createComment(t)}function Br(t,e,n){t.insertBefore(e,n)}function Vr(t,e){t.removeChild(e)}function Hr(t,e){t.appendChild(e)}function Gr(t){return t.parentNode}function Wr(t){return t.nextSibling}function jr(t){return t.tagName}function Xr(t,e){t.textContent=e}function qr(t,e){t.setAttribute(e,"")}var $r=Object.freeze({__proto__:null,createElement:Ur,createElementNS:kr,createTextNode:zr,createComment:Fr,insertBefore:Br,removeChild:Vr,appendChild:Hr,parentNode:Gr,nextSibling:Wr,tagName:jr,setTextContent:Xr,setStyleScope:qr}),Yr={create:function(t,e){Zr(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Zr(t,!0),Zr(e))},destroy:function(t){Zr(t,!0)}};function Zr(t,e){var n=t.data.ref;if(s(n)){var i=t.context,a=t.componentInstance||t.elm,o=e?null:a,l=e?void 0:a;if(u(n))qe(n,i,[o],i,"template ref function");else{var c=t.data.refInFor,h="string"===typeof n||"number"===typeof n,d=Gt(n),p=i.$refs;if(h||d)if(c){var f=h?p[n]:n.value;e?r(f)&&b(f,a):r(f)?f.includes(a)||f.push(a):h?(p[n]=[a],Kr(i,n,p[n])):n.value=[a]}else if(h){if(e&&p[n]!==a)return;p[n]=l,Kr(i,n,o)}else if(d){if(e&&n.value!==a)return;n.value=o}else 0}}}function Kr(t,e,n){var i=t._setupState;i&&w(i,e)&&(Gt(i[e])?i[e].value=n:i[e]=n)}var Jr=new vt("",{},[]),Qr=["create","activate","update","remove","destroy"];function ta(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&s(t.data)===s(e.data)&&ea(t,e)||o(t.isAsyncPlaceholder)&&a(e.asyncFactory.error))}function ea(t,e){if("input"!==t.tag)return!0;var n,i=s(n=t.data)&&s(n=n.attrs)&&n.type,r=s(n=e.data)&&s(n=n.attrs)&&n.type;return i===r||Or(i)&&Or(r)}function na(t,e,n){var i,r,a={};for(i=e;i<=n;++i)r=t[i].key,s(r)&&(a[r]=i);return a}function ia(t){var e,n,i={},l=t.modules,u=t.nodeOps;for(e=0;e<Qr.length;++e)for(i[Qr[e]]=[],n=0;n<l.length;++n)s(l[n][Qr[e]])&&i[Qr[e]].push(l[n][Qr[e]]);function h(t){return new vt(u.tagName(t).toLowerCase(),{},[],void 0,t)}function d(t,e){function n(){0===--n.listeners&&p(t)}return n.listeners=e,n}function p(t){var e=u.parentNode(t);s(e)&&u.removeChild(e,t)}function f(t,e,n,i,r,a,l){if(s(t.elm)&&s(a)&&(t=a[l]=yt(t)),t.isRootInsert=!r,!m(t,e,n,i)){var c=t.data,h=t.children,d=t.tag;s(d)?(t.elm=t.ns?u.createElementNS(t.ns,d):u.createElement(d,t),w(t),y(t,h,e),s(c)&&M(t,e),_(n,t.elm,i)):o(t.isComment)?(t.elm=u.createComment(t.text),_(n,t.elm,i)):(t.elm=u.createTextNode(t.text),_(n,t.elm,i))}}function m(t,e,n,i){var r=t.data;if(s(r)){var a=s(t.componentInstance)&&r.keepAlive;if(s(r=r.hook)&&s(r=r.init)&&r(t,!1),s(t.componentInstance))return g(t,e),_(n,t.elm,i),o(a)&&v(t,e,n,i),!0}}function g(t,e){s(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,b(t)?(M(t,e),w(t)):(Zr(t),e.push(t))}function v(t,e,n,r){var a,o=t;while(o.componentInstance)if(o=o.componentInstance._vnode,s(a=o.data)&&s(a=a.transition)){for(a=0;a<i.activate.length;++a)i.activate[a](Jr,o);e.push(o);break}_(n,t.elm,r)}function _(t,e,n){s(t)&&(s(n)?u.parentNode(n)===t&&u.insertBefore(t,e,n):u.appendChild(t,e))}function y(t,e,n){if(r(e)){0;for(var i=0;i<e.length;++i)f(e[i],n,t.elm,null,!0,e,i)}else c(t.text)&&u.appendChild(t.elm,u.createTextNode(String(t.text)))}function b(t){while(t.componentInstance)t=t.componentInstance._vnode;return s(t.tag)}function M(t,n){for(var r=0;r<i.create.length;++r)i.create[r](Jr,t);e=t.data.hook,s(e)&&(s(e.create)&&e.create(Jr,t),s(e.insert)&&n.push(t))}function w(t){var e;if(s(e=t.fnScopeId))u.setStyleScope(t.elm,e);else{var n=t;while(n)s(e=n.context)&&s(e=e.$options._scopeId)&&u.setStyleScope(t.elm,e),n=n.parent}s(e=Mn)&&e!==t.context&&e!==t.fnContext&&s(e=e.$options._scopeId)&&u.setStyleScope(t.elm,e)}function S(t,e,n,i,r,a){for(;i<=r;++i)f(n[i],a,t,e,!1,n,i)}function T(t){var e,n,r=t.data;if(s(r))for(s(e=r.hook)&&s(e=e.destroy)&&e(t),e=0;e<i.destroy.length;++e)i.destroy[e](t);if(s(e=t.children))for(n=0;n<t.children.length;++n)T(t.children[n])}function E(t,e,n){for(;e<=n;++e){var i=t[e];s(i)&&(s(i.tag)?(A(i),T(i)):p(i.elm))}}function A(t,e){if(s(e)||s(t.data)){var n,r=i.remove.length+1;for(s(e)?e.listeners+=r:e=d(t.elm,r),s(n=t.componentInstance)&&s(n=n._vnode)&&s(n.data)&&A(n,e),n=0;n<i.remove.length;++n)i.remove[n](t,e);s(n=t.data.hook)&&s(n=n.remove)?n(t,e):e()}else p(t.elm)}function C(t,e,n,i,r){var o,l,c,h,d=0,p=0,m=e.length-1,g=e[0],v=e[m],_=n.length-1,x=n[0],y=n[_],b=!r;while(d<=m&&p<=_)a(g)?g=e[++d]:a(v)?v=e[--m]:ta(g,x)?(P(g,x,i,n,p),g=e[++d],x=n[++p]):ta(v,y)?(P(v,y,i,n,_),v=e[--m],y=n[--_]):ta(g,y)?(P(g,y,i,n,_),b&&u.insertBefore(t,g.elm,u.nextSibling(v.elm)),g=e[++d],y=n[--_]):ta(v,x)?(P(v,x,i,n,p),b&&u.insertBefore(t,v.elm,g.elm),v=e[--m],x=n[++p]):(a(o)&&(o=na(e,d,m)),l=s(x.key)?o[x.key]:L(x,e,d,m),a(l)?f(x,i,t,g.elm,!1,n,p):(c=e[l],ta(c,x)?(P(c,x,i,n,p),e[l]=void 0,b&&u.insertBefore(t,c.elm,g.elm)):f(x,i,t,g.elm,!1,n,p)),x=n[++p]);d>m?(h=a(n[_+1])?null:n[_+1].elm,S(t,h,n,p,_,i)):p>_&&E(e,d,m)}function L(t,e,n,i){for(var r=n;r<i;r++){var a=e[r];if(s(a)&&ta(t,a))return r}}function P(t,e,n,r,l,c){if(t!==e){s(e.elm)&&s(r)&&(e=r[l]=yt(e));var h=e.elm=t.elm;if(o(t.isAsyncPlaceholder))s(e.asyncFactory.resolved)?I(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(o(e.isStatic)&&o(t.isStatic)&&e.key===t.key&&(o(e.isCloned)||o(e.isOnce)))e.componentInstance=t.componentInstance;else{var d,p=e.data;s(p)&&s(d=p.hook)&&s(d=d.prepatch)&&d(t,e);var f=t.children,m=e.children;if(s(p)&&b(e)){for(d=0;d<i.update.length;++d)i.update[d](t,e);s(d=p.hook)&&s(d=d.update)&&d(t,e)}a(e.text)?s(f)&&s(m)?f!==m&&C(h,f,m,n,c):s(m)?(s(t.text)&&u.setTextContent(h,""),S(h,null,m,0,m.length-1,n)):s(f)?E(f,0,f.length-1):s(t.text)&&u.setTextContent(h,""):t.text!==e.text&&u.setTextContent(h,e.text),s(p)&&s(d=p.hook)&&s(d=d.postpatch)&&d(t,e)}}}function D(t,e,n){if(o(n)&&s(t.parent))t.parent.data.pendingInsert=e;else for(var i=0;i<e.length;++i)e[i].data.hook.insert(e[i])}var R=x("attrs,class,staticClass,staticStyle,key");function I(t,e,n,i){var r,a=e.tag,l=e.data,c=e.children;if(i=i||l&&l.pre,e.elm=t,o(e.isComment)&&s(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(s(l)&&(s(r=l.hook)&&s(r=r.init)&&r(e,!0),s(r=e.componentInstance)))return g(e,n),!0;if(s(a)){if(s(c))if(t.hasChildNodes())if(s(r=l)&&s(r=r.domProps)&&s(r=r.innerHTML)){if(r!==t.innerHTML)return!1}else{for(var u=!0,h=t.firstChild,d=0;d<c.length;d++){if(!h||!I(h,c[d],n,i)){u=!1;break}h=h.nextSibling}if(!u||h)return!1}else y(e,c,n);if(s(l)){var p=!1;for(var f in l)if(!R(f)){p=!0,M(e,n);break}!p&&l["class"]&&hn(l["class"])}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,r){if(!a(e)){var l=!1,c=[];if(a(t))l=!0,f(e,c);else{var d=s(t.nodeType);if(!d&&ta(t,e))P(t,e,c,null,null,r);else{if(d){if(1===t.nodeType&&t.hasAttribute(G)&&(t.removeAttribute(G),n=!0),o(n)&&I(t,e,c))return D(e,c,!0),t;t=h(t)}var p=t.elm,m=u.parentNode(p);if(f(e,c,p._leaveCb?null:m,u.nextSibling(p)),s(e.parent)){var g=e.parent,v=b(e);while(g){for(var _=0;_<i.destroy.length;++_)i.destroy[_](g);if(g.elm=e.elm,v){for(var x=0;x<i.create.length;++x)i.create[x](Jr,g);var y=g.data.hook.insert;if(y.merged)for(var M=1;M<y.fns.length;M++)y.fns[M]()}else Zr(g);g=g.parent}}s(m)?E([t],0,0):s(t.tag)&&T(t)}}return D(e,c,l),e.elm}s(t)&&T(t)}}var ra={create:aa,update:aa,destroy:function(t){aa(t,Jr)}};function aa(t,e){(t.data.directives||e.data.directives)&&sa(t,e)}function sa(t,e){var n,i,r,a=t===Jr,s=e===Jr,o=la(t.data.directives,t.context),l=la(e.data.directives,e.context),c=[],u=[];for(n in l)i=o[n],r=l[n],i?(r.oldValue=i.value,r.oldArg=i.arg,ua(r,"update",e,t),r.def&&r.def.componentUpdated&&u.push(r)):(ua(r,"bind",e,t),r.def&&r.def.inserted&&c.push(r));if(c.length){var h=function(){for(var n=0;n<c.length;n++)ua(c[n],"inserted",e,t)};a?Qt(e,"insert",h):h()}if(u.length&&Qt(e,"postpatch",(function(){for(var n=0;n<u.length;n++)ua(u[n],"componentUpdated",e,t)})),!a)for(n in o)l[n]||ua(o[n],"unbind",t,t,s)}var oa=Object.create(null);function la(t,e){var n,i,r=Object.create(null);if(!t)return r;for(n=0;n<t.length;n++){if(i=t[n],i.modifiers||(i.modifiers=oa),r[ca(i)]=i,e._setupState&&e._setupState.__sfc){var a=i.def||bi(e,"_setupState","v-"+i.name);i.def="function"===typeof a?{bind:a,update:a}:a}i.def=i.def||bi(e.$options,"directives",i.name,!0)}return r}function ca(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function ua(t,e,n,i,r){var a=t.def&&t.def[e];if(a)try{a(n.elm,t,n,i,r)}catch($s){Xe($s,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var ha=[Yr,ra];function da(t,e){var n=e.componentOptions;if((!s(n)||!1!==n.Ctor.options.inheritAttrs)&&(!a(t.data.attrs)||!a(e.data.attrs))){var i,r,l,c=e.elm,u=t.data.attrs||{},h=e.data.attrs||{};for(i in(s(h.__ob__)||o(h._v_attr_proxy))&&(h=e.data.attrs=O({},h)),h)r=h[i],l=u[i],l!==r&&pa(c,i,r,e.data.pre);for(i in(et||it)&&h.value!==u.value&&pa(c,"value",h.value),u)a(h[i])&&(vr(i)?c.removeAttributeNS(gr,_r(i)):dr(i)||c.removeAttribute(i))}}function pa(t,e,n,i){i||t.tagName.indexOf("-")>-1?fa(t,e,n):mr(e)?xr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):dr(e)?t.setAttribute(e,fr(e,n)):vr(e)?xr(n)?t.removeAttributeNS(gr,_r(e)):t.setAttributeNS(gr,e,n):fa(t,e,n)}function fa(t,e,n){if(xr(n))t.removeAttribute(e);else{if(et&&!nt&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var i=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",i)};t.addEventListener("input",i),t.__ieph=!0}t.setAttribute(e,n)}}var ma={create:da,update:da};function ga(t,e){var n=e.elm,i=e.data,r=t.data;if(!(a(i.staticClass)&&a(i.class)&&(a(r)||a(r.staticClass)&&a(r.class)))){var o=yr(e),l=n._transitionClasses;s(l)&&(o=wr(o,Sr(l))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}var va,_a={create:ga,update:ga},xa="__r",ya="__c";function ba(t){if(s(t[xa])){var e=et?"change":"input";t[e]=[].concat(t[xa],t[e]||[]),delete t[xa]}s(t[ya])&&(t.change=[].concat(t[ya],t.change||[]),delete t[ya])}function Ma(t,e,n){var i=va;return function r(){var a=e.apply(null,arguments);null!==a&&Ta(t,r,n,i)}}var wa=Ke&&!(st&&Number(st[1])<=53);function Sa(t,e,n,i){if(wa){var r=Fn,a=e;e=a._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=r||t.timeStamp<=0||t.target.ownerDocument!==document)return a.apply(this,arguments)}}va.addEventListener(t,e,lt?{capture:n,passive:i}:n)}function Ta(t,e,n,i){(i||va).removeEventListener(t,e._wrapper||e,n)}function Ea(t,e){if(!a(t.data.on)||!a(e.data.on)){var n=e.data.on||{},i=t.data.on||{};va=e.elm||t.elm,ba(n),Jt(n,i,Sa,Ta,Ma,e.context),va=void 0}}var Aa,Ca={create:Ea,update:Ea,destroy:function(t){return Ea(t,Jr)}};function La(t,e){if(!a(t.data.domProps)||!a(e.data.domProps)){var n,i,r=e.elm,l=t.data.domProps||{},c=e.data.domProps||{};for(n in(s(c.__ob__)||o(c._v_attr_proxy))&&(c=e.data.domProps=O({},c)),l)n in c||(r[n]="");for(n in c){if(i=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),i===l[n])continue;1===r.childNodes.length&&r.removeChild(r.childNodes[0])}if("value"===n&&"PROGRESS"!==r.tagName){r._value=i;var u=a(i)?"":String(i);Pa(r,u)&&(r.value=u)}else if("innerHTML"===n&&Lr(r.tagName)&&a(r.innerHTML)){Aa=Aa||document.createElement("div"),Aa.innerHTML="<svg>".concat(i,"</svg>");var h=Aa.firstChild;while(r.firstChild)r.removeChild(r.firstChild);while(h.firstChild)r.appendChild(h.firstChild)}else if(i!==l[n])try{r[n]=i}catch($s){}}}}function Pa(t,e){return!t.composing&&("OPTION"===t.tagName||Da(t,e)||Ra(t,e))}function Da(t,e){var n=!0;try{n=document.activeElement!==t}catch($s){}return n&&t.value!==e}function Ra(t,e){var n=t.value,i=t._vModifiers;if(s(i)){if(i.number)return _(n)!==_(e);if(i.trim)return n.trim()!==e.trim()}return n!==e}var Ia={create:La,update:La},Oa=S((function(t){var e={},n=/;(?![^(]*\))/g,i=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(i);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function Na(t){var e=Ua(t.style);return t.staticStyle?O(t.staticStyle,e):e}function Ua(t){return Array.isArray(t)?N(t):"string"===typeof t?Oa(t):t}function ka(t,e){var n,i={};if(e){var r=t;while(r.componentInstance)r=r.componentInstance._vnode,r&&r.data&&(n=Na(r.data))&&O(i,n)}(n=Na(t.data))&&O(i,n);var a=t;while(a=a.parent)a.data&&(n=Na(a.data))&&O(i,n);return i}var za,Fa=/^--/,Ba=/\s*!important$/,Va=function(t,e,n){if(Fa.test(e))t.style.setProperty(e,n);else if(Ba.test(n))t.style.setProperty(L(e),n.replace(Ba,""),"important");else{var i=Ga(e);if(Array.isArray(n))for(var r=0,a=n.length;r<a;r++)t.style[i]=n[r];else t.style[i]=n}},Ha=["Webkit","Moz","ms"],Ga=S((function(t){if(za=za||document.createElement("div").style,t=E(t),"filter"!==t&&t in za)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Ha.length;n++){var i=Ha[n]+e;if(i in za)return i}}));function Wa(t,e){var n=e.data,i=t.data;if(!(a(n.staticStyle)&&a(n.style)&&a(i.staticStyle)&&a(i.style))){var r,o,l=e.elm,c=i.staticStyle,u=i.normalizedStyle||i.style||{},h=c||u,d=Ua(e.data.style)||{};e.data.normalizedStyle=s(d.__ob__)?O({},d):d;var p=ka(e,!0);for(o in h)a(p[o])&&Va(l,o,"");for(o in p)r=p[o],r!==h[o]&&Va(l,o,null==r?"":r)}}var ja={create:Wa,update:Wa},Xa=/\s+/;function qa(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Xa).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function $a(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Xa).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" ".concat(t.getAttribute("class")||""," "),i=" "+e+" ";while(n.indexOf(i)>=0)n=n.replace(i," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function Ya(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&O(e,Za(t.name||"v")),O(e,t),e}return"string"===typeof t?Za(t):void 0}}var Za=S((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),Ka=Q&&!nt,Ja="transition",Qa="animation",ts="transition",es="transitionend",ns="animation",is="animationend";Ka&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ts="WebkitTransition",es="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ns="WebkitAnimation",is="webkitAnimationEnd"));var rs=Q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function as(t){rs((function(){rs(t)}))}function ss(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),qa(t,e))}function os(t,e){t._transitionClasses&&b(t._transitionClasses,e),$a(t,e)}function ls(t,e,n){var i=us(t,e),r=i.type,a=i.timeout,s=i.propCount;if(!r)return n();var o=r===Ja?es:is,l=0,c=function(){t.removeEventListener(o,u),n()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout((function(){l<s&&c()}),a+1),t.addEventListener(o,u)}var cs=/\b(transform|all)(,|$)/;function us(t,e){var n,i=window.getComputedStyle(t),r=(i[ts+"Delay"]||"").split(", "),a=(i[ts+"Duration"]||"").split(", "),s=hs(r,a),o=(i[ns+"Delay"]||"").split(", "),l=(i[ns+"Duration"]||"").split(", "),c=hs(o,l),u=0,h=0;e===Ja?s>0&&(n=Ja,u=s,h=a.length):e===Qa?c>0&&(n=Qa,u=c,h=l.length):(u=Math.max(s,c),n=u>0?s>c?Ja:Qa:null,h=n?n===Ja?a.length:l.length:0);var d=n===Ja&&cs.test(i[ts+"Property"]);return{type:n,timeout:u,propCount:h,hasTransform:d}}function hs(t,e){while(t.length<e.length)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return ds(e)+ds(t[n])})))}function ds(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function ps(t,e){var n=t.elm;s(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var i=Ya(t.data.transition);if(!a(i)&&!s(n._enterCb)&&1===n.nodeType){var r=i.css,o=i.type,l=i.enterClass,c=i.enterToClass,d=i.enterActiveClass,p=i.appearClass,f=i.appearToClass,m=i.appearActiveClass,g=i.beforeEnter,v=i.enter,x=i.afterEnter,y=i.enterCancelled,b=i.beforeAppear,M=i.appear,w=i.afterAppear,S=i.appearCancelled,T=i.duration,E=Mn,A=Mn.$vnode;while(A&&A.parent)E=A.context,A=A.parent;var C=!E._isMounted||!t.isRootInsert;if(!C||M||""===M){var L=C&&p?p:l,P=C&&m?m:d,D=C&&f?f:c,R=C&&b||g,I=C&&u(M)?M:v,O=C&&w||x,N=C&&S||y,U=_(h(T)?T.enter:T);0;var k=!1!==r&&!nt,z=gs(I),F=n._enterCb=V((function(){k&&(os(n,D),os(n,P)),F.cancelled?(k&&os(n,L),N&&N(n)):O&&O(n),n._enterCb=null}));t.data.show||Qt(t,"insert",(function(){var e=n.parentNode,i=e&&e._pending&&e._pending[t.key];i&&i.tag===t.tag&&i.elm._leaveCb&&i.elm._leaveCb(),I&&I(n,F)})),R&&R(n),k&&(ss(n,L),ss(n,P),as((function(){os(n,L),F.cancelled||(ss(n,D),z||(ms(U)?setTimeout(F,U):ls(n,o,F)))}))),t.data.show&&(e&&e(),I&&I(n,F)),k||z||F()}}}function fs(t,e){var n=t.elm;s(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var i=Ya(t.data.transition);if(a(i)||1!==n.nodeType)return e();if(!s(n._leaveCb)){var r=i.css,o=i.type,l=i.leaveClass,c=i.leaveToClass,u=i.leaveActiveClass,d=i.beforeLeave,p=i.leave,f=i.afterLeave,m=i.leaveCancelled,g=i.delayLeave,v=i.duration,x=!1!==r&&!nt,y=gs(p),b=_(h(v)?v.leave:v);0;var M=n._leaveCb=V((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),x&&(os(n,c),os(n,u)),M.cancelled?(x&&os(n,l),m&&m(n)):(e(),f&&f(n)),n._leaveCb=null}));g?g(w):w()}function w(){M.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),d&&d(n),x&&(ss(n,l),ss(n,u),as((function(){os(n,l),M.cancelled||(ss(n,c),y||(ms(b)?setTimeout(M,b):ls(n,o,M)))}))),p&&p(n,M),x||y||M())}}function ms(t){return"number"===typeof t&&!isNaN(t)}function gs(t){if(a(t))return!1;var e=t.fns;return s(e)?gs(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function vs(t,e){!0!==e.data.show&&ps(e)}var _s=Q?{create:vs,activate:vs,remove:function(t,e){!0!==t.data.show?fs(t,e):e()}}:{},xs=[ma,_a,Ca,Ia,ja,_s],ys=xs.concat(ha),bs=ia({nodeOps:$r,modules:ys});nt&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&Ls(t,"input")}));var Ms={inserted:function(t,e,n,i){"select"===n.tag?(i.elm&&!i.elm._vOptions?Qt(n,"postpatch",(function(){Ms.componentUpdated(t,e,n)})):ws(t,e,n.context),t._vOptions=[].map.call(t.options,Es)):("textarea"===n.tag||Or(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",As),t.addEventListener("compositionend",Cs),t.addEventListener("change",Cs),nt&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){ws(t,e,n.context);var i=t._vOptions,r=t._vOptions=[].map.call(t.options,Es);if(r.some((function(t,e){return!F(t,i[e])}))){var a=t.multiple?e.value.some((function(t){return Ts(t,r)})):e.value!==e.oldValue&&Ts(e.value,r);a&&Ls(t,"change")}}}};function ws(t,e,n){Ss(t,e,n),(et||it)&&setTimeout((function(){Ss(t,e,n)}),0)}function Ss(t,e,n){var i=e.value,r=t.multiple;if(!r||Array.isArray(i)){for(var a,s,o=0,l=t.options.length;o<l;o++)if(s=t.options[o],r)a=B(i,Es(s))>-1,s.selected!==a&&(s.selected=a);else if(F(Es(s),i))return void(t.selectedIndex!==o&&(t.selectedIndex=o));r||(t.selectedIndex=-1)}}function Ts(t,e){return e.every((function(e){return!F(e,t)}))}function Es(t){return"_value"in t?t._value:t.value}function As(t){t.target.composing=!0}function Cs(t){t.target.composing&&(t.target.composing=!1,Ls(t.target,"input"))}function Ls(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ps(t){return!t.componentInstance||t.data&&t.data.transition?t:Ps(t.componentInstance._vnode)}var Ds={bind:function(t,e,n){var i=e.value;n=Ps(n);var r=n.data&&n.data.transition,a=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;i&&r?(n.data.show=!0,ps(n,(function(){t.style.display=a}))):t.style.display=i?a:"none"},update:function(t,e,n){var i=e.value,r=e.oldValue;if(!i!==!r){n=Ps(n);var a=n.data&&n.data.transition;a?(n.data.show=!0,i?ps(n,(function(){t.style.display=t.__vOriginalDisplay})):fs(n,(function(){t.style.display="none"}))):t.style.display=i?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,i,r){r||(t.style.display=t.__vOriginalDisplay)}},Rs={model:Ms,show:Ds},Is={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Os(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Os(Fe(e.children)):t}function Ns(t){var e={},n=t.$options;for(var i in n.propsData)e[i]=t[i];var r=n._parentListeners;for(var i in r)e[E(i)]=r[i];return e}function Us(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function ks(t){while(t=t.parent)if(t.data.transition)return!0}function zs(t,e){return e.key===t.key&&e.tag===t.tag}var Fs=function(t){return t.tag||we(t)},Bs=function(t){return"show"===t.name},Vs={name:"transition",props:Is,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Fs),n.length)){0;var i=this.mode;0;var r=n[0];if(ks(this.$vnode))return r;var a=Os(r);if(!a)return r;if(this._leaving)return Us(t,r);var s="__transition-".concat(this._uid,"-");a.key=null==a.key?a.isComment?s+"comment":s+a.tag:c(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var o=(a.data||(a.data={})).transition=Ns(this),l=this._vnode,u=Os(l);if(a.data.directives&&a.data.directives.some(Bs)&&(a.data.show=!0),u&&u.data&&!zs(a,u)&&!we(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var h=u.data.transition=O({},o);if("out-in"===i)return this._leaving=!0,Qt(h,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Us(t,r);if("in-out"===i){if(we(a))return l;var d,p=function(){d()};Qt(o,"afterEnter",p),Qt(o,"enterCancelled",p),Qt(h,"delayLeave",(function(t){d=t}))}}return r}}},Hs=O({tag:String,moveClass:String},Is);delete Hs.mode;var Gs={props:Hs,beforeMount:function(){var t=this,e=this._update;this._update=function(n,i){var r=wn(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,r(),e.call(t,n,i)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),i=this.prevChildren=this.children,r=this.$slots.default||[],a=this.children=[],s=Ns(this),o=0;o<r.length;o++){var l=r[o];if(l.tag)if(null!=l.key&&0!==String(l.key).indexOf("__vlist"))a.push(l),n[l.key]=l,(l.data||(l.data={})).transition=s;else;}if(i){var c=[],u=[];for(o=0;o<i.length;o++){l=i[o];l.data.transition=s,l.data.pos=l.elm.getBoundingClientRect(),n[l.key]?c.push(l):u.push(l)}this.kept=t(e,null,c),this.removed=u}return t(e,null,a)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Ws),t.forEach(js),t.forEach(Xs),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,i=n.style;ss(n,e),i.transform=i.WebkitTransform=i.transitionDuration="",n.addEventListener(es,n._moveCb=function t(i){i&&i.target!==n||i&&!/transform$/.test(i.propertyName)||(n.removeEventListener(es,t),n._moveCb=null,os(n,e))})}})))},methods:{hasMove:function(t,e){if(!Ka)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){$a(n,t)})),qa(n,e),n.style.display="none",this.$el.appendChild(n);var i=us(n);return this.$el.removeChild(n),this._hasMove=i.hasTransform}}};function Ws(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function js(t){t.data.newPos=t.elm.getBoundingClientRect()}function Xs(t){var e=t.data.pos,n=t.data.newPos,i=e.left-n.left,r=e.top-n.top;if(i||r){t.data.moved=!0;var a=t.elm.style;a.transform=a.WebkitTransform="translate(".concat(i,"px,").concat(r,"px)"),a.transitionDuration="0s"}}var qs={Transition:Vs,TransitionGroup:Gs};$i.config.mustUseProp=hr,$i.config.isReservedTag=Pr,$i.config.isReservedAttr=cr,$i.config.getTagNamespace=Dr,$i.config.isUnknownElement=Ir,O($i.options.directives,Rs),O($i.options.components,qs),$i.prototype.__patch__=Q?bs:U,$i.prototype.$mount=function(t,e){return t=t&&Q?Nr(t):void 0,En(this,t,e)},Q&&setTimeout((function(){X.devtools&&ht&&ht.emit("init",$i)}),0)}).call(this,n("c8ba"))},4721:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("5a89");const r={type:"change"},a={type:"start"},s={type:"end"};class o extends i["k"]{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new i["T"],this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:i["s"].ROTATE,MIDDLE:i["s"].DOLLY,RIGHT:i["s"].PAN},this.touches={ONE:i["O"].ROTATE,TWO:i["O"].DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return u.phi},this.getAzimuthalAngle=function(){return u.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",st),this._domElementKeyEvents=t},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),l=o.NONE},this.update=function(){const e=new i["T"],a=(new i["G"]).setFromUnitVectors(t.up,new i["T"](0,1,0)),s=a.clone().invert(),m=new i["T"],g=new i["G"],v=2*Math.PI;return function(){const t=n.object.position;e.copy(t).sub(n.target),e.applyQuaternion(a),u.setFromVector3(e),n.autoRotate&&l===o.NONE&&C(E()),n.enableDamping?(u.theta+=h.theta*n.dampingFactor,u.phi+=h.phi*n.dampingFactor):(u.theta+=h.theta,u.phi+=h.phi);let i=n.minAzimuthAngle,_=n.maxAzimuthAngle;return isFinite(i)&&isFinite(_)&&(i<-Math.PI?i+=v:i>Math.PI&&(i-=v),_<-Math.PI?_+=v:_>Math.PI&&(_-=v),u.theta=i<=_?Math.max(i,Math.min(_,u.theta)):u.theta>(i+_)/2?Math.max(i,u.theta):Math.min(_,u.theta)),u.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,u.phi)),u.makeSafe(),u.radius*=d,u.radius=Math.max(n.minDistance,Math.min(n.maxDistance,u.radius)),!0===n.enableDamping?n.target.addScaledVector(p,n.dampingFactor):n.target.add(p),e.setFromSpherical(u),e.applyQuaternion(s),t.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,p.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),p.set(0,0,0)),d=1,!!(f||m.distanceToSquared(n.object.position)>c||8*(1-g.dot(n.object.quaternion))>c)&&(n.dispatchEvent(r),m.copy(n.object.position),g.copy(n.object.quaternion),f=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",ct),n.domElement.removeEventListener("pointerdown",Q),n.domElement.removeEventListener("pointercancel",nt),n.domElement.removeEventListener("wheel",at),n.domElement.removeEventListener("pointermove",tt),n.domElement.removeEventListener("pointerup",et),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",st)};const n=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=o.NONE;const c=1e-6,u=new i["M"],h=new i["M"];let d=1;const p=new i["T"];let f=!1;const m=new i["S"],g=new i["S"],v=new i["S"],_=new i["S"],x=new i["S"],y=new i["S"],b=new i["S"],M=new i["S"],w=new i["S"],S=[],T={};function E(){return 2*Math.PI/60/60*n.autoRotateSpeed}function A(){return Math.pow(.95,n.zoomSpeed)}function C(t){h.theta-=t}function L(t){h.phi-=t}const P=function(){const t=new i["T"];return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),p.add(t)}}(),D=function(){const t=new i["T"];return function(e,i){!0===n.screenSpacePanning?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),p.add(t)}}(),R=function(){const t=new i["T"];return function(e,i){const r=n.domElement;if(n.object.isPerspectiveCamera){const a=n.object.position;t.copy(a).sub(n.target);let s=t.length();s*=Math.tan(n.object.fov/2*Math.PI/180),P(2*e*s/r.clientHeight,n.object.matrix),D(2*i*s/r.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(P(e*(n.object.right-n.object.left)/n.object.zoom/r.clientWidth,n.object.matrix),D(i*(n.object.top-n.object.bottom)/n.object.zoom/r.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function I(t){n.object.isPerspectiveCamera?d/=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*t)),n.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function O(t){n.object.isPerspectiveCamera?d*=t:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/t)),n.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function N(t){m.set(t.clientX,t.clientY)}function U(t){b.set(t.clientX,t.clientY)}function k(t){_.set(t.clientX,t.clientY)}function z(t){g.set(t.clientX,t.clientY),v.subVectors(g,m).multiplyScalar(n.rotateSpeed);const e=n.domElement;C(2*Math.PI*v.x/e.clientHeight),L(2*Math.PI*v.y/e.clientHeight),m.copy(g),n.update()}function F(t){M.set(t.clientX,t.clientY),w.subVectors(M,b),w.y>0?I(A()):w.y<0&&O(A()),b.copy(M),n.update()}function B(t){x.set(t.clientX,t.clientY),y.subVectors(x,_).multiplyScalar(n.panSpeed),R(y.x,y.y),_.copy(x),n.update()}function V(t){t.deltaY<0?O(A()):t.deltaY>0&&I(A()),n.update()}function H(t){let e=!1;switch(t.code){case n.keys.UP:R(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:R(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:R(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:R(-n.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),n.update())}function G(){if(1===S.length)m.set(S[0].pageX,S[0].pageY);else{const t=.5*(S[0].pageX+S[1].pageX),e=.5*(S[0].pageY+S[1].pageY);m.set(t,e)}}function W(){if(1===S.length)_.set(S[0].pageX,S[0].pageY);else{const t=.5*(S[0].pageX+S[1].pageX),e=.5*(S[0].pageY+S[1].pageY);_.set(t,e)}}function j(){const t=S[0].pageX-S[1].pageX,e=S[0].pageY-S[1].pageY,n=Math.sqrt(t*t+e*e);b.set(0,n)}function X(){n.enableZoom&&j(),n.enablePan&&W()}function q(){n.enableZoom&&j(),n.enableRotate&&G()}function $(t){if(1==S.length)g.set(t.pageX,t.pageY);else{const e=pt(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);g.set(n,i)}v.subVectors(g,m).multiplyScalar(n.rotateSpeed);const e=n.domElement;C(2*Math.PI*v.x/e.clientHeight),L(2*Math.PI*v.y/e.clientHeight),m.copy(g)}function Y(t){if(1===S.length)x.set(t.pageX,t.pageY);else{const e=pt(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);x.set(n,i)}y.subVectors(x,_).multiplyScalar(n.panSpeed),R(y.x,y.y),_.copy(x)}function Z(t){const e=pt(t),i=t.pageX-e.x,r=t.pageY-e.y,a=Math.sqrt(i*i+r*r);M.set(0,a),w.set(0,Math.pow(M.y/b.y,n.zoomSpeed)),I(w.y),b.copy(M)}function K(t){n.enableZoom&&Z(t),n.enablePan&&Y(t)}function J(t){n.enableZoom&&Z(t),n.enableRotate&&$(t)}function Q(t){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",tt),n.domElement.addEventListener("pointerup",et)),ut(t),"touch"===t.pointerType?ot(t):it(t))}function tt(t){!1!==n.enabled&&("touch"===t.pointerType?lt(t):rt(t))}function et(t){ht(t),0===S.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",tt),n.domElement.removeEventListener("pointerup",et)),n.dispatchEvent(s),l=o.NONE}function nt(t){ht(t)}function it(t){let e;switch(t.button){case 0:e=n.mouseButtons.LEFT;break;case 1:e=n.mouseButtons.MIDDLE;break;case 2:e=n.mouseButtons.RIGHT;break;default:e=-1}switch(e){case i["s"].DOLLY:if(!1===n.enableZoom)return;U(t),l=o.DOLLY;break;case i["s"].ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;k(t),l=o.PAN}else{if(!1===n.enableRotate)return;N(t),l=o.ROTATE}break;case i["s"].PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enableRotate)return;N(t),l=o.ROTATE}else{if(!1===n.enablePan)return;k(t),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&n.dispatchEvent(a)}function rt(t){switch(l){case o.ROTATE:if(!1===n.enableRotate)return;z(t);break;case o.DOLLY:if(!1===n.enableZoom)return;F(t);break;case o.PAN:if(!1===n.enablePan)return;B(t);break}}function at(t){!1!==n.enabled&&!1!==n.enableZoom&&l===o.NONE&&(t.preventDefault(),n.dispatchEvent(a),V(t),n.dispatchEvent(s))}function st(t){!1!==n.enabled&&!1!==n.enablePan&&H(t)}function ot(t){switch(dt(t),S.length){case 1:switch(n.touches.ONE){case i["O"].ROTATE:if(!1===n.enableRotate)return;G(),l=o.TOUCH_ROTATE;break;case i["O"].PAN:if(!1===n.enablePan)return;W(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(n.touches.TWO){case i["O"].DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;X(),l=o.TOUCH_DOLLY_PAN;break;case i["O"].DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;q(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&n.dispatchEvent(a)}function lt(t){switch(dt(t),l){case o.TOUCH_ROTATE:if(!1===n.enableRotate)return;$(t),n.update();break;case o.TOUCH_PAN:if(!1===n.enablePan)return;Y(t),n.update();break;case o.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;K(t),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;J(t),n.update();break;default:l=o.NONE}}function ct(t){!1!==n.enabled&&t.preventDefault()}function ut(t){S.push(t)}function ht(t){delete T[t.pointerId];for(let e=0;e<S.length;e++)if(S[e].pointerId==t.pointerId)return void S.splice(e,1)}function dt(t){let e=T[t.pointerId];void 0===e&&(e=new i["S"],T[t.pointerId]=e),e.set(t.pageX,t.pageY)}function pt(t){const e=t.pointerId===S[0].pointerId?S[1]:S[0];return T[e.pointerId]}n.domElement.addEventListener("contextmenu",ct),n.domElement.addEventListener("pointerdown",Q),n.domElement.addEventListener("pointercancel",nt),n.domElement.addEventListener("wheel",at,{passive:!1}),this.update()}}},"5a89":function(t,e,n){"use strict";n.d(e,"a",(function(){return kh})),n.d(e,"b",(function(){return hh})),n.d(e,"c",(function(){return Ru})),n.d(e,"d",(function(){return or})),n.d(e,"e",(function(){return ot})),n.d(e,"f",(function(){return xn})),n.d(e,"g",(function(){return Wu})),n.d(e,"h",(function(){return Uh})),n.d(e,"i",(function(){return it})),n.d(e,"j",(function(){return _i})),n.d(e,"k",(function(){return Pe})),n.d(e,"l",(function(){return yh})),n.d(e,"m",(function(){return Qi})),n.d(e,"n",(function(){return mu})),n.d(e,"o",(function(){return Gu})),n.d(e,"p",(function(){return ku})),n.d(e,"q",(function(){return vh})),n.d(e,"r",(function(){return zh})),n.d(e,"s",(function(){return r})),n.d(e,"t",(function(){return rn})),n.d(e,"u",(function(){return sn})),n.d(e,"v",(function(){return li})),n.d(e,"w",(function(){return Tr})),n.d(e,"x",(function(){return Xu})),n.d(e,"y",(function(){return ju})),n.d(e,"z",(function(){return sh})),n.d(e,"A",(function(){return Ii})),n.d(e,"B",(function(){return Fo})),n.d(e,"C",(function(){return u})),n.d(e,"D",(function(){return kr})),n.d(e,"E",(function(){return Oh})),n.d(e,"F",(function(){return Zh})),n.d(e,"G",(function(){return Pn})),n.d(e,"H",(function(){return lh})),n.d(e,"I",(function(){return st})),n.d(e,"J",(function(){return Tu})),n.d(e,"K",(function(){return Uu})),n.d(e,"L",(function(){return Du})),n.d(e,"M",(function(){return Kh})),n.d(e,"N",(function(){return Lh})),n.d(e,"O",(function(){return a})),n.d(e,"P",(function(){return Tn})),n.d(e,"Q",(function(){return Mh})),n.d(e,"R",(function(){return Ki})),n.d(e,"S",(function(){return an})),n.d(e,"T",(function(){return Dn})),n.d(e,"U",(function(){return En})),n.d(e,"V",(function(){return uh})),n.d(e,"W",(function(){return wu})),n.d(e,"X",(function(){return _e}));
  8. /**
  9. * @license
  10. * Copyright 2010-2022 Three.js Authors
  11. * SPDX-License-Identifier: MIT
  12. */
  13. const i="144",r={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},a={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},s=0,o=1,l=2,c=1,u=2,h=3,d=0,p=1,f=2,m=0,g=1,v=2,_=3,x=4,y=5,b=100,M=101,w=102,S=103,T=104,E=200,A=201,C=202,L=203,P=204,D=205,R=206,I=207,O=208,N=209,U=210,k=0,z=1,F=2,B=3,V=4,H=5,G=6,W=7,j=0,X=1,q=2,$=0,Y=1,Z=2,K=3,J=4,Q=5,tt=300,et=301,nt=302,it=303,rt=304,at=306,st=1e3,ot=1001,lt=1002,ct=1003,ut=1004,ht=1005,dt=1006,pt=1007,ft=1008,mt=1009,gt=1010,vt=1011,_t=1012,xt=1013,yt=1014,bt=1015,Mt=1016,wt=1017,St=1018,Tt=1020,Et=1021,At=1022,Ct=1023,Lt=1024,Pt=1025,Dt=1026,Rt=1027,It=1028,Ot=1029,Nt=1030,Ut=1031,kt=1033,zt=33776,Ft=33777,Bt=33778,Vt=33779,Ht=35840,Gt=35841,Wt=35842,jt=35843,Xt=36196,qt=37492,$t=37496,Yt=37808,Zt=37809,Kt=37810,Jt=37811,Qt=37812,te=37813,ee=37814,ne=37815,ie=37816,re=37817,ae=37818,se=37819,oe=37820,le=37821,ce=36492,ue=2300,he=2301,de=2302,pe=2400,fe=2401,me=2402,ge=2500,ve=3e3,_e=3001,xe=3200,ye=3201,be=0,Me=1,we="srgb",Se="srgb-linear",Te=7680,Ee=519,Ae=35044,Ce="300 es",Le=1035;class Pe{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners,i=n[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners,n=e[t.type];if(void 0!==n){t.target=this;const e=n.slice(0);for(let n=0,i=e.length;n<i;n++)e[n].call(this,t);t.target=null}}}const De=["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 Re=1234567;const Ie=Math.PI/180,Oe=180/Math.PI;function Ne(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=De[255&t]+De[t>>8&255]+De[t>>16&255]+De[t>>24&255]+"-"+De[255&e]+De[e>>8&255]+"-"+De[e>>16&15|64]+De[e>>24&255]+"-"+De[63&n|128]+De[n>>8&255]+"-"+De[n>>16&255]+De[n>>24&255]+De[255&i]+De[i>>8&255]+De[i>>16&255]+De[i>>24&255];return r.toLowerCase()}function Ue(t,e,n){return Math.max(e,Math.min(n,t))}function ke(t,e){return(t%e+e)%e}function ze(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function Fe(t,e,n){return t!==e?(n-t)/(e-t):0}function Be(t,e,n){return(1-n)*t+n*e}function Ve(t,e,n,i){return Be(t,e,1-Math.exp(-n*i))}function He(t,e=1){return e-Math.abs(ke(t,2*e)-e)}function Ge(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function We(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(6*t-15)+10))}function je(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Xe(t,e){return t+Math.random()*(e-t)}function qe(t){return t*(.5-Math.random())}function $e(t){void 0!==t&&(Re=t);let e=Re+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}function Ye(t){return t*Ie}function Ze(t){return t*Oe}function Ke(t){return 0===(t&t-1)&&0!==t}function Je(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Qe(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function tn(t,e,n,i,r){const a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),c=a((e+i)/2),u=s((e+i)/2),h=a((e-i)/2),d=s((e-i)/2),p=a((i-e)/2),f=s((i-e)/2);switch(r){case"XYX":t.set(o*u,l*h,l*d,o*c);break;case"YZY":t.set(l*d,o*u,l*h,o*c);break;case"ZXZ":t.set(l*h,l*d,o*u,o*c);break;case"XZX":t.set(o*u,l*f,l*p,o*c);break;case"YXY":t.set(l*p,o*u,l*f,o*c);break;case"ZYZ":t.set(l*f,l*p,o*u,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function en(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function nn(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}var rn=Object.freeze({__proto__:null,DEG2RAD:Ie,RAD2DEG:Oe,generateUUID:Ne,clamp:Ue,euclideanModulo:ke,mapLinear:ze,inverseLerp:Fe,lerp:Be,damp:Ve,pingpong:He,smoothstep:Ge,smootherstep:We,randInt:je,randFloat:Xe,randFloatSpread:qe,seededRandom:$e,degToRad:Ye,radToDeg:Ze,isPowerOfTwo:Ke,ceilPowerOfTwo:Je,floorPowerOfTwo:Qe,setQuaternionFromProperEuler:tn,normalize:nn,denormalize:en});class an{constructor(t=0,e=0){an.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(){const t=Math.atan2(-this.y,-this.x)+Math.PI;return t}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class sn{constructor(){sn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,n,i,r,a,s,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=s,c[3]=e,c[4]=r,c[5]=o,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(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],_=i[4],x=i[7],y=i[2],b=i[5],M=i[8];return r[0]=a*f+s*v+o*y,r[3]=a*m+s*_+o*b,r[6]=a*g+s*x+o*M,r[1]=l*f+c*v+u*y,r[4]=l*m+c*_+u*b,r[7]=l*g+c*x+u*M,r[2]=h*f+d*v+p*y,r[5]=h*m+d*_+p*b,r[8]=h*g+d*x+p*M,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],o=t[6],l=t[7],c=t[8];return e*a*c-e*s*l-n*r*c+n*s*o+i*r*l-i*a*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],o=t[6],l=t[7],c=t[8],u=c*a-s*l,h=s*o-c*r,d=l*r-a*o,p=e*u+n*h+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=u*f,t[1]=(i*l-c*n)*f,t[2]=(s*n-i*a)*f,t[3]=h*f,t[4]=(c*e-i*o)*f,t[5]=(i*r-s*e)*f,t[6]=d*f,t[7]=(n*o-l*e)*f,t[8]=(a*e-n*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,a,s){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+t,-i*l,i*o,-i*(-l*a+o*s)+s+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],a=i[3],s=i[6],o=i[1],l=i[4],c=i[7];return i[0]=e*r+n*o,i[3]=e*a+n*l,i[6]=e*s+n*c,i[1]=-n*r+e*o,i[4]=-n*a+e*l,i[7]=-n*s+e*c,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}function on(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function ln(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function cn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function un(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const hn={[we]:{[Se]:cn},[Se]:{[we]:un}},dn={legacyMode:!0,get workingColorSpace(){return Se},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(hn[e]&&void 0!==hn[e][n]){const i=hn[e][n];return t.r=i(t.r),t.g=i(t.g),t.b=i(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},pn={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},fn={r:0,g:0,b:0},mn={h:0,s:0,l:0},gn={h:0,s:0,l:0};function vn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function _n(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class xn{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=we){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,dn.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Se){return this.r=t,this.g=e,this.b=n,dn.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Se){if(t=ke(t,1),e=Ue(e,0,1),n=Ue(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=vn(r,i,t+1/3),this.g=vn(r,i,t),this.b=vn(r,i,t-1/3)}return dn.toWorkingColorSpace(this,i),this}setStyle(t,e=we){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=i[1],a=i[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,dn.toWorkingColorSpace(this,e),n(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,dn.toWorkingColorSpace(this,e),n(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const i=parseFloat(t[1])/360,r=parseFloat(t[2])/100,a=parseFloat(t[3])/100;return n(t[4]),this.setHSL(i,r,a,e)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],n=t.length;if(3===n)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,dn.toWorkingColorSpace(this,e),this;if(6===n)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,dn.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=we){const n=pn[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=cn(t.r),this.g=cn(t.g),this.b=cn(t.b),this}copyLinearToSRGB(t){return this.r=un(t.r),this.g=un(t.g),this.b=un(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=we){return dn.fromWorkingColorSpace(_n(this,fn),t),Ue(255*fn.r,0,255)<<16^Ue(255*fn.g,0,255)<<8^Ue(255*fn.b,0,255)<<0}getHexString(t=we){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se){dn.fromWorkingColorSpace(_n(this,fn),e);const n=fn.r,i=fn.g,r=fn.b,a=Math.max(n,i,r),s=Math.min(n,i,r);let o,l;const c=(s+a)/2;if(s===a)o=0,l=0;else{const t=a-s;switch(l=c<=.5?t/(a+s):t/(2-a-s),a){case n:o=(i-r)/t+(i<r?6:0);break;case i:o=(r-n)/t+2;break;case r:o=(n-i)/t+4;break}o/=6}return t.h=o,t.s=l,t.l=c,t}getRGB(t,e=Se){return dn.fromWorkingColorSpace(_n(this,fn),e),t.r=fn.r,t.g=fn.g,t.b=fn.b,t}getStyle(t=we){return dn.fromWorkingColorSpace(_n(this,fn),t),t!==we?`color(${t} ${fn.r} ${fn.g} ${fn.b})`:`rgb(${255*fn.r|0},${255*fn.g|0},${255*fn.b|0})`}offsetHSL(t,e,n){return this.getHSL(mn),mn.h+=t,mn.s+=e,mn.l+=n,this.setHSL(mn.h,mn.s,mn.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(mn),t.getHSL(gn);const n=Be(mn.h,gn.h,e),i=Be(mn.s,gn.s,e),r=Be(mn.l,gn.l,e);return this.setHSL(n,i,r),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let yn;xn.NAMES=pn;class bn{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===yn&&(yn=ln("canvas")),yn.width=t.width,yn.height=t.height;const n=yn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=yn}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){const e=ln("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*cn(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*cn(e[t]/255)):e[t]=cn(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}class Mn{constructor(t=null){this.isSource=!0,this.uuid=Ne(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(wn(i[e].image)):t.push(wn(i[e]))}else t=wn(i);n.url=t}return e||(t.images[this.uuid]=n),n}}function wn(t){return"undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?bn.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Sn=0;class Tn extends Pe{constructor(t=Tn.DEFAULT_IMAGE,e=Tn.DEFAULT_MAPPING,n=ot,i=ot,r=dt,a=ft,s=Ct,o=mt,l=1,c=ve){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Sn++}),this.uuid=Ne(),this.name="",this.source=new Mn(t),this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new an(0,0),this.repeat=new an(1,1),this.center=new an(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new sn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==tt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case st:t.x=t.x-Math.floor(t.x);break;case ot:t.x=t.x<0?0:1;break;case lt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case st:t.y=t.y-Math.floor(t.y);break;case ot:t.y=t.y<0?0:1;break;case lt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}Tn.DEFAULT_IMAGE=null,Tn.DEFAULT_MAPPING=tt;class En{constructor(t=0,e=0,n=0,i=1){En.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const a=.01,s=.1,o=t.elements,l=o[0],c=o[4],u=o[8],h=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-h)<a&&Math.abs(u-f)<a&&Math.abs(p-m)<a){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,o=(d+1)/2,v=(g+1)/2,_=(c+h)/4,x=(u+f)/4,y=(p+m)/4;return t>o&&t>v?t<a?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=_/n,r=x/n):o>v?o<a?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=_/i,r=y/i):v<a?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(v),n=x/r,i=y/r),this.set(n,i,r,e),this}let v=Math.sqrt((m-p)*(m-p)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(u-f)/v,this.z=(h-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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 An extends Pe{constructor(t,e,n={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new En(0,0,t,e),this.scissorTest=!1,this.viewport=new En(0,0,t,e);const i={width:t,height:e,depth:1};this.texture=new Tn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:dt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Mn(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Cn extends Tn{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ct,this.minFilter=ct,this.wrapR=ot,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ln extends Tn{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ct,this.minFilter=ct,this.wrapR=ot,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Pn{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,a,s){let o=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3];const h=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(0===s)return t[e+0]=o,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===s)return t[e+0]=h,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(u!==f||o!==h||l!==d||c!==p){let t=1-s;const e=o*h+l*d+c*p+u*f,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),a=Math.atan2(r,e*n);t=Math.sin(t*a)/r,s=Math.sin(s*a)/r}const r=s*n;if(o=o*t+h*r,l=l*t+d*r,c=c*t+p*r,u=u*t+f*r,t===1-s){const t=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=t,l*=t,c*=t,u*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,a){const s=n[i],o=n[i+1],l=n[i+2],c=n[i+3],u=r[a],h=r[a+1],d=r[a+2],p=r[a+3];return t[e]=s*p+c*u+o*d-l*h,t[e+1]=o*p+c*h+l*u-s*d,t[e+2]=l*p+c*d+s*h-o*u,t[e+3]=c*p-s*u-o*h-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,a=t._order,s=Math.cos,o=Math.sin,l=s(n/2),c=s(i/2),u=s(r/2),h=o(n/2),d=o(i/2),p=o(r/2);switch(a){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],a=e[1],s=e[5],o=e[9],l=e[2],c=e[6],u=e[10],h=n+s+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(a-i)*t}else if(n>s&&n>u){const t=2*Math.sqrt(1+n-s-u);this._w=(c-o)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(r+l)/t}else if(s>u){const t=2*Math.sqrt(1+s-n-u);this._w=(r-l)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+u-n-s);this._w=(a-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Ue(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,a=t._w,s=e._x,o=e._y,l=e._z,c=e._w;return this._x=n*c+a*s+i*l-r*o,this._y=i*c+a*o+r*s-n*l,this._z=r*c+a*l+n*o-i*s,this._w=a*c-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,a=this._w;let s=a*t._w+n*t._x+i*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const o=1-s*s;if(o<=Number.EPSILON){const t=1-e;return this._w=t*a+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,s),u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;return this._w=a*u+this._w*h,this._x=n*u+this._x*h,this._y=i*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(i),n*Math.sin(r),n*Math.cos(r),e*Math.sin(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Dn{constructor(t=0,e=0,n=0){Dn.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(In.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(In.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,s=t.z,o=t.w,l=o*e+a*i-s*n,c=o*n+s*e-r*i,u=o*i+r*n-a*e,h=-r*e-a*n-s*i;return this.x=l*o+h*-r+c*-s-u*-a,this.y=c*o+h*-a+u*-r-l*-s,this.z=u*o+h*-s+l*-a-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,a=e.x,s=e.y,o=e.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return Rn.copy(this).projectOnVector(t),this.sub(Rn)}reflect(t){return this.sub(Rn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Ue(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Rn=new Dn,In=new Pn;class On{constructor(t=new Dn(1/0,1/0,1/0),e=new Dn(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,s=-1/0;for(let o=0,l=t.length;o<l;o+=3){const l=t[o],c=t[o+1],u=t[o+2];l<e&&(e=l),c<n&&(n=c),u<i&&(i=u),l>r&&(r=l),c>a&&(a=c),u>s&&(s=u)}return this.min.set(e,n,i),this.max.set(r,a,s),this}setFromBufferAttribute(t){let e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,s=-1/0;for(let o=0,l=t.count;o<l;o++){const l=t.getX(o),c=t.getY(o),u=t.getZ(o);l<e&&(e=l),c<n&&(n=c),u<i&&(i=u),l>r&&(r=l),c>a&&(a=c),u>s&&(s=u)}return this.min.set(e,n,i),this.max.set(r,a,s),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Un.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n)if(e&&void 0!=n.attributes&&void 0!==n.attributes.position){const e=n.attributes.position;for(let n=0,i=e.count;n<i;n++)Un.fromBufferAttribute(e,n).applyMatrix4(t.matrixWorld),this.expandByPoint(Un)}else null===n.boundingBox&&n.computeBoundingBox(),kn.copy(n.boundingBox),kn.applyMatrix4(t.matrixWorld),this.union(kn);const i=t.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Un),Un.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Wn),jn.subVectors(this.max,Wn),zn.subVectors(t.a,Wn),Fn.subVectors(t.b,Wn),Bn.subVectors(t.c,Wn),Vn.subVectors(Fn,zn),Hn.subVectors(Bn,Fn),Gn.subVectors(zn,Bn);let e=[0,-Vn.z,Vn.y,0,-Hn.z,Hn.y,0,-Gn.z,Gn.y,Vn.z,0,-Vn.x,Hn.z,0,-Hn.x,Gn.z,0,-Gn.x,-Vn.y,Vn.x,0,-Hn.y,Hn.x,0,-Gn.y,Gn.x,0];return!!$n(e,zn,Fn,Bn,jn)&&(e=[1,0,0,0,1,0,0,0,1],!!$n(e,zn,Fn,Bn,jn)&&(Xn.crossVectors(Vn,Hn),e=[Xn.x,Xn.y,Xn.z],$n(e,zn,Fn,Bn,jn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){const e=Un.copy(t).clamp(this.min,this.max);return e.sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Un).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Nn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Nn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Nn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Nn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Nn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Nn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Nn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Nn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Nn)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Nn=[new Dn,new Dn,new Dn,new Dn,new Dn,new Dn,new Dn,new Dn],Un=new Dn,kn=new On,zn=new Dn,Fn=new Dn,Bn=new Dn,Vn=new Dn,Hn=new Dn,Gn=new Dn,Wn=new Dn,jn=new Dn,Xn=new Dn,qn=new Dn;function $n(t,e,n,i,r){for(let a=0,s=t.length-3;a<=s;a+=3){qn.fromArray(t,a);const s=r.x*Math.abs(qn.x)+r.y*Math.abs(qn.y)+r.z*Math.abs(qn.z),o=e.dot(qn),l=n.dot(qn),c=i.dot(qn);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}const Yn=new On,Zn=new Dn,Kn=new Dn,Jn=new Dn;class Qn{constructor(t=new Dn,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Yn.setFromPoints(t).getCenter(n);let i=0;for(let r=0,a=t.length;r<a;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){Jn.subVectors(t,this.center);const e=Jn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.add(Jn.multiplyScalar(n/t)),this.radius+=n}return this}union(t){return!0===this.center.equals(t.center)?Kn.set(0,0,1).multiplyScalar(t.radius):Kn.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(Zn.copy(t.center).add(Kn)),this.expandByPoint(Zn.copy(t.center).sub(Kn)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ti=new Dn,ei=new Dn,ni=new Dn,ii=new Dn,ri=new Dn,ai=new Dn,si=new Dn;class oi{constructor(t=new Dn,e=new Dn(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ti)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=ti.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ti.copy(this.direction).multiplyScalar(e).add(this.origin),ti.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){ei.copy(t).add(e).multiplyScalar(.5),ni.copy(e).sub(t).normalize(),ii.copy(this.origin).sub(ei);const r=.5*t.distanceTo(e),a=-this.direction.dot(ni),s=ii.dot(this.direction),o=-ii.dot(ni),l=ii.lengthSq(),c=Math.abs(1-a*a);let u,h,d,p;if(c>0)if(u=a*o-s,h=a*s-o,p=r*c,u>=0)if(h>=-p)if(h<=p){const t=1/c;u*=t,h*=t,d=u*(u+a*h+2*s)+h*(a*u+h+2*o)+l}else h=r,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;else h=-r,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;else h<=-p?(u=Math.max(0,-(-a*r+s)),h=u>0?-r:Math.min(Math.max(-r,-o),r),d=-u*u+h*(h+2*o)+l):h<=p?(u=0,h=Math.min(Math.max(-r,-o),r),d=h*(h+2*o)+l):(u=Math.max(0,-(a*r+s)),h=u>0?r:Math.min(Math.max(-r,-o),r),d=-u*u+h*(h+2*o)+l);else h=a>0?-r:r,u=Math.max(0,-(a*h+s)),d=-u*u+h*(h+2*o)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),i&&i.copy(ni).multiplyScalar(h).add(ei),d}intersectSphere(t,e){ti.subVectors(t.center,this.origin);const n=ti.dot(this.direction),i=ti.dot(ti)-n*n,r=t.radius*t.radius;if(i>r)return null;const a=Math.sqrt(r-i),s=n-a,o=n+a;return s<0&&o<0?null:s<0?this.at(o,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;const n=t.normal.dot(this.direction);return n*e<0}intersectBox(t,e){let n,i,r,a,s,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(t.min.x-h.x)*l,i=(t.max.x-h.x)*l):(n=(t.max.x-h.x)*l,i=(t.min.x-h.x)*l),c>=0?(r=(t.min.y-h.y)*c,a=(t.max.y-h.y)*c):(r=(t.max.y-h.y)*c,a=(t.min.y-h.y)*c),n>a||r>i?null:((r>n||n!==n)&&(n=r),(a<i||i!==i)&&(i=a),u>=0?(s=(t.min.z-h.z)*u,o=(t.max.z-h.z)*u):(s=(t.max.z-h.z)*u,o=(t.min.z-h.z)*u),n>o||s>i?null:((s>n||n!==n)&&(n=s),(o<i||i!==i)&&(i=o),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,ti)}intersectTriangle(t,e,n,i,r){ri.subVectors(e,t),ai.subVectors(n,t),si.crossVectors(ri,ai);let a,s=this.direction.dot(si);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}ii.subVectors(this.origin,t);const o=a*this.direction.dot(ai.crossVectors(ii,ai));if(o<0)return null;const l=a*this.direction.dot(ri.cross(ii));if(l<0)return null;if(o+l>s)return null;const c=-a*ii.dot(si);return c<0?null:this.at(c/s,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class li{constructor(){li.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,n,i,r,a,s,o,l,c,u,h,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,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 li).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/ci.setFromMatrixColumn(t,0).length(),r=1/ci.setFromMatrixColumn(t,1).length(),a=1/ci.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){const t=a*c,n=a*u,i=s*c,r=s*u;e[0]=o*c,e[4]=-o*u,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-s*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=a*o}else if("YXZ"===t.order){const t=o*c,n=o*u,i=l*c,r=l*u;e[0]=t+r*s,e[4]=i*s-n,e[8]=a*l,e[1]=a*u,e[5]=a*c,e[9]=-s,e[2]=n*s-i,e[6]=r+t*s,e[10]=a*o}else if("ZXY"===t.order){const t=o*c,n=o*u,i=l*c,r=l*u;e[0]=t-r*s,e[4]=-a*u,e[8]=i+n*s,e[1]=n+i*s,e[5]=a*c,e[9]=r-t*s,e[2]=-a*l,e[6]=s,e[10]=a*o}else if("ZYX"===t.order){const t=a*c,n=a*u,i=s*c,r=s*u;e[0]=o*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*u,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=s*o,e[10]=a*o}else if("YZX"===t.order){const t=a*o,n=a*l,i=s*o,r=s*l;e[0]=o*c,e[4]=r-t*u,e[8]=i*u+n,e[1]=u,e[5]=a*c,e[9]=-s*c,e[2]=-l*c,e[6]=n*u+i,e[10]=t-r*u}else if("XZY"===t.order){const t=a*o,n=a*l,i=s*o,r=s*l;e[0]=o*c,e[4]=-u,e[8]=l*c,e[1]=t*u+r,e[5]=a*c,e[9]=n*u-i,e[2]=i*u-n,e[6]=s*c,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(hi,t,di)}lookAt(t,e,n){const i=this.elements;return mi.subVectors(t,e),0===mi.lengthSq()&&(mi.z=1),mi.normalize(),pi.crossVectors(n,mi),0===pi.lengthSq()&&(1===Math.abs(n.z)?mi.x+=1e-4:mi.z+=1e-4,mi.normalize(),pi.crossVectors(n,mi)),pi.normalize(),fi.crossVectors(mi,pi),i[0]=pi.x,i[4]=fi.x,i[8]=mi.x,i[1]=pi.y,i[5]=fi.y,i[9]=mi.y,i[2]=pi.z,i[6]=fi.z,i[10]=mi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],_=n[7],x=n[11],y=n[15],b=i[0],M=i[4],w=i[8],S=i[12],T=i[1],E=i[5],A=i[9],C=i[13],L=i[2],P=i[6],D=i[10],R=i[14],I=i[3],O=i[7],N=i[11],U=i[15];return r[0]=a*b+s*T+o*L+l*I,r[4]=a*M+s*E+o*P+l*O,r[8]=a*w+s*A+o*D+l*N,r[12]=a*S+s*C+o*R+l*U,r[1]=c*b+u*T+h*L+d*I,r[5]=c*M+u*E+h*P+d*O,r[9]=c*w+u*A+h*D+d*N,r[13]=c*S+u*C+h*R+d*U,r[2]=p*b+f*T+m*L+g*I,r[6]=p*M+f*E+m*P+g*O,r[10]=p*w+f*A+m*D+g*N,r[14]=p*S+f*C+m*R+g*U,r[3]=v*b+_*T+x*L+y*I,r[7]=v*M+_*E+x*P+y*O,r[11]=v*w+_*A+x*D+y*N,r[15]=v*S+_*C+x*R+y*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],s=t[5],o=t[9],l=t[13],c=t[2],u=t[6],h=t[10],d=t[14],p=t[3],f=t[7],m=t[11],g=t[15];return p*(+r*o*u-i*l*u-r*s*h+n*l*h+i*s*d-n*o*d)+f*(+e*o*d-e*l*h+r*a*h-i*a*d+i*l*c-r*o*c)+m*(+e*l*u-e*s*d-r*a*u+n*a*d+r*s*c-n*l*c)+g*(-i*s*c-e*o*u+e*s*h+i*a*u-n*a*h+n*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],o=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=u*m*l-f*h*l+f*o*d-s*m*d-u*o*g+s*h*g,_=p*h*l-c*m*l-p*o*d+a*m*d+c*o*g-a*h*g,x=c*f*l-p*u*l+p*s*d-a*f*d-c*s*g+a*u*g,y=p*u*o-c*f*o-p*s*h+a*f*h+c*s*m-a*u*m,b=e*v+n*_+i*x+r*y;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/b;return t[0]=v*M,t[1]=(f*h*r-u*m*r-f*i*d+n*m*d+u*i*g-n*h*g)*M,t[2]=(s*m*r-f*o*r+f*i*l-n*m*l-s*i*g+n*o*g)*M,t[3]=(u*o*r-s*h*r-u*i*l+n*h*l+s*i*d-n*o*d)*M,t[4]=_*M,t[5]=(c*m*r-p*h*r+p*i*d-e*m*d-c*i*g+e*h*g)*M,t[6]=(p*o*r-a*m*r-p*i*l+e*m*l+a*i*g-e*o*g)*M,t[7]=(a*h*r-c*o*r+c*i*l-e*h*l-a*i*d+e*o*d)*M,t[8]=x*M,t[9]=(p*u*r-c*f*r-p*n*d+e*f*d+c*n*g-e*u*g)*M,t[10]=(a*f*r-p*s*r+p*n*l-e*f*l-a*n*g+e*s*g)*M,t[11]=(c*s*r-a*u*r-c*n*l+e*u*l+a*n*d-e*s*d)*M,t[12]=y*M,t[13]=(c*f*i-p*u*i+p*n*h-e*f*h-c*n*m+e*u*m)*M,t[14]=(p*s*i-a*f*i-p*n*o+e*f*o+a*n*m-e*s*m)*M,t[15]=(a*u*i-c*s*i+c*n*o-e*u*o-a*n*h+e*s*h)*M,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,s=t.y,o=t.z,l=r*a,c=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,c*s+n,c*o-i*a,0,l*o-i*s,c*o+i*a,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,a){return this.set(1,n,r,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,a=e._y,s=e._z,o=e._w,l=r+r,c=a+a,u=s+s,h=r*l,d=r*c,p=r*u,f=a*c,m=a*u,g=s*u,v=o*l,_=o*c,x=o*u,y=n.x,b=n.y,M=n.z;return i[0]=(1-(f+g))*y,i[1]=(d+x)*y,i[2]=(p-_)*y,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(h+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+_)*M,i[9]=(m-v)*M,i[10]=(1-(h+f))*M,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=ci.set(i[0],i[1],i[2]).length();const a=ci.set(i[4],i[5],i[6]).length(),s=ci.set(i[8],i[9],i[10]).length(),o=this.determinant();o<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],ui.copy(this);const l=1/r,c=1/a,u=1/s;return ui.elements[0]*=l,ui.elements[1]*=l,ui.elements[2]*=l,ui.elements[4]*=c,ui.elements[5]*=c,ui.elements[6]*=c,ui.elements[8]*=u,ui.elements[9]*=u,ui.elements[10]*=u,e.setFromRotationMatrix(ui),n.x=r,n.y=a,n.z=s,this}makePerspective(t,e,n,i,r,a){const s=this.elements,o=2*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),u=(n+i)/(n-i),h=-(a+r)/(a-r),d=-2*a*r/(a-r);return s[0]=o,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,n,i,r,a){const s=this.elements,o=1/(e-t),l=1/(n-i),c=1/(a-r),u=(e+t)*o,h=(n+i)*l,d=(a+r)*c;return s[0]=2*o,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const ci=new Dn,ui=new li,hi=new Dn(0,0,0),di=new Dn(1,1,1),pi=new Dn,fi=new Dn,mi=new Dn,gi=new li,vi=new Pn;class _i{constructor(t=0,e=0,n=0,i=_i.DefaultOrder){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],a=i[4],s=i[8],o=i[1],l=i[5],c=i[9],u=i[2],h=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(Ue(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Ue(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ue(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(o,r));break;case"ZYX":this._y=Math.asin(-Ue(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Ue(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-Ue(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return gi.makeRotationFromQuaternion(t),this.setFromRotationMatrix(gi,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return vi.setFromEuler(this),this.setFromQuaternion(vi,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}_i.DefaultOrder="XYZ",_i.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class xi{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!==(this.mask&t.mask)}isEnabled(t){return 0!==(this.mask&(1<<t|0))}}let yi=0;const bi=new Dn,Mi=new Pn,wi=new li,Si=new Dn,Ti=new Dn,Ei=new Dn,Ai=new Pn,Ci=new Dn(1,0,0),Li=new Dn(0,1,0),Pi=new Dn(0,0,1),Di={type:"added"},Ri={type:"removed"};class Ii extends Pe{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:yi++}),this.uuid=Ne(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ii.DefaultUp.clone();const t=new Dn,e=new _i,n=new Pn,i=new Dn(1,1,1);function r(){n.setFromEuler(e,!1)}function a(){e.setFromQuaternion(n,void 0,!1)}e._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new li},normalMatrix:{value:new sn}}),this.matrix=new li,this.matrixWorld=new li,this.matrixAutoUpdate=Ii.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=Ii.DefaultMatrixWorldAutoUpdate,this.layers=new xi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Mi.setFromAxisAngle(t,e),this.quaternion.multiply(Mi),this}rotateOnWorldAxis(t,e){return Mi.setFromAxisAngle(t,e),this.quaternion.premultiply(Mi),this}rotateX(t){return this.rotateOnAxis(Ci,t)}rotateY(t){return this.rotateOnAxis(Li,t)}rotateZ(t){return this.rotateOnAxis(Pi,t)}translateOnAxis(t,e){return bi.copy(t).applyQuaternion(this.quaternion),this.position.add(bi.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Ci,t)}translateY(t){return this.translateOnAxis(Li,t)}translateZ(t){return this.translateOnAxis(Pi,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(wi.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Si.copy(t):Si.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Ti.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?wi.lookAt(Ti,Si,this.up):wi.lookAt(Si,Ti,this.up),this.quaternion.setFromRotationMatrix(wi),i&&(wi.extractRotation(i.matrixWorld),Mi.setFromRotationMatrix(wi),this.quaternion.premultiply(Mi.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(Di)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Ri)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(Ri)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),wi.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),wi.multiply(t.parent.matrixWorld)),t.applyMatrix4(wi),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n],r=i.getObjectByProperty(t,e);if(void 0!==r)return r}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ti,t,Ei),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ti,Ai,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++){const i=e[n];!0!==i.matrixWorldAutoUpdate&&!0!==t||i.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"===typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=a(t.geometries),i=a(t.materials),r=a(t.textures),s=a(t.images),o=a(t.shapes),l=a(t.skeletons),c=a(t.animations),u=a(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=i,n;function a(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let n=0;n<t.children.length;n++){const e=t.children[n];this.add(e.clone())}return this}}Ii.DefaultUp=new Dn(0,1,0),Ii.DefaultMatrixAutoUpdate=!0,Ii.DefaultMatrixWorldAutoUpdate=!0;const Oi=new Dn,Ni=new Dn,Ui=new Dn,ki=new Dn,zi=new Dn,Fi=new Dn,Bi=new Dn,Vi=new Dn,Hi=new Dn,Gi=new Dn;class Wi{constructor(t=new Dn,e=new Dn,n=new Dn){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),Oi.subVectors(t,e),i.cross(Oi);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Oi.subVectors(i,e),Ni.subVectors(n,e),Ui.subVectors(t,e);const a=Oi.dot(Oi),s=Oi.dot(Ni),o=Oi.dot(Ui),l=Ni.dot(Ni),c=Ni.dot(Ui),u=a*l-s*s;if(0===u)return r.set(-2,-1,-1);const h=1/u,d=(l*o-s*c)*h,p=(a*c-s*o)*h;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,ki),ki.x>=0&&ki.y>=0&&ki.x+ki.y<=1}static getUV(t,e,n,i,r,a,s,o){return this.getBarycoord(t,e,n,i,ki),o.set(0,0),o.addScaledVector(r,ki.x),o.addScaledVector(a,ki.y),o.addScaledVector(s,ki.z),o}static isFrontFacing(t,e,n,i){return Oi.subVectors(n,e),Ni.subVectors(t,e),Oi.cross(Ni).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Oi.subVectors(this.c,this.b),Ni.subVectors(this.a,this.b),.5*Oi.cross(Ni).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Wi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Wi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return Wi.getUV(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Wi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Wi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let a,s;zi.subVectors(i,n),Fi.subVectors(r,n),Vi.subVectors(t,n);const o=zi.dot(Vi),l=Fi.dot(Vi);if(o<=0&&l<=0)return e.copy(n);Hi.subVectors(t,i);const c=zi.dot(Hi),u=Fi.dot(Hi);if(c>=0&&u<=c)return e.copy(i);const h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return a=o/(o-c),e.copy(n).addScaledVector(zi,a);Gi.subVectors(t,r);const d=zi.dot(Gi),p=Fi.dot(Gi);if(p>=0&&d<=p)return e.copy(r);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),e.copy(n).addScaledVector(Fi,s);const m=c*p-d*u;if(m<=0&&u-c>=0&&d-p>=0)return Bi.subVectors(r,i),s=(u-c)/(u-c+(d-p)),e.copy(i).addScaledVector(Bi,s);const g=1/(m+f+h);return a=f*g,s=h*g,e.copy(n).addScaledVector(zi,a).addScaledVector(Fi,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let ji=0;class Xi extends Pe{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ji++}),this.uuid=Ne(),this.name="",this.type="Material",this.blending=g,this.side=d,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=P,this.blendDst=D,this.blendEquation=b,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=B,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Ee,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Te,this.stencilZFail=Te,this.stencilZPass=Te,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!==t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"===typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}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()),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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),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(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),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(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(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),this.blending!==g&&(n.blending=this.blending),this.side!==d&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,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.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),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=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class qi extends Xi{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new xn(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.combine=j,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const $i=new Dn,Yi=new an;class Zi{constructor(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=Ae,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Yi.fromBufferAttribute(this,e),Yi.applyMatrix3(t),this.setXY(e,Yi.x,Yi.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)$i.fromBufferAttribute(this,e),$i.applyMatrix3(t),this.setXYZ(e,$i.x,$i.y,$i.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)$i.fromBufferAttribute(this,e),$i.applyMatrix4(t),this.setXYZ(e,$i.x,$i.y,$i.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)$i.fromBufferAttribute(this,e),$i.applyNormalMatrix(t),this.setXYZ(e,$i.x,$i.y,$i.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)$i.fromBufferAttribute(this,e),$i.transformDirection(t),this.setXYZ(e,$i.x,$i.y,$i.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=en(e,this.array)),e}setX(t,e){return this.normalized&&(e=nn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=en(e,this.array)),e}setY(t,e){return this.normalized&&(e=nn(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=en(e,this.array)),e}setZ(t,e){return this.normalized&&(e=nn(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=en(e,this.array)),e}setW(t,e){return this.normalized&&(e=nn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=nn(e,this.array),n=nn(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=nn(e,this.array),n=nn(n,this.array),i=nn(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=nn(e,this.array),n=nn(n,this.array),i=nn(i,this.array),r=nn(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Ae&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class Ki extends Zi{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class Ji extends Zi{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class Qi extends Zi{constructor(t,e,n){super(new Float32Array(t),e,n)}}let tr=0;const er=new li,nr=new Ii,ir=new Dn,rr=new On,ar=new On,sr=new Dn;class or extends Pe{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:tr++}),this.uuid=Ne(),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(t){return Array.isArray(t)?this.index=new(on(t)?Ji:Ki)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new sn).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return er.makeRotationFromQuaternion(t),this.applyMatrix4(er),this}rotateX(t){return er.makeRotationX(t),this.applyMatrix4(er),this}rotateY(t){return er.makeRotationY(t),this.applyMatrix4(er),this}rotateZ(t){return er.makeRotationZ(t),this.applyMatrix4(er),this}translate(t,e,n){return er.makeTranslation(t,e,n),this.applyMatrix4(er),this}scale(t,e,n){return er.makeScale(t,e,n),this.applyMatrix4(er),this}lookAt(t){return nr.lookAt(t),nr.updateMatrix(),this.applyMatrix4(nr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ir).negate(),this.translate(ir.x,ir.y,ir.z),this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Qi(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new On);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Dn(-1/0,-1/0,-1/0),new Dn(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){const t=e[n];rr.setFromBufferAttribute(t),this.morphTargetsRelative?(sr.addVectors(this.boundingBox.min,rr.min),this.boundingBox.expandByPoint(sr),sr.addVectors(this.boundingBox.max,rr.max),this.boundingBox.expandByPoint(sr)):(this.boundingBox.expandByPoint(rr.min),this.boundingBox.expandByPoint(rr.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 Qn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new Dn,1/0);if(t){const n=this.boundingSphere.center;if(rr.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){const n=e[t];ar.setFromBufferAttribute(n),this.morphTargetsRelative?(sr.addVectors(rr.min,ar.min),rr.expandByPoint(sr),sr.addVectors(rr.max,ar.max),rr.expandByPoint(sr)):(rr.expandByPoint(ar.min),rr.expandByPoint(ar.max))}rr.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)sr.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(sr));if(e)for(let r=0,a=e.length;r<a;r++){const a=e[r],s=this.morphTargetsRelative;for(let e=0,r=a.count;e<r;e++)sr.fromBufferAttribute(a,e),s&&(ir.fromBufferAttribute(t,e),sr.add(ir)),i=Math.max(i,n.distanceToSquared(sr))}this.boundingSphere.radius=Math.sqrt(i),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 t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,i=e.position.array,r=e.normal.array,a=e.uv.array,s=i.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Zi(new Float32Array(4*s),4));const o=this.getAttribute("tangent").array,l=[],c=[];for(let T=0;T<s;T++)l[T]=new Dn,c[T]=new Dn;const u=new Dn,h=new Dn,d=new Dn,p=new an,f=new an,m=new an,g=new Dn,v=new Dn;function _(t,e,n){u.fromArray(i,3*t),h.fromArray(i,3*e),d.fromArray(i,3*n),p.fromArray(a,2*t),f.fromArray(a,2*e),m.fromArray(a,2*n),h.sub(u),d.sub(u),f.sub(p),m.sub(p);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(r),v.copy(d).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(r),l[t].add(g),l[e].add(g),l[n].add(g),c[t].add(v),c[e].add(v),c[n].add(v))}let x=this.groups;0===x.length&&(x=[{start:0,count:n.length}]);for(let T=0,E=x.length;T<E;++T){const t=x[T],e=t.start,i=t.count;for(let r=e,a=e+i;r<a;r+=3)_(n[r+0],n[r+1],n[r+2])}const y=new Dn,b=new Dn,M=new Dn,w=new Dn;function S(t){M.fromArray(r,3*t),w.copy(M);const e=l[t];y.copy(e),y.sub(M.multiplyScalar(M.dot(e))).normalize(),b.crossVectors(w,e);const n=b.dot(c[t]),i=n<0?-1:1;o[4*t]=y.x,o[4*t+1]=y.y,o[4*t+2]=y.z,o[4*t+3]=i}for(let T=0,E=x.length;T<E;++T){const t=x[T],e=t.start,i=t.count;for(let r=e,a=e+i;r<a;r+=3)S(n[r+0]),S(n[r+1]),S(n[r+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Zi(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new Dn,r=new Dn,a=new Dn,s=new Dn,o=new Dn,l=new Dn,c=new Dn,u=new Dn;if(t)for(let h=0,d=t.count;h<d;h+=3){const d=t.getX(h+0),p=t.getX(h+1),f=t.getX(h+2);i.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),a.fromBufferAttribute(e,f),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),s.fromBufferAttribute(n,d),o.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),s.add(c),o.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(p,o.x,o.y,o.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let t=0,h=e.count;t<h;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),n.setXYZ(t+0,c.x,c.y,c.z),n.setXYZ(t+1,c.x,c.y,c.z),n.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)sr.fromBufferAttribute(t,e),sr.normalize(),t.setXYZ(e,sr.x,sr.y,sr.z)}toNonIndexed(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,a=new n.constructor(e.length*i);let s=0,o=0;for(let l=0,c=e.length;l<c;l++){s=t.isInterleavedBufferAttribute?e[l]*t.data.stride+t.offset:e[l]*i;for(let t=0;t<i;t++)a[o++]=n[s++]}return new Zi(a,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new or,n=this.index.array,i=this.attributes;for(const s in i){const r=i[s],a=t(r,n);e.setAttribute(s,a)}const r=this.morphAttributes;for(const s in r){const i=[],a=r[s];for(let e=0,r=a.length;e<r;e++){const r=a[e],s=t(r,n);i.push(s)}e.morphAttributes[s]=i}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let s=0,o=a.length;s<o;s++){const t=a[s];e.addGroup(t.start,t.count,t.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const o in n){const e=n[o];t.data.attributes[o]=e.toJSON(t.data)}const i={};let r=!1;for(const o in this.morphAttributes){const e=this.morphAttributes[o],n=[];for(let i=0,r=e.length;i<r;i++){const r=e[i];n.push(r.toJSON(t.data))}n.length>0&&(i[o]=n,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const l in i){const t=i[l];this.setAttribute(l,t.clone(e))}const r=t.morphAttributes;for(const l in r){const t=[],n=r[l];for(let i=0,r=n.length;i<r;i++)t.push(n[i].clone(e));this.morphAttributes[l]=t}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let l=0,c=a.length;l<c;l++){const t=a[l];this.addGroup(t.start,t.count,t.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,void 0!==t.parameters&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const lr=new li,cr=new oi,ur=new Qn,hr=new Dn,dr=new Dn,pr=new Dn,fr=new Dn,mr=new Dn,gr=new Dn,vr=new Dn,_r=new Dn,xr=new Dn,yr=new an,br=new an,Mr=new an,wr=new Dn,Sr=new Dn;class Tr extends Ii{constructor(t=new or,e=new qi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry,e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),ur.copy(n.boundingSphere),ur.applyMatrix4(r),!1===t.ray.intersectsSphere(ur))return;if(lr.copy(r).invert(),cr.copy(t.ray).applyMatrix4(lr),null!==n.boundingBox&&!1===cr.intersectsBox(n.boundingBox))return;let a;const s=n.index,o=n.attributes.position,l=n.morphAttributes.position,c=n.morphTargetsRelative,u=n.attributes.uv,h=n.attributes.uv2,d=n.groups,p=n.drawRange;if(null!==s)if(Array.isArray(i))for(let f=0,m=d.length;f<m;f++){const n=d[f],r=i[n.materialIndex],m=Math.max(n.start,p.start),g=Math.min(s.count,Math.min(n.start+n.count,p.start+p.count));for(let i=m,d=g;i<d;i+=3){const d=s.getX(i),p=s.getX(i+1),f=s.getX(i+2);a=Ar(this,r,t,cr,o,l,c,u,h,d,p,f),a&&(a.faceIndex=Math.floor(i/3),a.face.materialIndex=n.materialIndex,e.push(a))}}else{const n=Math.max(0,p.start),r=Math.min(s.count,p.start+p.count);for(let d=n,p=r;d<p;d+=3){const n=s.getX(d),r=s.getX(d+1),p=s.getX(d+2);a=Ar(this,i,t,cr,o,l,c,u,h,n,r,p),a&&(a.faceIndex=Math.floor(d/3),e.push(a))}}else if(void 0!==o)if(Array.isArray(i))for(let f=0,m=d.length;f<m;f++){const n=d[f],r=i[n.materialIndex],s=Math.max(n.start,p.start),m=Math.min(o.count,Math.min(n.start+n.count,p.start+p.count));for(let i=s,d=m;i<d;i+=3){const s=i,d=i+1,p=i+2;a=Ar(this,r,t,cr,o,l,c,u,h,s,d,p),a&&(a.faceIndex=Math.floor(i/3),a.face.materialIndex=n.materialIndex,e.push(a))}}else{const n=Math.max(0,p.start),r=Math.min(o.count,p.start+p.count);for(let s=n,d=r;s<d;s+=3){const n=s,r=s+1,d=s+2;a=Ar(this,i,t,cr,o,l,c,u,h,n,r,d),a&&(a.faceIndex=Math.floor(s/3),e.push(a))}}}}function Er(t,e,n,i,r,a,s,o){let l;if(l=e.side===p?i.intersectTriangle(s,a,r,!0,o):i.intersectTriangle(r,a,s,e.side!==f,o),null===l)return null;Sr.copy(o),Sr.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(Sr);return c<n.near||c>n.far?null:{distance:c,point:Sr.clone(),object:t}}function Ar(t,e,n,i,r,a,s,o,l,c,u,h){hr.fromBufferAttribute(r,c),dr.fromBufferAttribute(r,u),pr.fromBufferAttribute(r,h);const d=t.morphTargetInfluences;if(a&&d){vr.set(0,0,0),_r.set(0,0,0),xr.set(0,0,0);for(let t=0,e=a.length;t<e;t++){const e=d[t],n=a[t];0!==e&&(fr.fromBufferAttribute(n,c),mr.fromBufferAttribute(n,u),gr.fromBufferAttribute(n,h),s?(vr.addScaledVector(fr,e),_r.addScaledVector(mr,e),xr.addScaledVector(gr,e)):(vr.addScaledVector(fr.sub(hr),e),_r.addScaledVector(mr.sub(dr),e),xr.addScaledVector(gr.sub(pr),e)))}hr.add(vr),dr.add(_r),pr.add(xr)}t.isSkinnedMesh&&(t.boneTransform(c,hr),t.boneTransform(u,dr),t.boneTransform(h,pr));const p=Er(t,e,n,i,hr,dr,pr,wr);if(p){o&&(yr.fromBufferAttribute(o,c),br.fromBufferAttribute(o,u),Mr.fromBufferAttribute(o,h),p.uv=Wi.getUV(wr,hr,dr,pr,yr,br,Mr,new an)),l&&(yr.fromBufferAttribute(l,c),br.fromBufferAttribute(l,u),Mr.fromBufferAttribute(l,h),p.uv2=Wi.getUV(wr,hr,dr,pr,yr,br,Mr,new an));const t={a:c,b:u,c:h,normal:new Dn,materialIndex:0};Wi.getNormal(hr,dr,pr,t.normal),p.face=t}return p}class Cr extends or{constructor(t=1,e=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const o=[],l=[],c=[],u=[];let h=0,d=0;function p(t,e,n,i,r,a,p,f,m,g,v){const _=a/m,x=p/g,y=a/2,b=p/2,M=f/2,w=m+1,S=g+1;let T=0,E=0;const A=new Dn;for(let s=0;s<S;s++){const a=s*x-b;for(let o=0;o<w;o++){const h=o*_-y;A[t]=h*i,A[e]=a*r,A[n]=M,l.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=f>0?1:-1,c.push(A.x,A.y,A.z),u.push(o/m),u.push(1-s/g),T+=1}}for(let s=0;s<g;s++)for(let t=0;t<m;t++){const e=h+t+w*s,n=h+t+w*(s+1),i=h+(t+1)+w*(s+1),r=h+(t+1)+w*s;o.push(e,n,r),o.push(n,i,r),E+=6}s.addGroup(d,E,v),d+=E,h+=T}p("z","y","x",-1,-1,n,e,t,a,r,0),p("z","y","x",1,-1,n,e,-t,a,r,1),p("x","z","y",1,1,t,n,e,i,a,2),p("x","z","y",1,-1,t,n,-e,i,a,3),p("x","y","z",1,-1,t,e,n,i,r,4),p("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new Qi(l,3)),this.setAttribute("normal",new Qi(c,3)),this.setAttribute("uv",new Qi(u,2))}static fromJSON(t){return new Cr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Lr(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function Pr(t){const e={};for(let n=0;n<t.length;n++){const i=Lr(t[n]);for(const t in i)e[t]=i[t]}return e}function Dr(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}const Rr={clone:Lr,merge:Pr};var Ir="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",Or="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";class Nr extends Xi{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Ir,this.fragmentShader=Or,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Lr(t.uniforms),this.uniformsGroups=Dr(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i],r=n.value;r&&r.isTexture?e.uniforms[i]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[i]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[i]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[i]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[i]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[i]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[i]={type:"m4",value:r.toArray()}:e.uniforms[i]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const i in this.extensions)!0===this.extensions[i]&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Ur extends Ii{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new li,this.projectionMatrix=new li,this.projectionMatrixInverse=new li}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class kr extends Ur{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Oe*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Ie*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Oe*Math.atan(Math.tan(.5*Ie*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,n,i,r,a){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Ie*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const a=this.view;if(null!==this.view&&this.view.enabled){const t=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/t,e-=a.offsetY*n/s,i*=a.width/t,n*=a.height/s}const s=this.filmOffset;0!==s&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const zr=90,Fr=1;class Br extends Ii{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n;const i=new kr(zr,Fr,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Dn(1,0,0)),this.add(i);const r=new kr(zr,Fr,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Dn(-1,0,0)),this.add(r);const a=new kr(zr,Fr,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new Dn(0,1,0)),this.add(a);const s=new kr(zr,Fr,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new Dn(0,-1,0)),this.add(s);const o=new kr(zr,Fr,t,e);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Dn(0,0,1)),this.add(o);const l=new kr(zr,Fr,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Dn(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,r,a,s,o,l]=this.children,c=t.getRenderTarget(),u=t.toneMapping,h=t.xr.enabled;t.toneMapping=$,t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,a),t.setRenderTarget(n,3),t.render(e,s),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=d,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(c),t.toneMapping=u,t.xr.enabled=h,n.texture.needsPMREMUpdate=!0}}class Vr extends Tn{constructor(t,e,n,i,r,a,s,o,l,c){t=void 0!==t?t:[],e=void 0!==e?e:et,super(t,e,n,i,r,a,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Hr extends An{constructor(t,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Vr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:dt}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.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"},i=new Cr(5,5,5),r=new Nr({name:"CubemapFromEquirect",uniforms:Lr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:p,blending:m});r.uniforms.tEquirect.value=e;const a=new Tr(i,r),s=e.minFilter;e.minFilter===ft&&(e.minFilter=dt);const o=new Br(1,10,this);return o.update(t,a),e.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(r)}}const Gr=new Dn,Wr=new Dn,jr=new sn;class Xr{constructor(t=new Dn(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Gr.subVectors(n,e).cross(Wr.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const n=t.delta(Gr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(n).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||jr.getNormalMatrix(t),i=this.coplanarPoint(Gr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const qr=new Qn,$r=new Dn;class Yr{constructor(t=new Xr,e=new Xr,n=new Xr,i=new Xr,r=new Xr,a=new Xr){this.planes=[t,e,n,i,r,a]}set(t,e,n,i,r,a){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,i=n[0],r=n[1],a=n[2],s=n[3],o=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],_=n[15];return e[0].setComponents(s-i,u-o,f-h,_-m).normalize(),e[1].setComponents(s+i,u+o,f+h,_+m).normalize(),e[2].setComponents(s+r,u+l,f+d,_+g).normalize(),e[3].setComponents(s-r,u-l,f-d,_-g).normalize(),e[4].setComponents(s-a,u-c,f-p,_-v).normalize(),e[5].setComponents(s+a,u+c,f+p,_+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),qr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(qr)}intersectsSprite(t){return qr.center.set(0,0,0),qr.radius=.7071067811865476,qr.applyMatrix4(t.matrixWorld),this.intersectsSphere(qr)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let r=0;r<6;r++){const t=e[r].distanceToPoint(n);if(t<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if($r.x=i.normal.x>0?t.max.x:t.min.x,$r.y=i.normal.y>0?t.max.y:t.min.y,$r.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint($r)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Zr(){let t=null,e=!1,n=null,i=null;function r(e,a){n(e,a),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Kr(t,e){const n=e.isWebGL2,i=new WeakMap;function r(e,i){const r=e.array,a=e.usage,s=t.createBuffer();let o;if(t.bindBuffer(i,s),t.bufferData(i,r,a),e.onUploadCallback(),r instanceof Float32Array)o=5126;else if(r instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");o=5131}else o=5123;else if(r instanceof Int16Array)o=5122;else if(r instanceof Uint32Array)o=5125;else if(r instanceof Int32Array)o=5124;else if(r instanceof Int8Array)o=5120;else if(r instanceof Uint8Array)o=5121;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);o=5121}return{buffer:s,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}function a(e,i,r){const a=i.array,s=i.updateRange;t.bindBuffer(r,e),-1===s.count?t.bufferSubData(r,0,a):(n?t.bufferSubData(r,s.offset*a.BYTES_PER_ELEMENT,a,s.offset,s.count):t.bufferSubData(r,s.offset*a.BYTES_PER_ELEMENT,a.subarray(s.offset,s.offset+s.count)),s.count=-1)}function s(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)}function o(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))}function l(t,e){if(t.isGLBufferAttribute){const e=i.get(t);return void((!e||e.version<t.version)&&i.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);void 0===n?i.set(t,r(t,e)):n.version<t.version&&(a(n.buffer,t,e),n.version=t.version)}return{get:s,remove:o,update:l}}class Jr extends or{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,a=e/2,s=Math.floor(n),o=Math.floor(i),l=s+1,c=o+1,u=t/s,h=e/o,d=[],p=[],f=[],m=[];for(let g=0;g<c;g++){const t=g*h-a;for(let e=0;e<l;e++){const n=e*u-r;p.push(n,-t,0),f.push(0,0,1),m.push(e/s),m.push(1-g/o)}}for(let g=0;g<o;g++)for(let t=0;t<s;t++){const e=t+l*g,n=t+l*(g+1),i=t+1+l*(g+1),r=t+1+l*g;d.push(e,n,r),d.push(n,i,r)}this.setIndex(d),this.setAttribute("position",new Qi(p,3)),this.setAttribute("normal",new Qi(f,3)),this.setAttribute("uv",new Qi(m,2))}static fromJSON(t){return new Jr(t.width,t.height,t.widthSegments,t.heightSegments)}}var Qr="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",ta="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",ea="#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",na="#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",ia="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",ra="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",aa="vec3 transformed = vec3( position );",sa="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",oa="vec3 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}\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}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float 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\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\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 = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\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\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}\nfloat 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}\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",la="#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\t return 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 R21 = R12;\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",ca="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + 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 = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = 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",ua="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",ha="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",da="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",pa="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",fa="#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",ma="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",ga="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",va="#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_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",_a="#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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\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}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\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}",xa="#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\tvec2 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_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\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",ya="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",ba="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",Ma="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",wa="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",Sa="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",Ta="gl_FragColor = linearToOutputTexel( gl_FragColor );",Ea="vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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}",Aa="#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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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",Ca="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\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",La="#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",Pa="#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",Da="#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",Ra="#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",Ia="#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",Oa="#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",Na="#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",Ua="#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}",ka="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",za="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Fa="LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",Ba="varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, 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 GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",Va="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\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\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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",Ha="#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#if defined( 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, 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#endif",Ga="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",Wa="varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",ja="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Xa="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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",qa="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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 SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\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, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).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_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",$a="struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, 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( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, 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}",Ya="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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 *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\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",Za="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\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( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",Ka="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",Ja="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",Qa="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",ts="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",es="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",ns="#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\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#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",is="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",rs="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\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",as="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",ss="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",os="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",ls="#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\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",cs="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",us="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",hs="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",ds="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",ps="#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).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( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",fs="#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",ms="#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",gs="#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",vs="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",_s="#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",xs="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",ys="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",bs="#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",Ms="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",ws="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.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( 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( 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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",Ss="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",Ts="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",Es="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",As="#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",Cs="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",Ls="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",Ps="#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform 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 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 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 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 shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\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 shadow;\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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",Ds="#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying 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 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 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 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",Rs="#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#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\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",Is="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.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.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.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}",Os="#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",Ns="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",Us="#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",ks="#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",zs="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",Fs="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",Bs="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",Vs="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn 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}\nvec3 CustomToneMapping( vec3 color ) { return color; }",Hs="#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, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",Gs="#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\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 framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\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 ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",Ws="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",js="#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",Xs="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",qs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",$s="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",Ys="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",Zs="#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_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";const Ks="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}",Js="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Qs="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}",to="#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",eo="#include <common>\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 <skinbase_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}",no="#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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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 <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#endif\n}",io="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\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 <skinbase_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}",ro="#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 <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",ao="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",so="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 <encodings_fragment>\n}",oo="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\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>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_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}",lo="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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",co="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",uo="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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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, vUv2 );\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",ho="#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",po="#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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",fo="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\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 <morphcolor_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}",mo="#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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",go="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\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 <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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",vo="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\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\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 ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",_o="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",xo="#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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",yo="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",bo="#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define 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 SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\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_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Mo="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",wo="#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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",So="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>\nvoid main() {\n\t#include <color_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}",To="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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Eo="#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\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 <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Ao="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 <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Co="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}",Lo="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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Po={alphamap_fragment:Qr,alphamap_pars_fragment:ta,alphatest_fragment:ea,alphatest_pars_fragment:na,aomap_fragment:ia,aomap_pars_fragment:ra,begin_vertex:aa,beginnormal_vertex:sa,bsdfs:oa,iridescence_fragment:la,bumpmap_pars_fragment:ca,clipping_planes_fragment:ua,clipping_planes_pars_fragment:ha,clipping_planes_pars_vertex:da,clipping_planes_vertex:pa,color_fragment:fa,color_pars_fragment:ma,color_pars_vertex:ga,color_vertex:va,common:_a,cube_uv_reflection_fragment:xa,defaultnormal_vertex:ya,displacementmap_pars_vertex:ba,displacementmap_vertex:Ma,emissivemap_fragment:wa,emissivemap_pars_fragment:Sa,encodings_fragment:Ta,encodings_pars_fragment:Ea,envmap_fragment:Aa,envmap_common_pars_fragment:Ca,envmap_pars_fragment:La,envmap_pars_vertex:Pa,envmap_physical_pars_fragment:Ha,envmap_vertex:Da,fog_vertex:Ra,fog_pars_vertex:Ia,fog_fragment:Oa,fog_pars_fragment:Na,gradientmap_pars_fragment:Ua,lightmap_fragment:ka,lightmap_pars_fragment:za,lights_lambert_fragment:Fa,lights_lambert_pars_fragment:Ba,lights_pars_begin:Va,lights_toon_fragment:Ga,lights_toon_pars_fragment:Wa,lights_phong_fragment:ja,lights_phong_pars_fragment:Xa,lights_physical_fragment:qa,lights_physical_pars_fragment:$a,lights_fragment_begin:Ya,lights_fragment_maps:Za,lights_fragment_end:Ka,logdepthbuf_fragment:Ja,logdepthbuf_pars_fragment:Qa,logdepthbuf_pars_vertex:ts,logdepthbuf_vertex:es,map_fragment:ns,map_pars_fragment:is,map_particle_fragment:rs,map_particle_pars_fragment:as,metalnessmap_fragment:ss,metalnessmap_pars_fragment:os,morphcolor_vertex:ls,morphnormal_vertex:cs,morphtarget_pars_vertex:us,morphtarget_vertex:hs,normal_fragment_begin:ds,normal_fragment_maps:ps,normal_pars_fragment:fs,normal_pars_vertex:ms,normal_vertex:gs,normalmap_pars_fragment:vs,clearcoat_normal_fragment_begin:_s,clearcoat_normal_fragment_maps:xs,clearcoat_pars_fragment:ys,iridescence_pars_fragment:bs,output_fragment:Ms,packing:ws,premultiplied_alpha_fragment:Ss,project_vertex:Ts,dithering_fragment:Es,dithering_pars_fragment:As,roughnessmap_fragment:Cs,roughnessmap_pars_fragment:Ls,shadowmap_pars_fragment:Ps,shadowmap_pars_vertex:Ds,shadowmap_vertex:Rs,shadowmask_pars_fragment:Is,skinbase_vertex:Os,skinning_pars_vertex:Ns,skinning_vertex:Us,skinnormal_vertex:ks,specularmap_fragment:zs,specularmap_pars_fragment:Fs,tonemapping_fragment:Bs,tonemapping_pars_fragment:Vs,transmission_fragment:Hs,transmission_pars_fragment:Gs,uv_pars_fragment:Ws,uv_pars_vertex:js,uv_vertex:Xs,uv2_pars_fragment:qs,uv2_pars_vertex:$s,uv2_vertex:Ys,worldpos_vertex:Zs,background_vert:Ks,background_frag:Js,cube_vert:Qs,cube_frag:to,depth_vert:eo,depth_frag:no,distanceRGBA_vert:io,distanceRGBA_frag:ro,equirect_vert:ao,equirect_frag:so,linedashed_vert:oo,linedashed_frag:lo,meshbasic_vert:co,meshbasic_frag:uo,meshlambert_vert:ho,meshlambert_frag:po,meshmatcap_vert:fo,meshmatcap_frag:mo,meshnormal_vert:go,meshnormal_frag:vo,meshphong_vert:_o,meshphong_frag:xo,meshphysical_vert:yo,meshphysical_frag:bo,meshtoon_vert:Mo,meshtoon_frag:wo,points_vert:So,points_frag:To,shadow_vert:Eo,shadow_frag:Ao,sprite_vert:Co,sprite_frag:Lo},Do={common:{diffuse:{value:new xn(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new sn},uv2Transform:{value:new sn},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new an(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new xn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{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 xn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new sn}},sprite:{diffuse:{value:new xn(16777215)},opacity:{value:1},center:{value:new an(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new sn}}},Ro={basic:{uniforms:Pr([Do.common,Do.specularmap,Do.envmap,Do.aomap,Do.lightmap,Do.fog]),vertexShader:Po.meshbasic_vert,fragmentShader:Po.meshbasic_frag},lambert:{uniforms:Pr([Do.common,Do.specularmap,Do.envmap,Do.aomap,Do.lightmap,Do.emissivemap,Do.bumpmap,Do.normalmap,Do.displacementmap,Do.fog,Do.lights,{emissive:{value:new xn(0)}}]),vertexShader:Po.meshlambert_vert,fragmentShader:Po.meshlambert_frag},phong:{uniforms:Pr([Do.common,Do.specularmap,Do.envmap,Do.aomap,Do.lightmap,Do.emissivemap,Do.bumpmap,Do.normalmap,Do.displacementmap,Do.fog,Do.lights,{emissive:{value:new xn(0)},specular:{value:new xn(1118481)},shininess:{value:30}}]),vertexShader:Po.meshphong_vert,fragmentShader:Po.meshphong_frag},standard:{uniforms:Pr([Do.common,Do.envmap,Do.aomap,Do.lightmap,Do.emissivemap,Do.bumpmap,Do.normalmap,Do.displacementmap,Do.roughnessmap,Do.metalnessmap,Do.fog,Do.lights,{emissive:{value:new xn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Po.meshphysical_vert,fragmentShader:Po.meshphysical_frag},toon:{uniforms:Pr([Do.common,Do.aomap,Do.lightmap,Do.emissivemap,Do.bumpmap,Do.normalmap,Do.displacementmap,Do.gradientmap,Do.fog,Do.lights,{emissive:{value:new xn(0)}}]),vertexShader:Po.meshtoon_vert,fragmentShader:Po.meshtoon_frag},matcap:{uniforms:Pr([Do.common,Do.bumpmap,Do.normalmap,Do.displacementmap,Do.fog,{matcap:{value:null}}]),vertexShader:Po.meshmatcap_vert,fragmentShader:Po.meshmatcap_frag},points:{uniforms:Pr([Do.points,Do.fog]),vertexShader:Po.points_vert,fragmentShader:Po.points_frag},dashed:{uniforms:Pr([Do.common,Do.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Po.linedashed_vert,fragmentShader:Po.linedashed_frag},depth:{uniforms:Pr([Do.common,Do.displacementmap]),vertexShader:Po.depth_vert,fragmentShader:Po.depth_frag},normal:{uniforms:Pr([Do.common,Do.bumpmap,Do.normalmap,Do.displacementmap,{opacity:{value:1}}]),vertexShader:Po.meshnormal_vert,fragmentShader:Po.meshnormal_frag},sprite:{uniforms:Pr([Do.sprite,Do.fog]),vertexShader:Po.sprite_vert,fragmentShader:Po.sprite_frag},background:{uniforms:{uvTransform:{value:new sn},t2D:{value:null}},vertexShader:Po.background_vert,fragmentShader:Po.background_frag},cube:{uniforms:Pr([Do.envmap,{opacity:{value:1}}]),vertexShader:Po.cube_vert,fragmentShader:Po.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Po.equirect_vert,fragmentShader:Po.equirect_frag},distanceRGBA:{uniforms:Pr([Do.common,Do.displacementmap,{referencePosition:{value:new Dn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Po.distanceRGBA_vert,fragmentShader:Po.distanceRGBA_frag},shadow:{uniforms:Pr([Do.lights,Do.fog,{color:{value:new xn(0)},opacity:{value:1}}]),vertexShader:Po.shadow_vert,fragmentShader:Po.shadow_frag}};function Io(t,e,n,i,r,a){const s=new xn(0);let o,l,c=!0===r?0:1,u=null,h=0,f=null;function m(n,r){let a=!1,m=!0===r.isScene?r.background:null;m&&m.isTexture&&(m=e.get(m));const v=t.xr,_=v.getSession&&v.getSession();_&&"additive"===_.environmentBlendMode&&(m=null),null===m?g(s,c):m&&m.isColor&&(g(m,1),a=!0),(t.autoClear||a)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.mapping===at)?(void 0===l&&(l=new Tr(new Cr(1,1,1),new Nr({name:"BackgroundCubeMaterial",uniforms:Lr(Ro.cube.uniforms),vertexShader:Ro.cube.vertexShader,fragmentShader:Ro.cube.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),l.material.uniforms.envMap.value=m,l.material.uniforms.flipEnvMap.value=m.isCubeTexture&&!1===m.isRenderTargetTexture?-1:1,u===m&&h===m.version&&f===t.toneMapping||(l.material.needsUpdate=!0,u=m,h=m.version,f=t.toneMapping),l.layers.enableAll(),n.unshift(l,l.geometry,l.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new Tr(new Jr(2,2),new Nr({name:"BackgroundMaterial",uniforms:Lr(Ro.background.uniforms),vertexShader:Ro.background.vertexShader,fragmentShader:Ro.background.fragmentShader,side:d,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),u===m&&h===m.version&&f===t.toneMapping||(o.material.needsUpdate=!0,u=m,h=m.version,f=t.toneMapping),o.layers.enableAll(),n.unshift(o,o.geometry,o.material,0,0,null))}function g(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,a)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),c=e,g(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,g(s,c)},render:m}}function Oo(t,e,n,i){const r=t.getParameter(34921),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),s=i.isWebGL2||null!==a,o={},l=g(null);let c=l,u=!1;function h(e,i,r,a,o){let l=!1;if(s){const t=m(a,r,i);c!==t&&(c=t,p(c.object)),l=v(e,a,r,o),l&&_(e,a,r,o)}else{const t=!0===i.wireframe;c.geometry===a.id&&c.program===r.id&&c.wireframe===t||(c.geometry=a.id,c.program=r.id,c.wireframe=t,l=!0)}null!==o&&n.update(o,34963),(l||u)&&(u=!1,S(e,i,r,a),null!==o&&t.bindBuffer(34963,n.get(o).buffer))}function d(){return i.isWebGL2?t.createVertexArray():a.createVertexArrayOES()}function p(e){return i.isWebGL2?t.bindVertexArray(e):a.bindVertexArrayOES(e)}function f(e){return i.isWebGL2?t.deleteVertexArray(e):a.deleteVertexArrayOES(e)}function m(t,e,n){const i=!0===n.wireframe;let r=o[t.id];void 0===r&&(r={},o[t.id]=r);let a=r[e.id];void 0===a&&(a={},r[e.id]=a);let s=a[i];return void 0===s&&(s=g(d()),a[i]=s),s}function g(t){const e=[],n=[],i=[];for(let a=0;a<r;a++)e[a]=0,n[a]=0,i[a]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:i,object:t,attributes:{},index:null}}function v(t,e,n,i){const r=c.attributes,a=e.attributes;let s=0;const o=n.getAttributes();for(const l in o){const e=o[l];if(e.location>=0){const e=r[l];let n=a[l];if(void 0===n&&("instanceMatrix"===l&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===l&&t.instanceColor&&(n=t.instanceColor)),void 0===e)return!0;if(e.attribute!==n)return!0;if(n&&e.data!==n.data)return!0;s++}}return c.attributesNum!==s||c.index!==i}function _(t,e,n,i){const r={},a=e.attributes;let s=0;const o=n.getAttributes();for(const l in o){const e=o[l];if(e.location>=0){let e=a[l];void 0===e&&("instanceMatrix"===l&&t.instanceMatrix&&(e=t.instanceMatrix),"instanceColor"===l&&t.instanceColor&&(e=t.instanceColor));const n={};n.attribute=e,e&&e.data&&(n.data=e.data),r[l]=n,s++}}c.attributes=r,c.attributesNum=s,c.index=i}function x(){const t=c.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function y(t){b(t,0)}function b(n,r){const a=c.newAttributes,s=c.enabledAttributes,o=c.attributeDivisors;if(a[n]=1,0===s[n]&&(t.enableVertexAttribArray(n),s[n]=1),o[n]!==r){const a=i.isWebGL2?t:e.get("ANGLE_instanced_arrays");a[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),o[n]=r}}function M(){const e=c.newAttributes,n=c.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==e[i]&&(t.disableVertexAttribArray(i),n[i]=0)}function w(e,n,r,a,s,o){!0!==i.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,n,r,a,s,o):t.vertexAttribIPointer(e,n,r,s,o)}function S(r,a,s,o){if(!1===i.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;x();const l=o.attributes,c=s.getAttributes(),u=a.defaultAttributeValues;for(const e in c){const i=c[e];if(i.location>=0){let a=l[e];if(void 0===a&&("instanceMatrix"===e&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const e=a.normalized,s=a.itemSize,l=n.get(a);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement;if(a.isInterleavedBufferAttribute){const n=a.data,l=n.stride,d=a.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<i.locationSize;t++)b(i.location+t,n.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let t=0;t<i.locationSize;t++)y(i.location+t);t.bindBuffer(34962,c);for(let t=0;t<i.locationSize;t++)w(i.location+t,s/i.locationSize,u,e,l*h,(d+s/i.locationSize*t)*h)}else{if(a.isInstancedBufferAttribute){for(let t=0;t<i.locationSize;t++)b(i.location+t,a.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=a.meshPerAttribute*a.count)}else for(let t=0;t<i.locationSize;t++)y(i.location+t);t.bindBuffer(34962,c);for(let t=0;t<i.locationSize;t++)w(i.location+t,s/i.locationSize,u,e,s*h,s/i.locationSize*t*h)}}else if(void 0!==u){const n=u[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(i.location,n);break;case 3:t.vertexAttrib3fv(i.location,n);break;case 4:t.vertexAttrib4fv(i.location,n);break;default:t.vertexAttrib1fv(i.location,n)}}}}M()}function T(){C();for(const t in o){const e=o[t];for(const t in e){const n=e[t];for(const t in n)f(n[t].object),delete n[t];delete e[t]}delete o[t]}}function E(t){if(void 0===o[t.id])return;const e=o[t.id];for(const n in e){const t=e[n];for(const e in t)f(t[e].object),delete t[e];delete e[n]}delete o[t.id]}function A(t){for(const e in o){const n=o[e];if(void 0===n[t.id])continue;const i=n[t.id];for(const t in i)f(i[t].object),delete i[t];delete n[t.id]}}function C(){L(),u=!0,c!==l&&(c=l,p(c.object))}function L(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:C,resetDefaultState:L,dispose:T,releaseStatesOfGeometry:E,releaseStatesOfProgram:A,initAttributes:x,enableAttribute:y,disableUnusedAttributes:M}}function No(t,e,n,i){const r=i.isWebGL2;let a;function s(t){a=t}function o(e,i){t.drawArrays(a,e,i),n.update(i,a,1)}function l(i,s,o){if(0===o)return;let l,c;if(r)l=t,c="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](a,i,s,o),n.update(s,a,o)}this.setMode=s,this.render=o,this.renderInstances=l}function Uo(t,e,n){let i;function r(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const l=a(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const c=s||e.has("WEBGL_draw_buffers"),u=!0===n.logarithmicDepthBuffer,h=t.getParameter(34930),d=t.getParameter(35660),p=t.getParameter(3379),f=t.getParameter(34076),m=t.getParameter(34921),g=t.getParameter(36347),v=t.getParameter(36348),_=t.getParameter(36349),x=d>0,y=s||e.has("OES_texture_float"),b=x&&y,M=s?t.getParameter(36183):0;return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:f,maxAttributes:m,maxVertexUniforms:g,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:x,floatFragmentTextures:y,floatVertexTextures:b,maxSamples:M}}function ko(t){const e=this;let n=null,i=0,r=!1,a=!1;const s=new Xr,o=new sn,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(t,n,i,r){const a=null!==t?t.length:0;let c=null;if(0!==a){if(c=l.value,!0!==r||null===c){const e=i+4*a,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length<e)&&(c=new Float32Array(e));for(let n=0,l=i;n!==a;++n,l+=4)s.copy(t[n]).applyMatrix4(r,o),s.normal.toArray(c,l),c[l+3]=s.constant}l.value=c,l.needsUpdate=!0}return e.numPlanes=a,e.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,a){const s=0!==t.length||e||0!==i||r;return r=e,n=u(t,a,0),i=t.length,s},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1,c()},this.setState=function(e,s,o){const h=e.clippingPlanes,d=e.clipIntersection,p=e.clipShadows,f=t.get(e);if(!r||null===h||0===h.length||a&&!p)a?u(null):c();else{const t=a?0:i,e=4*t;let r=f.clippingState||null;l.value=r,r=u(h,s,e,o);for(let i=0;i!==e;++i)r[i]=n[i];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function zo(t){let e=new WeakMap;function n(t,e){return e===it?t.mapping=et:e===rt&&(t.mapping=nt),t}function i(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const a=i.mapping;if(a===it||a===rt){if(e.has(i)){const t=e.get(i).texture;return n(t,i.mapping)}{const a=i.image;if(a&&a.height>0){const s=new Hr(a.height/2);return s.fromEquirectangularTexture(t,i),e.set(i,s),i.addEventListener("dispose",r),n(s.texture,i.mapping)}return null}}}return i}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}Ro.physical={uniforms:Pr([Ro.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new an(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new xn(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new an},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new xn(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new xn(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Po.meshphysical_vert,fragmentShader:Po.meshphysical_frag};class Fo extends Ur{constructor(t=-1,e=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,a=n+t,s=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,a=r+t*this.view.width,s-=e*this.view.offsetY,o=s-e*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Bo=4,Vo=[.125,.215,.35,.446,.526,.582],Ho=20,Go=new Fo,Wo=new xn;let jo=null;const Xo=(1+Math.sqrt(5))/2,qo=1/Xo,$o=[new Dn(1,1,1),new Dn(-1,1,1),new Dn(1,1,-1),new Dn(-1,1,-1),new Dn(0,Xo,qo),new Dn(0,Xo,-qo),new Dn(qo,0,Xo),new Dn(-qo,0,Xo),new Dn(Xo,qo,0),new Dn(-Xo,qo,0)];class Yo{constructor(t){this._renderer=t,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(t,e=0,n=.1,i=100){jo=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=el(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=tl(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(jo),t.scissorTest=!1,Jo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===et||t.mapping===nt?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),jo=this._renderer.getRenderTarget();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:dt,minFilter:dt,generateMipmaps:!1,type:Mt,format:Ct,encoding:ve,depthBuffer:!1},i=Ko(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Ko(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Zo(i)),this._blurMaterial=Qo(i,t,e)}return i}_compileMaterial(t){const e=new Tr(this._lodPlanes[0],t);this._renderer.compile(e,Go)}_sceneToCubeUV(t,e,n,i){const r=90,a=1,s=new kr(r,a,e,n),o=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],c=this._renderer,u=c.autoClear,h=c.toneMapping;c.getClearColor(Wo),c.toneMapping=$,c.autoClear=!1;const d=new qi({name:"PMREM.Background",side:p,depthWrite:!1,depthTest:!1}),f=new Tr(new Cr,d);let m=!1;const g=t.background;g?g.isColor&&(d.color.copy(g),t.background=null,m=!0):(d.color.copy(Wo),m=!0);for(let p=0;p<6;p++){const e=p%3;0===e?(s.up.set(0,o[p],0),s.lookAt(l[p],0,0)):1===e?(s.up.set(0,0,o[p]),s.lookAt(0,l[p],0)):(s.up.set(0,o[p],0),s.lookAt(0,0,l[p]));const n=this._cubeSize;Jo(i,e*n,p>2?n:0,n,n),c.setRenderTarget(i),m&&c.render(f,s),c.render(t,s)}f.geometry.dispose(),f.material.dispose(),c.toneMapping=h,c.autoClear=u,t.background=g}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===et||t.mapping===nt;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=el()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=tl());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new Tr(this._lodPlanes[0],r),s=r.uniforms;s["envMap"].value=t;const o=this._cubeSize;Jo(e,0,0,3*o,2*o),n.setRenderTarget(e),n.render(a,Go)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const e=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),n=$o[(i-1)%$o.length];this._blur(t,i-1,i,e,n)}e.autoClear=n}_blur(t,e,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,i,"latitudinal",r),this._halfBlur(a,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,a,s){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const c=3,u=new Tr(this._lodPlanes[i],l),h=l.uniforms,d=this._sizeLods[n]-1,p=isFinite(r)?Math.PI/(2*d):2*Math.PI/(2*Ho-1),f=r/p,m=isFinite(r)?1+Math.floor(c*f):Ho;m>Ho&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ho}`);const g=[];let v=0;for(let M=0;M<Ho;++M){const t=M/f,e=Math.exp(-t*t/2);g.push(e),0===M?v+=e:M<m&&(v+=2*e)}for(let M=0;M<g.length;M++)g[M]=g[M]/v;h["envMap"].value=t.texture,h["samples"].value=m,h["weights"].value=g,h["latitudinal"].value="latitudinal"===a,s&&(h["poleAxis"].value=s);const{_lodMax:_}=this;h["dTheta"].value=p,h["mipInt"].value=_-n;const x=this._sizeLods[i],y=3*x*(i>_-Bo?i-_+Bo:0),b=4*(this._cubeSize-x);Jo(e,y,b,3*x,2*x),o.setRenderTarget(e),o.render(u,Go)}}function Zo(t){const e=[],n=[],i=[];let r=t;const a=t-Bo+1+Vo.length;for(let s=0;s<a;s++){const a=Math.pow(2,r);n.push(a);let o=1/a;s>t-Bo?o=Vo[s-t+Bo-1]:0===s&&(o=0),i.push(o);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,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),_=new Float32Array(m*p*d),x=new Float32Array(g*p*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];v.set(i,f*p*t),_.set(h,m*p*t);const r=[t,t,t,t,t,t];x.set(r,g*p*t)}const y=new or;y.setAttribute("position",new Zi(v,f)),y.setAttribute("uv",new Zi(_,m)),y.setAttribute("faceIndex",new Zi(x,g)),e.push(y),r>Bo&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function Ko(t,e,n){const i=new An(t,e,n);return i.texture.mapping=at,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Jo(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Qo(t,e,n){const i=new Float32Array(Ho),r=new Dn(0,1,0),a=new Nr({name:"SphericalGaussianBlur",defines:{n:Ho,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:t+".0"},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:nl(),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:m,depthTest:!1,depthWrite:!1});return a}function tl(){return new Nr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:nl(),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:m,depthTest:!1,depthWrite:!1})}function el(){return new Nr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:nl(),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:m,depthTest:!1,depthWrite:!1})}function nl(){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 il(t){let e=new WeakMap,n=null;function i(i){if(i&&i.isTexture){const s=i.mapping,o=s===it||s===rt,l=s===et||s===nt;if(o||l){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=e.get(i);return null===n&&(n=new Yo(t)),r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r),e.set(i,r),r.texture}if(e.has(i))return e.get(i).texture;{const s=i.image;if(o&&s&&s.height>0||l&&s&&r(s)){null===n&&(n=new Yo(t));const r=o?n.fromEquirectangular(i):n.fromCubemap(i);return e.set(i,r),i.addEventListener("dispose",a),r.texture}return null}}}return i}function r(t){let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}function a(t){const n=t.target;n.removeEventListener("dispose",a);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}function s(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}return{get:i,dispose:s}}function rl(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function al(t,e,n,i){const r={},a=new WeakMap;function s(t){const o=t.target;null!==o.index&&e.remove(o.index);for(const n in o.attributes)e.remove(o.attributes[n]);o.removeEventListener("dispose",s),delete r[o.id];const l=a.get(o);l&&(e.remove(l),a.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(t,e){return!0===r[e.id]||(e.addEventListener("dispose",s),r[e.id]=!0,n.memory.geometries++),e}function l(t){const n=t.attributes;for(const r in n)e.update(n[r],34962);const i=t.morphAttributes;for(const r in i){const t=i[r];for(let n=0,i=t.length;n<i;n++)e.update(t[n],34962)}}function c(t){const n=[],i=t.index,r=t.attributes.position;let s=0;if(null!==i){const t=i.array;s=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0],r=t[e+1],a=t[e+2];n.push(i,r,r,a,a,i)}}else{const t=r.array;s=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0,i=e+1,r=e+2;n.push(t,i,i,r,r,t)}}const o=new(on(n)?Ji:Ki)(n,1);o.version=s;const l=a.get(t);l&&e.remove(l),a.set(t,o)}function u(t){const e=a.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&c(t)}else c(t);return a.get(t)}return{get:o,update:l,getWireframeAttribute:u}}function sl(t,e,n,i){const r=i.isWebGL2;let a,s,o;function l(t){a=t}function c(t){s=t.type,o=t.bytesPerElement}function u(e,i){t.drawElements(a,i,s,e*o),n.update(i,a,1)}function h(i,l,c){if(0===c)return;let u,h;if(r)u=t,h="drawElementsInstanced";else if(u=e.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](a,l,s,i*o,c),n.update(l,a,c)}this.setMode=l,this.setIndex=c,this.render=u,this.renderInstances=h}function ol(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(t,e,i){switch(n.calls++,e){case 4:n.triangles+=i*(t/3);break;case 1:n.lines+=i*(t/2);break;case 3:n.lines+=i*(t-1);break;case 2:n.lines+=i*t;break;case 0:n.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e);break}}function r(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:r,update:i}}function ll(t,e){return t[0]-e[0]}function cl(t,e){return Math.abs(e[1])-Math.abs(t[1])}function ul(t,e,n){const i={},r=new Float32Array(8),a=new WeakMap,s=new En,o=[];for(let c=0;c<8;c++)o[c]=[c,0];function l(l,c,u,h){const d=l.morphTargetInfluences;if(!0===e.isWebGL2){const i=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,r=void 0!==i?i.length:0;let o=a.get(c);if(void 0===o||o.count!==r){void 0!==o&&o.texture.dispose();const t=void 0!==c.morphAttributes.position,n=void 0!==c.morphAttributes.normal,i=void 0!==c.morphAttributes.color,l=c.morphAttributes.position||[],u=c.morphAttributes.normal||[],h=c.morphAttributes.color||[];let d=0;!0===t&&(d=1),!0===n&&(d=2),!0===i&&(d=3);let f=c.attributes.position.count*d,m=1;f>e.maxTextureSize&&(m=Math.ceil(f/e.maxTextureSize),f=e.maxTextureSize);const g=new Float32Array(f*m*4*r),v=new Cn(g,f,m,r);v.type=bt,v.needsUpdate=!0;const _=4*d;for(let e=0;e<r;e++){const r=l[e],a=u[e],o=h[e],c=f*m*4*e;for(let e=0;e<r.count;e++){const l=e*_;!0===t&&(s.fromBufferAttribute(r,e),g[c+l+0]=s.x,g[c+l+1]=s.y,g[c+l+2]=s.z,g[c+l+3]=0),!0===n&&(s.fromBufferAttribute(a,e),g[c+l+4]=s.x,g[c+l+5]=s.y,g[c+l+6]=s.z,g[c+l+7]=0),!0===i&&(s.fromBufferAttribute(o,e),g[c+l+8]=s.x,g[c+l+9]=s.y,g[c+l+10]=s.z,g[c+l+11]=4===o.itemSize?s.w:1)}}function p(){v.dispose(),a.delete(c),c.removeEventListener("dispose",p)}o={count:r,texture:v,size:new an(f,m)},a.set(c,o),c.addEventListener("dispose",p)}let l=0;for(let t=0;t<d.length;t++)l+=d[t];const u=c.morphTargetsRelative?1:1-l;h.getUniforms().setValue(t,"morphTargetBaseInfluence",u),h.getUniforms().setValue(t,"morphTargetInfluences",d),h.getUniforms().setValue(t,"morphTargetsTexture",o.texture,n),h.getUniforms().setValue(t,"morphTargetsTextureSize",o.size)}else{const e=void 0===d?0:d.length;let n=i[c.id];if(void 0===n||n.length!==e){n=[];for(let t=0;t<e;t++)n[t]=[t,0];i[c.id]=n}for(let t=0;t<e;t++){const e=n[t];e[0]=t,e[1]=d[t]}n.sort(cl);for(let t=0;t<8;t++)t<e&&n[t][1]?(o[t][0]=n[t][0],o[t][1]=n[t][1]):(o[t][0]=Number.MAX_SAFE_INTEGER,o[t][1]=0);o.sort(ll);const a=c.morphAttributes.position,s=c.morphAttributes.normal;let l=0;for(let t=0;t<8;t++){const e=o[t],n=e[0],i=e[1];n!==Number.MAX_SAFE_INTEGER&&i?(a&&c.getAttribute("morphTarget"+t)!==a[n]&&c.setAttribute("morphTarget"+t,a[n]),s&&c.getAttribute("morphNormal"+t)!==s[n]&&c.setAttribute("morphNormal"+t,s[n]),r[t]=i,l+=i):(a&&!0===c.hasAttribute("morphTarget"+t)&&c.deleteAttribute("morphTarget"+t),s&&!0===c.hasAttribute("morphNormal"+t)&&c.deleteAttribute("morphNormal"+t),r[t]=0)}const u=c.morphTargetsRelative?1:1-l;h.getUniforms().setValue(t,"morphTargetBaseInfluence",u),h.getUniforms().setValue(t,"morphTargetInfluences",r)}}return{update:l}}function hl(t,e,n,i){let r=new WeakMap;function a(t){const a=i.render.frame,s=t.geometry,l=e.get(t,s);return r.get(l)!==a&&(e.update(l),r.set(l,a)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",o)&&t.addEventListener("dispose",o),n.update(t.instanceMatrix,34962),null!==t.instanceColor&&n.update(t.instanceColor,34962)),l}function s(){r=new WeakMap}function o(t){const e=t.target;e.removeEventListener("dispose",o),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:a,dispose:s}}const dl=new Tn,pl=new Cn,fl=new Ln,ml=new Vr,gl=[],vl=[],_l=new Float32Array(16),xl=new Float32Array(9),yl=new Float32Array(4);function bl(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let a=gl[r];if(void 0===a&&(a=new Float32Array(r),gl[r]=a),0!==e){i.toArray(a,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(a,r)}return a}function Ml(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function wl(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function Sl(t,e){let n=vl[e];void 0===n&&(n=new Int32Array(e),vl[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Tl(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function El(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ml(n,e))return;t.uniform2fv(this.addr,e),wl(n,e)}}function Al(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Ml(n,e))return;t.uniform3fv(this.addr,e),wl(n,e)}}function Cl(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ml(n,e))return;t.uniform4fv(this.addr,e),wl(n,e)}}function Ll(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Ml(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),wl(n,e)}else{if(Ml(n,i))return;yl.set(i),t.uniformMatrix2fv(this.addr,!1,yl),wl(n,i)}}function Pl(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Ml(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),wl(n,e)}else{if(Ml(n,i))return;xl.set(i),t.uniformMatrix3fv(this.addr,!1,xl),wl(n,i)}}function Dl(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Ml(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),wl(n,e)}else{if(Ml(n,i))return;_l.set(i),t.uniformMatrix4fv(this.addr,!1,_l),wl(n,i)}}function Rl(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Il(t,e){const n=this.cache;Ml(n,e)||(t.uniform2iv(this.addr,e),wl(n,e))}function Ol(t,e){const n=this.cache;Ml(n,e)||(t.uniform3iv(this.addr,e),wl(n,e))}function Nl(t,e){const n=this.cache;Ml(n,e)||(t.uniform4iv(this.addr,e),wl(n,e))}function Ul(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function kl(t,e){const n=this.cache;Ml(n,e)||(t.uniform2uiv(this.addr,e),wl(n,e))}function zl(t,e){const n=this.cache;Ml(n,e)||(t.uniform3uiv(this.addr,e),wl(n,e))}function Fl(t,e){const n=this.cache;Ml(n,e)||(t.uniform4uiv(this.addr,e),wl(n,e))}function Bl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2D(e||dl,r)}function Vl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||fl,r)}function Hl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||ml,r)}function Gl(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||pl,r)}function Wl(t){switch(t){case 5126:return Tl;case 35664:return El;case 35665:return Al;case 35666:return Cl;case 35674:return Ll;case 35675:return Pl;case 35676:return Dl;case 5124:case 35670:return Rl;case 35667:case 35671:return Il;case 35668:case 35672:return Ol;case 35669:case 35673:return Nl;case 5125:return Ul;case 36294:return kl;case 36295:return zl;case 36296:return Fl;case 35678:case 36198:case 36298:case 36306:case 35682:return Bl;case 35679:case 36299:case 36307:return Vl;case 35680:case 36300:case 36308:case 36293:return Hl;case 36289:case 36303:case 36311:case 36292:return Gl}}function jl(t,e){t.uniform1fv(this.addr,e)}function Xl(t,e){const n=bl(e,this.size,2);t.uniform2fv(this.addr,n)}function ql(t,e){const n=bl(e,this.size,3);t.uniform3fv(this.addr,n)}function $l(t,e){const n=bl(e,this.size,4);t.uniform4fv(this.addr,n)}function Yl(t,e){const n=bl(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Zl(t,e){const n=bl(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Kl(t,e){const n=bl(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Jl(t,e){t.uniform1iv(this.addr,e)}function Ql(t,e){t.uniform2iv(this.addr,e)}function tc(t,e){t.uniform3iv(this.addr,e)}function ec(t,e){t.uniform4iv(this.addr,e)}function nc(t,e){t.uniform1uiv(this.addr,e)}function ic(t,e){t.uniform2uiv(this.addr,e)}function rc(t,e){t.uniform3uiv(this.addr,e)}function ac(t,e){t.uniform4uiv(this.addr,e)}function sc(t,e,n){const i=e.length,r=Sl(n,i);t.uniform1iv(this.addr,r);for(let a=0;a!==i;++a)n.setTexture2D(e[a]||dl,r[a])}function oc(t,e,n){const i=e.length,r=Sl(n,i);t.uniform1iv(this.addr,r);for(let a=0;a!==i;++a)n.setTexture3D(e[a]||fl,r[a])}function lc(t,e,n){const i=e.length,r=Sl(n,i);t.uniform1iv(this.addr,r);for(let a=0;a!==i;++a)n.setTextureCube(e[a]||ml,r[a])}function cc(t,e,n){const i=e.length,r=Sl(n,i);t.uniform1iv(this.addr,r);for(let a=0;a!==i;++a)n.setTexture2DArray(e[a]||pl,r[a])}function uc(t){switch(t){case 5126:return jl;case 35664:return Xl;case 35665:return ql;case 35666:return $l;case 35674:return Yl;case 35675:return Zl;case 35676:return Kl;case 5124:case 35670:return Jl;case 35667:case 35671:return Ql;case 35668:case 35672:return tc;case 35669:case 35673:return ec;case 5125:return nc;case 36294:return ic;case 36295:return rc;case 36296:return ac;case 35678:case 36198:case 36298:case 36306:case 35682:return sc;case 35679:case 36299:case 36307:return oc;case 35680:case 36300:case 36308:case 36293:return lc;case 36289:case 36303:case 36311:case 36292:return cc}}class hc{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=Wl(e.type)}}class dc{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=uc(e.type)}}class pc{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const a=i[r];a.setValue(t,e[a.id],n)}}}const fc=/(\w+)(\])?(\[|\.)?/g;function mc(t,e){t.seq.push(e),t.map[e.id]=e}function gc(t,e,n){const i=t.name,r=i.length;fc.lastIndex=0;while(1){const a=fc.exec(i),s=fc.lastIndex;let o=a[1];const l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===r){mc(n,void 0===c?new hc(o,t,e):new dc(o,t,e));break}{const t=n.map;let e=t[o];void 0===e&&(e=new pc(o),mc(n,e)),n=e}}}class vc{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,35718);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i),r=t.getUniformLocation(e,n.name);gc(n,r,this)}}setValue(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,a=e.length;r!==a;++r){const a=e[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];r.id in e&&n.push(r)}return n}}function _c(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}let xc=0;function yc(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let s=r;s<a;s++){const t=s+1;i.push(`${t===e?">":" "} ${t}: ${n[s]}`)}return i.join("\n")}function bc(t){switch(t){case ve:return["Linear","( value )"];case _e:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function Mc(t,e,n){const i=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const a=/ERROR: 0:(\d+)/.exec(r);if(a){const i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+yc(t.getShaderSource(e),i)}return r}function wc(t,e){const n=bc(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Sc(t,e){let n;switch(e){case Y:n="Linear";break;case Z:n="Reinhard";break;case K:n="OptimizedCineon";break;case J:n="ACESFilmic";break;case Q:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Tc(t){const e=[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return e.filter(Cc).join("\n")}function Ec(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}function Ac(t,e){const n={},i=t.getProgramParameter(e,35721);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r),a=i.name;let s=1;35674===i.type&&(s=2),35675===i.type&&(s=3),35676===i.type&&(s=4),n[a]={type:i.type,location:t.getAttribLocation(e,a),locationSize:s}}return n}function Cc(t){return""!==t}function Lc(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Pc(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Dc=/^[ \t]*#include +<([\w\d./]+)>/gm;function Rc(t){return t.replace(Dc,Ic)}function Ic(t,e){const n=Po[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Rc(n)}const Oc=/#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 Nc(t){return t.replace(Oc,Uc)}function Uc(t,e,n,i){let r="";for(let a=parseInt(e);a<parseInt(n);a++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function kc(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function zc(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===c?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===u?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===h&&(e="SHADOWMAP_TYPE_VSM"),e}function Fc(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case et:case nt:e="ENVMAP_TYPE_CUBE";break;case at:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Bc(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case nt:e="ENVMAP_MODE_REFRACTION";break}return e}function Vc(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case j:e="ENVMAP_BLENDING_MULTIPLY";break;case X:e="ENVMAP_BLENDING_MIX";break;case q:e="ENVMAP_BLENDING_ADD";break}return e}function Hc(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,i=1/e,r=1/(3*Math.max(Math.pow(2,n),112));return{texelWidth:r,texelHeight:i,maxMip:n}}function Gc(t,e,n,i){const r=t.getContext(),a=n.defines;let s=n.vertexShader,o=n.fragmentShader;const l=zc(n),c=Fc(n),u=Bc(n),h=Vc(n),d=Hc(n),p=n.isWebGL2?"":Tc(n),f=Ec(a),m=r.createProgram();let g,v,_=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter(Cc).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter(Cc).join("\n"),v.length>0&&(v+="\n")):(g=[kc(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",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.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",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.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#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.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Cc).join("\n"),v=[p,kc(n),"#define SHADER_NAME "+n.shaderName,f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",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.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==$?"#define TONE_MAPPING":"",n.toneMapping!==$?Po["tonemapping_pars_fragment"]:"",n.toneMapping!==$?Sc("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Po["encodings_pars_fragment"],wc("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Cc).join("\n")),s=Rc(s),s=Lc(s,n),s=Pc(s,n),o=Rc(o),o=Lc(o,n),o=Pc(o,n),s=Nc(s),o=Nc(o),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(_="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in",n.glslVersion===Ce?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Ce?"":"#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 x=_+g+s,y=_+v+o,b=_c(r,35633,x),M=_c(r,35632,y);if(r.attachShader(m,b),r.attachShader(m,M),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(b).trim(),n=r.getShaderInfoLog(M).trim();let i=!0,a=!0;if(!1===r.getProgramParameter(m,35714)){i=!1;const e=Mc(r,b,"vertex"),n=Mc(r,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(m,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+n)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==n||(a=!1);a&&(this.diagnostics={runnable:i,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:n,prefix:v}})}let w,S;return r.deleteShader(b),r.deleteShader(M),this.getUniforms=function(){return void 0===w&&(w=new vc(r,m)),w},this.getAttributes=function(){return void 0===S&&(S=Ac(r,m)),S},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=xc++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=M,this}let Wc=0;class jc{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(r)&&(a.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const n of e)n.usedTimes--,0===n.usedTimes&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new Xc(t),e.set(t,n)),n}}class Xc{constructor(t){this.id=Wc++,this.code=t,this.usedTimes=0}}function qc(t,e,n,i,r,a,s){const o=new xi,l=new jc,c=[],u=r.isWebGL2,h=r.logarithmicDepthBuffer,d=r.vertexTextures;let m=r.precision;const v={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 _(a,o,c,_,x){const y=_.fog,b=x.geometry,M=a.isMeshStandardMaterial?_.environment:null,w=(a.isMeshStandardMaterial?n:e).get(a.envMap||M),S=w&&w.mapping===at?w.image.height:null,T=v[a.type];null!==a.precision&&(m=r.getMaxPrecision(a.precision),m!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",m,"instead."));const E=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,A=void 0!==E?E.length:0;let C,L,P,D,R=0;if(void 0!==b.morphAttributes.position&&(R=1),void 0!==b.morphAttributes.normal&&(R=2),void 0!==b.morphAttributes.color&&(R=3),T){const t=Ro[T];C=t.vertexShader,L=t.fragmentShader}else C=a.vertexShader,L=a.fragmentShader,l.update(a),P=l.getVertexShaderID(a),D=l.getFragmentShaderID(a);const I=t.getRenderTarget(),O=a.alphaTest>0,N=a.clearcoat>0,U=a.iridescence>0,k={isWebGL2:u,shaderID:T,shaderName:a.type,vertexShader:C,fragmentShader:L,defines:a.defines,customVertexShaderID:P,customFragmentShaderID:D,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:m,instancing:!0===x.isInstancedMesh,instancingColor:!0===x.isInstancedMesh&&null!==x.instanceColor,supportsVertexTextures:d,outputEncoding:null===I?t.outputEncoding:!0===I.isXRRenderTarget?I.texture.encoding:ve,map:!!a.map,matcap:!!a.matcap,envMap:!!w,envMapMode:w&&w.mapping,envMapCubeUVHeight:S,lightMap:!!a.lightMap,aoMap:!!a.aoMap,emissiveMap:!!a.emissiveMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,objectSpaceNormalMap:a.normalMapType===Me,tangentSpaceNormalMap:a.normalMapType===be,decodeVideoTexture:!!a.map&&!0===a.map.isVideoTexture&&a.map.encoding===_e,clearcoat:N,clearcoatMap:N&&!!a.clearcoatMap,clearcoatRoughnessMap:N&&!!a.clearcoatRoughnessMap,clearcoatNormalMap:N&&!!a.clearcoatNormalMap,iridescence:U,iridescenceMap:U&&!!a.iridescenceMap,iridescenceThicknessMap:U&&!!a.iridescenceThicknessMap,displacementMap:!!a.displacementMap,roughnessMap:!!a.roughnessMap,metalnessMap:!!a.metalnessMap,specularMap:!!a.specularMap,specularIntensityMap:!!a.specularIntensityMap,specularColorMap:!!a.specularColorMap,opaque:!1===a.transparent&&a.blending===g,alphaMap:!!a.alphaMap,alphaTest:O,gradientMap:!!a.gradientMap,sheen:a.sheen>0,sheenColorMap:!!a.sheenColorMap,sheenRoughnessMap:!!a.sheenRoughnessMap,transmission:a.transmission>0,transmissionMap:!!a.transmissionMap,thicknessMap:!!a.thicknessMap,combine:a.combine,vertexTangents:!!a.normalMap&&!!b.attributes.tangent,vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,vertexUvs:!!a.map||!!a.bumpMap||!!a.normalMap||!!a.specularMap||!!a.alphaMap||!!a.emissiveMap||!!a.roughnessMap||!!a.metalnessMap||!!a.clearcoatMap||!!a.clearcoatRoughnessMap||!!a.clearcoatNormalMap||!!a.iridescenceMap||!!a.iridescenceThicknessMap||!!a.displacementMap||!!a.transmissionMap||!!a.thicknessMap||!!a.specularIntensityMap||!!a.specularColorMap||!!a.sheenColorMap||!!a.sheenRoughnessMap,uvsVertexOnly:!(a.map||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a.emissiveMap||a.roughnessMap||a.metalnessMap||a.clearcoatNormalMap||a.iridescenceMap||a.iridescenceThicknessMap||a.transmission>0||a.transmissionMap||a.thicknessMap||a.specularIntensityMap||a.specularColorMap||a.sheen>0||a.sheenColorMap||a.sheenRoughnessMap)&&!!a.displacementMap,fog:!!y,useFog:!0===a.fog,fogExp2:y&&y.isFogExp2,flatShading:!!a.flatShading,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:A,morphTextureStride:R,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:a.toneMapped?t.toneMapping:$,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===f,flipSided:a.side===p,useDepthPacking:!!a.depthPacking,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:a.extensions&&a.extensions.derivatives,extensionFragDepth:a.extensions&&a.extensions.fragDepth,extensionDrawBuffers:a.extensions&&a.extensions.drawBuffers,extensionShaderTextureLOD:a.extensions&&a.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:a.customProgramCacheKey()};return k}function x(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(y(n,e),b(n,e),n.push(t.outputEncoding)),n.push(e.customProgramCacheKey),n.join()}function y(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}function b(t,e){o.disableAll(),e.isWebGL2&&o.enable(0),e.supportsVertexTextures&&o.enable(1),e.instancing&&o.enable(2),e.instancingColor&&o.enable(3),e.map&&o.enable(4),e.matcap&&o.enable(5),e.envMap&&o.enable(6),e.lightMap&&o.enable(7),e.aoMap&&o.enable(8),e.emissiveMap&&o.enable(9),e.bumpMap&&o.enable(10),e.normalMap&&o.enable(11),e.objectSpaceNormalMap&&o.enable(12),e.tangentSpaceNormalMap&&o.enable(13),e.clearcoat&&o.enable(14),e.clearcoatMap&&o.enable(15),e.clearcoatRoughnessMap&&o.enable(16),e.clearcoatNormalMap&&o.enable(17),e.iridescence&&o.enable(18),e.iridescenceMap&&o.enable(19),e.iridescenceThicknessMap&&o.enable(20),e.displacementMap&&o.enable(21),e.specularMap&&o.enable(22),e.roughnessMap&&o.enable(23),e.metalnessMap&&o.enable(24),e.gradientMap&&o.enable(25),e.alphaMap&&o.enable(26),e.alphaTest&&o.enable(27),e.vertexColors&&o.enable(28),e.vertexAlphas&&o.enable(29),e.vertexUvs&&o.enable(30),e.vertexTangents&&o.enable(31),e.uvsVertexOnly&&o.enable(32),t.push(o.mask),o.disableAll(),e.fog&&o.enable(0),e.useFog&&o.enable(1),e.flatShading&&o.enable(2),e.logarithmicDepthBuffer&&o.enable(3),e.skinning&&o.enable(4),e.morphTargets&&o.enable(5),e.morphNormals&&o.enable(6),e.morphColors&&o.enable(7),e.premultipliedAlpha&&o.enable(8),e.shadowMapEnabled&&o.enable(9),e.physicallyCorrectLights&&o.enable(10),e.doubleSided&&o.enable(11),e.flipSided&&o.enable(12),e.useDepthPacking&&o.enable(13),e.dithering&&o.enable(14),e.specularIntensityMap&&o.enable(15),e.specularColorMap&&o.enable(16),e.transmission&&o.enable(17),e.transmissionMap&&o.enable(18),e.thicknessMap&&o.enable(19),e.sheen&&o.enable(20),e.sheenColorMap&&o.enable(21),e.sheenRoughnessMap&&o.enable(22),e.decodeVideoTexture&&o.enable(23),e.opaque&&o.enable(24),t.push(o.mask)}function M(t){const e=v[t.type];let n;if(e){const t=Ro[e];n=Rr.clone(t.uniforms)}else n=t.uniforms;return n}function w(e,n){let i;for(let t=0,r=c.length;t<r;t++){const e=c[t];if(e.cacheKey===n){i=e,++i.usedTimes;break}}return void 0===i&&(i=new Gc(t,n,e,a),c.push(i)),i}function S(t){if(0===--t.usedTimes){const e=c.indexOf(t);c[e]=c[c.length-1],c.pop(),t.destroy()}}function T(t){l.remove(t)}function E(){l.dispose()}return{getParameters:_,getProgramCacheKey:x,getUniforms:M,acquireProgram:w,releaseProgram:S,releaseShaderCache:T,programs:c,dispose:E}}function $c(){let t=new WeakMap;function e(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n}function n(e){t.delete(e)}function i(e,n,i){t.get(e)[n]=i}function r(){t=new WeakMap}return{get:e,remove:n,update:i,dispose:r}}function Yc(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Zc(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Kc(){const t=[];let e=0;const n=[],i=[],r=[];function a(){e=0,n.length=0,i.length=0,r.length=0}function s(n,i,r,a,s,o){let l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:a,renderOrder:n.renderOrder,z:s,group:o},t[e]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=o),e++,l}function o(t,e,a,o,l,c){const u=s(t,e,a,o,l,c);a.transmission>0?i.push(u):!0===a.transparent?r.push(u):n.push(u)}function l(t,e,a,o,l,c){const u=s(t,e,a,o,l,c);a.transmission>0?i.unshift(u):!0===a.transparent?r.unshift(u):n.unshift(u)}function c(t,e){n.length>1&&n.sort(t||Yc),i.length>1&&i.sort(e||Zc),r.length>1&&r.sort(e||Zc)}function u(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}}return{opaque:n,transmissive:i,transparent:r,init:a,push:o,unshift:l,finish:u,sort:c}}function Jc(){let t=new WeakMap;function e(e,n){const i=t.get(e);let r;return void 0===i?(r=new Kc,t.set(e,[r])):n>=i.length?(r=new Kc,i.push(r)):r=i[n],r}function n(){t=new WeakMap}return{get:e,dispose:n}}function Qc(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Dn,color:new xn};break;case"SpotLight":n={position:new Dn,direction:new Dn,color:new xn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Dn,color:new xn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Dn,skyColor:new xn,groundColor:new xn};break;case"RectAreaLight":n={color:new xn,position:new Dn,halfWidth:new Dn,halfHeight:new Dn};break}return t[e.id]=n,n}}}function tu(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new an};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new an};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new an,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let eu=0;function nu(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function iu(t,e){const n=new Qc,i=tu(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let u=0;u<9;u++)r.probe.push(new Dn);const a=new Dn,s=new li,o=new li;function l(a,s){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let u=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,x=0;a.sort(nu);const y=!0!==s?Math.PI:1;for(let t=0,e=a.length;t<e;t++){const e=a[t],s=e.color,b=e.intensity,M=e.distance,w=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)o+=s.r*b*y,l+=s.g*b*y,c+=s.b*b*y;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],b);else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*y),e.castShadow){const t=e.shadow,n=i.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,r.directionalShadow[u]=n,r.directionalShadowMap[u]=w,r.directionalShadowMatrix[u]=e.shadow.matrix,m++}r.directional[u]=t,u++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(s).multiplyScalar(b*y),t.distance=M,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,r.spot[d]=t;const a=e.shadow;if(e.map&&(r.spotLightMap[_]=e.map,_++,a.updateMatrices(e),e.castShadow&&x++),r.spotLightMatrix[d]=a.matrix,e.castShadow){const t=i.get(e);t.shadowBias=a.bias,t.shadowNormalBias=a.normalBias,t.shadowRadius=a.radius,t.shadowMapSize=a.mapSize,r.spotShadow[d]=t,r.spotShadowMap[d]=w,v++}d++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(s).multiplyScalar(b),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[p]=t,p++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*y),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=i.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,r.pointShadow[h]=n,r.pointShadowMap[h]=w,r.pointShadowMatrix[h]=e.shadow.matrix,g++}r.point[h]=t,h++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(b*y),t.groundColor.copy(e.groundColor).multiplyScalar(b*y),r.hemi[f]=t,f++}}p>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Do.LTC_FLOAT_1,r.rectAreaLTC2=Do.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Do.LTC_HALF_1,r.rectAreaLTC2=Do.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;const b=r.hash;b.directionalLength===u&&b.pointLength===h&&b.spotLength===d&&b.rectAreaLength===p&&b.hemiLength===f&&b.numDirectionalShadows===m&&b.numPointShadows===g&&b.numSpotShadows===v&&b.numSpotMaps===_||(r.directional.length=u,r.spot.length=d,r.rectArea.length=p,r.point.length=h,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+_-x,r.spotLightMap.length=_,r.numSpotLightShadowsWithMaps=x,b.directionalLength=u,b.pointLength=h,b.spotLength=d,b.rectAreaLength=p,b.hemiLength=f,b.numDirectionalShadows=m,b.numPointShadows=g,b.numSpotShadows=v,b.numSpotMaps=_,r.version=eu++)}function c(t,e){let n=0,i=0,l=0,c=0,u=0;const h=e.matrixWorldInverse;for(let d=0,p=t.length;d<p;d++){const e=t[d];if(e.isDirectionalLight){const t=r.directional[n];t.direction.setFromMatrixPosition(e.matrixWorld),a.setFromMatrixPosition(e.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(h),n++}else if(e.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(e.matrixWorld),t.position.applyMatrix4(h),t.direction.setFromMatrixPosition(e.matrixWorld),a.setFromMatrixPosition(e.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(h),l++}else if(e.isRectAreaLight){const t=r.rectArea[c];t.position.setFromMatrixPosition(e.matrixWorld),t.position.applyMatrix4(h),o.identity(),s.copy(e.matrixWorld),s.premultiply(h),o.extractRotation(s),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),t.halfWidth.applyMatrix4(o),t.halfHeight.applyMatrix4(o),c++}else if(e.isPointLight){const t=r.point[i];t.position.setFromMatrixPosition(e.matrixWorld),t.position.applyMatrix4(h),i++}else if(e.isHemisphereLight){const t=r.hemi[u];t.direction.setFromMatrixPosition(e.matrixWorld),t.direction.transformDirection(h),u++}}}return{setup:l,setupView:c,state:r}}function ru(t,e){const n=new iu(t,e),i=[],r=[];function a(){i.length=0,r.length=0}function s(t){i.push(t)}function o(t){r.push(t)}function l(t){n.setup(i,t)}function c(t){n.setupView(i,t)}const u={lightsArray:i,shadowsArray:r,lights:n};return{init:a,state:u,setupLights:l,setupLightsView:c,pushLight:s,pushShadow:o}}function au(t,e){let n=new WeakMap;function i(i,r=0){const a=n.get(i);let s;return void 0===a?(s=new ru(t,e),n.set(i,[s])):r>=a.length?(s=new ru(t,e),a.push(s)):s=a[r],s}function r(){n=new WeakMap}return{get:i,dispose:r}}class su extends Xi{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=xe,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class ou extends Xi{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Dn,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const lu="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",cu="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}";function uu(t,e,n){let i=new Yr;const r=new an,a=new an,s=new En,o=new su({depthPacking:ye}),l=new ou,u={},g=n.maxTextureSize,v={0:p,1:d,2:f},_=new Nr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new an},radius:{value:4}},vertexShader:lu,fragmentShader:cu}),x=_.clone();x.defines.HORIZONTAL_PASS=1;const y=new or;y.setAttribute("position",new Zi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Tr(y,_),M=this;function w(n,i){const a=e.update(b);_.defines.VSM_SAMPLES!==n.blurSamples&&(_.defines.VSM_SAMPLES=n.blurSamples,x.defines.VSM_SAMPLES=n.blurSamples,_.needsUpdate=!0,x.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new An(r.x,r.y)),_.uniforms.shadow_pass.value=n.map.texture,_.uniforms.resolution.value=n.mapSize,_.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,a,_,b,null),x.uniforms.shadow_pass.value=n.mapPass.texture,x.uniforms.resolution.value=n.mapSize,x.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,a,x,b,null)}function S(e,n,i,r,a,s){let c=null;const d=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(c=void 0!==d?d:!0===i.isPointLight?l:o,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const t=c.uuid,e=n.uuid;let i=u[t];void 0===i&&(i={},u[t]=i);let r=i[e];void 0===r&&(r=c.clone(),i[e]=r),c=r}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=s===h?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:v[n.side],c.alphaMap=n.alphaMap,c.alphaTest=n.alphaTest,c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.displacementMap=n.displacementMap,c.displacementScale=n.displacementScale,c.displacementBias=n.displacementBias,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=r,c.farDistance=a),c}function T(n,r,a,s,o){if(!1===n.visible)return;const l=n.layers.test(r.layers);if(l&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===h)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=r[c.materialIndex];if(u&&u.visible){const e=S(n,u,s,a.near,a.far,o);t.renderBufferDirect(a,null,i,e,n,c)}}}else if(r.visible){const e=S(n,r,s,a.near,a.far,o);t.renderBufferDirect(a,null,i,e,n,null)}}const c=n.children;for(let t=0,e=c.length;t<e;t++)T(c[t],r,a,s,o)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=c,this.render=function(e,n,o){if(!1===M.enabled)return;if(!1===M.autoUpdate&&!1===M.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),c=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),d=t.state;d.setBlending(m),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let p=0,f=e.length;p<f;p++){const l=e[p],c=l.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;r.copy(c.mapSize);const u=c.getFrameExtents();if(r.multiply(u),a.copy(c.mapSize),(r.x>g||r.y>g)&&(r.x>g&&(a.x=Math.floor(g/u.x),r.x=a.x*u.x,c.mapSize.x=a.x),r.y>g&&(a.y=Math.floor(g/u.y),r.y=a.y*u.y,c.mapSize.y=a.y)),null===c.map){const t=this.type!==h?{minFilter:ct,magFilter:ct}:{};c.map=new An(r.x,r.y,t),c.map.texture.name=l.name+".shadowMap",c.camera.updateProjectionMatrix()}t.setRenderTarget(c.map),t.clear();const f=c.getViewportCount();for(let t=0;t<f;t++){const e=c.getViewport(t);s.set(a.x*e.x,a.y*e.y,a.x*e.z,a.y*e.w),d.viewport(s),c.updateMatrices(l,t),i=c.getFrustum(),T(n,o,c.camera,l,this.type)}!0!==c.isPointLightShadow&&this.type===h&&w(c,o),c.needsUpdate=!1}M.needsUpdate=!1,t.setRenderTarget(l,c,u)}}function hu(t,e,n){const i=n.isWebGL2;function r(){let e=!1;const n=new En;let i=null;const r=new En(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,a,s,o){!0===o&&(e*=s,i*=s,a*=s),n.set(e,i,a,s),!1===r.equals(n)&&(t.clearColor(e,i,a,s),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}}function a(){let e=!1,n=null,i=null,r=null;return{setTest:function(t){t?St(2929):Tt(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case k:t.depthFunc(512);break;case z:t.depthFunc(519);break;case F:t.depthFunc(513);break;case B:t.depthFunc(515);break;case V:t.depthFunc(514);break;case H:t.depthFunc(518);break;case G:t.depthFunc(516);break;case W:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}}function c(){let e=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(t){e||(t?St(2960):Tt(2960))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,s){i===e&&r===n&&a===s||(t.stencilFunc(e,n,s),i=e,r=n,a=s)},setOp:function(e,n,i){s===e&&o===n&&l===i||(t.stencilOp(e,n,i),s=e,o=n,l=i)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null}}}const u=new r,h=new a,d=new c,j=new WeakMap,X=new WeakMap;let q={},$={},Y=new WeakMap,Z=[],K=null,J=!1,Q=null,tt=null,et=null,nt=null,it=null,rt=null,at=null,st=!1,ot=null,lt=null,ct=null,ut=null,ht=null;const dt=t.getParameter(35661);let pt=!1,ft=0;const mt=t.getParameter(7938);-1!==mt.indexOf("WebGL")?(ft=parseFloat(/^WebGL (\d)/.exec(mt)[1]),pt=ft>=1):-1!==mt.indexOf("OpenGL ES")&&(ft=parseFloat(/^OpenGL ES (\d)/.exec(mt)[1]),pt=ft>=2);let gt=null,vt={};const _t=t.getParameter(3088),xt=t.getParameter(2978),yt=(new En).fromArray(_t),bt=(new En).fromArray(xt);function Mt(e,n,i){const r=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let s=0;s<i;s++)t.texImage2D(n+s,0,6408,1,1,0,6408,5121,r);return a}const wt={};function St(e){!0!==q[e]&&(t.enable(e),q[e]=!0)}function Tt(e){!1!==q[e]&&(t.disable(e),q[e]=!1)}function Et(e,n){return $[e]!==n&&(t.bindFramebuffer(e,n),$[e]=n,i&&(36009===e&&($[36160]=n),36160===e&&($[36009]=n)),!0)}function At(i,r){let a=Z,s=!1;if(i)if(a=Y.get(r),void 0===a&&(a=[],Y.set(r,a)),i.isWebGLMultipleRenderTargets){const t=i.texture;if(a.length!==t.length||36064!==a[0]){for(let e=0,n=t.length;e<n;e++)a[e]=36064+e;a.length=t.length,s=!0}}else 36064!==a[0]&&(a[0]=36064,s=!0);else 1029!==a[0]&&(a[0]=1029,s=!0);s&&(n.isWebGL2?t.drawBuffers(a):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(a))}function Ct(e){return K!==e&&(t.useProgram(e),K=e,!0)}wt[3553]=Mt(3553,3553,1),wt[34067]=Mt(34067,34069,6),u.setClear(0,0,0,1),h.setClear(1),d.setClear(0),St(2929),h.setFunc(B),It(!1),Ot(o),St(2884),Dt(m);const Lt={[b]:32774,[M]:32778,[w]:32779};if(i)Lt[S]=32775,Lt[T]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(Lt[S]=t.MIN_EXT,Lt[T]=t.MAX_EXT)}const Pt={[E]:0,[A]:1,[C]:768,[P]:770,[U]:776,[O]:774,[R]:772,[L]:769,[D]:771,[N]:775,[I]:773};function Dt(e,n,i,r,a,s,o,l){if(e!==m){if(!1===J&&(St(3042),J=!0),e===y)a=a||n,s=s||i,o=o||r,n===tt&&a===it||(t.blendEquationSeparate(Lt[n],Lt[a]),tt=n,it=a),i===et&&r===nt&&s===rt&&o===at||(t.blendFuncSeparate(Pt[i],Pt[r],Pt[s],Pt[o]),et=i,nt=r,rt=s,at=o),Q=e,st=null;else if(e!==Q||l!==st){if(tt===b&&it===b||(t.blendEquation(32774),tt=b,it=b),l)switch(e){case g:t.blendFuncSeparate(1,771,1,771);break;case v:t.blendFunc(1,1);break;case _:t.blendFuncSeparate(0,769,0,1);break;case x:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}else switch(e){case g:t.blendFuncSeparate(770,771,1,771);break;case v:t.blendFunc(770,1);break;case _:t.blendFuncSeparate(0,769,0,1);break;case x:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}et=null,nt=null,rt=null,at=null,Q=e,st=l}}else!0===J&&(Tt(3042),J=!1)}function Rt(t,e){t.side===f?Tt(2884):St(2884);let n=t.side===p;e&&(n=!n),It(n),t.blending===g&&!1===t.transparent?Dt(m):Dt(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),h.setFunc(t.depthFunc),h.setTest(t.depthTest),h.setMask(t.depthWrite),u.setMask(t.colorWrite);const i=t.stencilWrite;d.setTest(i),i&&(d.setMask(t.stencilWriteMask),d.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),d.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Ut(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?St(32926):Tt(32926)}function It(e){ot!==e&&(e?t.frontFace(2304):t.frontFace(2305),ot=e)}function Ot(e){e!==s?(St(2884),e!==lt&&(e===o?t.cullFace(1029):e===l?t.cullFace(1028):t.cullFace(1032))):Tt(2884),lt=e}function Nt(e){e!==ct&&(pt&&t.lineWidth(e),ct=e)}function Ut(e,n,i){e?(St(32823),ut===n&&ht===i||(t.polygonOffset(n,i),ut=n,ht=i)):Tt(32823)}function kt(t){t?St(3089):Tt(3089)}function zt(e){void 0===e&&(e=33984+dt-1),gt!==e&&(t.activeTexture(e),gt=e)}function Ft(e,n){null===gt&&zt();let i=vt[gt];void 0===i&&(i={type:void 0,texture:void 0},vt[gt]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||wt[e]),i.type=e,i.texture=n)}function Bt(){const e=vt[gt];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)}function Vt(){try{t.compressedTexImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Ht(){try{t.texSubImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Gt(){try{t.texSubImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Wt(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function jt(){try{t.texStorage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Xt(){try{t.texStorage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function qt(){try{t.texImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function $t(){try{t.texImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Yt(e){!1===yt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),yt.copy(e))}function Zt(e){!1===bt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),bt.copy(e))}function Kt(e,n){let i=X.get(n);void 0===i&&(i=new WeakMap,X.set(n,i));let r=i.get(e);void 0===r&&(r=t.getUniformBlockIndex(n,e.name),i.set(e,r))}function Jt(e,n){const i=X.get(n),r=i.get(e);j.get(e)!==r&&(t.uniformBlockBinding(n,r,e.__bindingPointIndex),j.set(e,r))}function Qt(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),!0===i&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),q={},gt=null,vt={},$={},Y=new WeakMap,Z=[],K=null,J=!1,Q=null,tt=null,et=null,nt=null,it=null,rt=null,at=null,st=!1,ot=null,lt=null,ct=null,ut=null,ht=null,yt.set(0,0,t.canvas.width,t.canvas.height),bt.set(0,0,t.canvas.width,t.canvas.height),u.reset(),h.reset(),d.reset()}return{buffers:{color:u,depth:h,stencil:d},enable:St,disable:Tt,bindFramebuffer:Et,drawBuffers:At,useProgram:Ct,setBlending:Dt,setMaterial:Rt,setFlipSided:It,setCullFace:Ot,setLineWidth:Nt,setPolygonOffset:Ut,setScissorTest:kt,activeTexture:zt,bindTexture:Ft,unbindTexture:Bt,compressedTexImage2D:Vt,texImage2D:qt,texImage3D:$t,updateUBOMapping:Kt,uniformBlockBinding:Jt,texStorage2D:jt,texStorage3D:Xt,texSubImage2D:Ht,texSubImage3D:Gt,compressedTexSubImage2D:Wt,scissor:Yt,viewport:Zt,reset:Qt}}function du(t,e,n,i,r,a,s){const o=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,u=r.maxTextureSize,h=r.maxSamples,d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,p=/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let m;const g=new WeakMap;let v=!1;try{v="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(rt){}function _(t,e){return v?new OffscreenCanvas(t,e):ln("canvas")}function x(t,e,n,i){let r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?Qe:Math.floor,a=i(r*t.width),s=i(r*t.height);void 0===m&&(m=_(a,s));const o=n?_(a,s):m;o.width=a,o.height=s;const l=o.getContext("2d");return l.drawImage(t,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+s+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return Ke(t.width)&&Ke(t.height)}function b(t){return!o&&(t.wrapS!==ot||t.wrapT!==ot||t.minFilter!==ct&&t.minFilter!==dt)}function M(t,e){return t.generateMipmaps&&e&&t.minFilter!==ct&&t.minFilter!==dt}function w(e){t.generateMipmap(e)}function S(n,i,r,a,s=!1){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return 6403===i&&(5126===r&&(l=33326),5131===r&&(l=33325),5121===r&&(l=33321)),33319===i&&(5126===r&&(l=33328),5131===r&&(l=33327),5121===r&&(l=33323)),6408===i&&(5126===r&&(l=34836),5131===r&&(l=34842),5121===r&&(l=a===_e&&!1===s?35907:32856),32819===r&&(l=32854),32820===r&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||e.get("EXT_color_buffer_float"),l}function T(t,e,n){return!0===M(t,n)||t.isFramebufferTexture&&t.minFilter!==ct&&t.minFilter!==dt?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function E(t){return t===ct||t===ut||t===ht?9728:9729}function A(t){const e=t.target;e.removeEventListener("dispose",A),L(e),e.isVideoTexture&&f.delete(e)}function C(t){const e=t.target;e.removeEventListener("dispose",C),D(e)}function L(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=g.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&P(t),0===Object.keys(r).length&&g.delete(n)}i.remove(t)}function P(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source,a=g.get(r);delete a[n.__cacheKey],s.memory.textures--}function D(e){const n=e.texture,r=i.get(e),a=i.get(n);if(void 0!==a.__webglTexture&&(t.deleteTexture(a.__webglTexture),s.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let i=0;i<6;i++)t.deleteFramebuffer(r.__webglFramebuffer[i]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[i]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e<r.__webglColorRenderbuffer.length;e++)r.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(r.__webglColorRenderbuffer[e]);r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer)}if(e.isWebGLMultipleRenderTargets)for(let o=0,l=n.length;o<l;o++){const e=i.get(n[o]);e.__webglTexture&&(t.deleteTexture(e.__webglTexture),s.memory.textures--),i.remove(n[o])}i.remove(n),i.remove(e)}let R=0;function I(){R=0}function O(){const t=R;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),R+=1,t}function N(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.encoding),e.join()}function U(t,e){const r=i.get(t);if(t.isVideoTexture&&nt(t),!1===t.isRenderTargetTexture&&t.version>0&&r.__version!==t.version){const n=t.image;if(null===n)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==n.complete)return void W(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function k(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?W(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))}function z(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?W(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))}function F(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?j(r,t,e):(n.activeTexture(33984+e),n.bindTexture(34067,r.__webglTexture))}const B={[st]:10497,[ot]:33071,[lt]:33648},V={[ct]:9728,[ut]:9984,[ht]:9986,[dt]:9729,[pt]:9985,[ft]:9987};function H(n,a,s){if(s?(t.texParameteri(n,10242,B[a.wrapS]),t.texParameteri(n,10243,B[a.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,B[a.wrapR]),t.texParameteri(n,10240,V[a.magFilter]),t.texParameteri(n,10241,V[a.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),a.wrapS===ot&&a.wrapT===ot||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,E(a.magFilter)),t.texParameteri(n,10241,E(a.minFilter)),a.minFilter!==ct&&a.minFilter!==dt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const s=e.get("EXT_texture_filter_anisotropic");if(a.type===bt&&!1===e.has("OES_texture_float_linear"))return;if(!1===o&&a.type===Mt&&!1===e.has("OES_texture_half_float_linear"))return;(a.anisotropy>1||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function G(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",A));const r=n.source;let a=g.get(r);void 0===a&&(a={},g.set(r,a));const o=N(n);if(o!==e.__cacheKey){void 0===a[o]&&(a[o]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,i=!0),a[o].usedTimes++;const r=a[e.__cacheKey];void 0!==r&&(a[e.__cacheKey].usedTimes--,0===r.usedTimes&&P(n)),e.__cacheKey=o,e.__webglTexture=a[o].texture}return i}function W(e,i,r){let s=3553;i.isDataArrayTexture&&(s=35866),i.isData3DTexture&&(s=32879);const l=G(e,i),c=i.source;if(n.activeTexture(33984+r),n.bindTexture(s,e.__webglTexture),c.version!==c.__currentVersion||!0===l){t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment),t.pixelStorei(37443,0);const e=b(i)&&!1===y(i.image);let r=x(i.image,e,!1,u);r=it(i,r);const h=y(r)||o,d=a.convert(i.format,i.encoding);let p,f=a.convert(i.type),m=S(i.internalFormat,d,f,i.encoding,i.isVideoTexture);H(s,i,h);const g=i.mipmaps,v=o&&!0!==i.isVideoTexture,_=void 0===c.__currentVersion||!0===l,E=T(i,r,h);if(i.isDepthTexture)m=6402,o?m=i.type===bt?36012:i.type===yt?33190:i.type===Tt?35056:33189:i.type===bt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===Dt&&6402===m&&i.type!==_t&&i.type!==yt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=yt,f=a.convert(i.type)),i.format===Rt&&6402===m&&(m=34041,i.type!==Tt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Tt,f=a.convert(i.type))),_&&(v?n.texStorage2D(3553,1,m,r.width,r.height):n.texImage2D(3553,0,m,r.width,r.height,0,d,f,null));else if(i.isDataTexture)if(g.length>0&&h){v&&_&&n.texStorage2D(3553,E,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)p=g[t],v?n.texSubImage2D(3553,t,0,0,p.width,p.height,d,f,p.data):n.texImage2D(3553,t,m,p.width,p.height,0,d,f,p.data);i.generateMipmaps=!1}else v?(_&&n.texStorage2D(3553,E,m,r.width,r.height),n.texSubImage2D(3553,0,0,0,r.width,r.height,d,f,r.data)):n.texImage2D(3553,0,m,r.width,r.height,0,d,f,r.data);else if(i.isCompressedTexture){v&&_&&n.texStorage2D(3553,E,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)p=g[t],i.format!==Ct?null!==d?v?n.compressedTexSubImage2D(3553,t,0,0,p.width,p.height,d,p.data):n.compressedTexImage2D(3553,t,m,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):v?n.texSubImage2D(3553,t,0,0,p.width,p.height,d,f,p.data):n.texImage2D(3553,t,m,p.width,p.height,0,d,f,p.data)}else if(i.isDataArrayTexture)v?(_&&n.texStorage3D(35866,E,m,r.width,r.height,r.depth),n.texSubImage3D(35866,0,0,0,0,r.width,r.height,r.depth,d,f,r.data)):n.texImage3D(35866,0,m,r.width,r.height,r.depth,0,d,f,r.data);else if(i.isData3DTexture)v?(_&&n.texStorage3D(32879,E,m,r.width,r.height,r.depth),n.texSubImage3D(32879,0,0,0,0,r.width,r.height,r.depth,d,f,r.data)):n.texImage3D(32879,0,m,r.width,r.height,r.depth,0,d,f,r.data);else if(i.isFramebufferTexture){if(_)if(v)n.texStorage2D(3553,E,m,r.width,r.height);else{let t=r.width,e=r.height;for(let i=0;i<E;i++)n.texImage2D(3553,i,m,t,e,0,d,f,null),t>>=1,e>>=1}}else if(g.length>0&&h){v&&_&&n.texStorage2D(3553,E,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)p=g[t],v?n.texSubImage2D(3553,t,0,0,d,f,p):n.texImage2D(3553,t,m,d,f,p);i.generateMipmaps=!1}else v?(_&&n.texStorage2D(3553,E,m,r.width,r.height),n.texSubImage2D(3553,0,0,0,d,f,r)):n.texImage2D(3553,0,m,d,f,r);M(i,h)&&w(s),c.__currentVersion=c.version,i.onUpdate&&i.onUpdate(i)}e.__version=i.version}function j(e,i,r){if(6!==i.image.length)return;const s=G(e,i),l=i.source;if(n.activeTexture(33984+r),n.bindTexture(34067,e.__webglTexture),l.version!==l.__currentVersion||!0===s){t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment),t.pixelStorei(37443,0);const e=i.isCompressedTexture||i.image[0].isCompressedTexture,r=i.image[0]&&i.image[0].isDataTexture,u=[];for(let t=0;t<6;t++)u[t]=e||r?r?i.image[t].image:i.image[t]:x(i.image[t],!1,!0,c),u[t]=it(i,u[t]);const h=u[0],d=y(h)||o,p=a.convert(i.format,i.encoding),f=a.convert(i.type),m=S(i.internalFormat,p,f,i.encoding),g=o&&!0!==i.isVideoTexture,v=void 0===l.__currentVersion||!0===s;let _,b=T(i,h,d);if(H(34067,i,d),e){g&&v&&n.texStorage2D(34067,b,m,h.width,h.height);for(let t=0;t<6;t++){_=u[t].mipmaps;for(let e=0;e<_.length;e++){const r=_[e];i.format!==Ct?null!==p?g?n.compressedTexSubImage2D(34069+t,e,0,0,r.width,r.height,p,r.data):n.compressedTexImage2D(34069+t,e,m,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g?n.texSubImage2D(34069+t,e,0,0,r.width,r.height,p,f,r.data):n.texImage2D(34069+t,e,m,r.width,r.height,0,p,f,r.data)}}}else{_=i.mipmaps,g&&v&&(_.length>0&&b++,n.texStorage2D(34067,b,m,u[0].width,u[0].height));for(let t=0;t<6;t++)if(r){g?n.texSubImage2D(34069+t,0,0,0,u[t].width,u[t].height,p,f,u[t].data):n.texImage2D(34069+t,0,m,u[t].width,u[t].height,0,p,f,u[t].data);for(let e=0;e<_.length;e++){const i=_[e],r=i.image[t].image;g?n.texSubImage2D(34069+t,e+1,0,0,r.width,r.height,p,f,r.data):n.texImage2D(34069+t,e+1,m,r.width,r.height,0,p,f,r.data)}}else{g?n.texSubImage2D(34069+t,0,0,0,p,f,u[t]):n.texImage2D(34069+t,0,m,p,f,u[t]);for(let e=0;e<_.length;e++){const i=_[e];g?n.texSubImage2D(34069+t,e+1,0,0,p,f,i.image[t]):n.texImage2D(34069+t,e+1,m,p,f,i.image[t])}}}M(i,d)&&w(34067),l.__currentVersion=l.version,i.onUpdate&&i.onUpdate(i)}e.__version=i.version}function X(e,r,s,o,l){const c=a.convert(s.format,s.encoding),u=a.convert(s.type),h=S(s.internalFormat,c,u,s.encoding),p=i.get(r);p.__hasExternalTextures||(32879===l||35866===l?n.texImage3D(l,0,h,r.width,r.height,r.depth,0,c,u,null):n.texImage2D(l,0,h,r.width,r.height,0,c,u,null)),n.bindFramebuffer(36160,e),et(r)?d.framebufferTexture2DMultisampleEXT(36160,o,l,i.get(s).__webglTexture,0,tt(r)):t.framebufferTexture2D(36160,o,l,i.get(s).__webglTexture,0),n.bindFramebuffer(36160,null)}function q(e,n,i){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){let r=33189;if(i||et(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===bt?r=36012:e.type===yt&&(r=33190));const i=tt(n);et(n)?d.renderbufferStorageMultisampleEXT(36161,i,r,n.width,n.height):t.renderbufferStorageMultisample(36161,i,r,n.width,n.height)}else t.renderbufferStorage(36161,r,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){const r=tt(n);i&&!1===et(n)?t.renderbufferStorageMultisample(36161,r,35056,n.width,n.height):et(n)?d.renderbufferStorageMultisampleEXT(36161,r,35056,n.width,n.height):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let r=0;r<e.length;r++){const s=e[r],o=a.convert(s.format,s.encoding),l=a.convert(s.type),c=S(s.internalFormat,o,l,s.encoding),u=tt(n);i&&!1===et(n)?t.renderbufferStorageMultisample(36161,u,c,n.width,n.height):et(n)?d.renderbufferStorageMultisampleEXT(36161,u,c,n.width,n.height):t.renderbufferStorage(36161,c,n.width,n.height)}}t.bindRenderbuffer(36161,null)}function $(e,r){const a=r&&r.isWebGLCubeRenderTarget;if(a)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),U(r.depthTexture,0);const s=i.get(r.depthTexture).__webglTexture,o=tt(r);if(r.depthTexture.format===Dt)et(r)?d.framebufferTexture2DMultisampleEXT(36160,36096,3553,s,0,o):t.framebufferTexture2D(36160,36096,3553,s,0);else{if(r.depthTexture.format!==Rt)throw new Error("Unknown depthTexture format");et(r)?d.framebufferTexture2DMultisampleEXT(36160,33306,3553,s,0,o):t.framebufferTexture2D(36160,33306,3553,s,0)}}function Y(e){const r=i.get(e),a=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");$(r.__webglFramebuffer,e)}else if(a){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)n.bindFramebuffer(36160,r.__webglFramebuffer[i]),r.__webglDepthbuffer[i]=t.createRenderbuffer(),q(r.__webglDepthbuffer[i],e,!1)}else n.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),q(r.__webglDepthbuffer,e,!1);n.bindFramebuffer(36160,null)}function Z(t,e,n){const r=i.get(t);void 0!==e&&X(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==n&&Y(t)}function K(e){const l=e.texture,c=i.get(e),u=i.get(l);e.addEventListener("dispose",C),!0!==e.isWebGLMultipleRenderTargets&&(void 0===u.__webglTexture&&(u.__webglTexture=t.createTexture()),u.__version=l.version,s.memory.textures++);const h=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=y(e)||o;if(h){c.__webglFramebuffer=[];for(let e=0;e<6;e++)c.__webglFramebuffer[e]=t.createFramebuffer()}else{if(c.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){const n=e.texture;for(let e=0,r=n.length;e<r;e++){const r=i.get(n[e]);void 0===r.__webglTexture&&(r.__webglTexture=t.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&e.samples>0&&!1===et(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,c.__webglMultisampledFramebuffer);for(let n=0;n<i.length;n++){const r=i[n];c.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(36161,c.__webglColorRenderbuffer[n]);const s=a.convert(r.format,r.encoding),o=a.convert(r.type),l=S(r.internalFormat,s,o,r.encoding),u=tt(e);t.renderbufferStorageMultisample(36161,u,l,e.width,e.height),t.framebufferRenderbuffer(36160,36064+n,36161,c.__webglColorRenderbuffer[n])}t.bindRenderbuffer(36161,null),e.depthBuffer&&(c.__webglDepthRenderbuffer=t.createRenderbuffer(),q(c.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(36160,null)}}if(h){n.bindTexture(34067,u.__webglTexture),H(34067,l,p);for(let t=0;t<6;t++)X(c.__webglFramebuffer[t],e,l,36064,34069+t);M(l,p)&&w(34067),n.unbindTexture()}else if(d){const t=e.texture;for(let r=0,a=t.length;r<a;r++){const a=t[r],s=i.get(a);n.bindTexture(3553,s.__webglTexture),H(3553,a,p),X(c.__webglFramebuffer,e,a,36064+r,3553),M(a,p)&&w(3553)}n.unbindTexture()}else{let t=3553;(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(o?t=e.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(t,u.__webglTexture),H(t,l,p),X(c.__webglFramebuffer,e,l,36064,t),M(l,p)&&w(t),n.unbindTexture()}e.depthBuffer&&Y(e)}function J(t){const e=y(t)||o,r=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let a=0,s=r.length;a<s;a++){const s=r[a];if(M(s,e)){const e=t.isWebGLCubeRenderTarget?34067:3553,r=i.get(s).__webglTexture;n.bindTexture(e,r),w(e),n.unbindTexture()}}}function Q(e){if(o&&e.samples>0&&!1===et(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],a=e.width,s=e.height;let o=16384;const l=[],c=e.stencilBuffer?33306:36096,u=i.get(e),h=!0===e.isWebGLMultipleRenderTargets;if(h)for(let e=0;e<r.length;e++)n.bindFramebuffer(36160,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+e,36161,null),n.bindFramebuffer(36160,u.__webglFramebuffer),t.framebufferTexture2D(36009,36064+e,3553,null,0);n.bindFramebuffer(36008,u.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,u.__webglFramebuffer);for(let n=0;n<r.length;n++){l.push(36064+n),e.depthBuffer&&l.push(c);const d=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===d&&(e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024)),h&&t.framebufferRenderbuffer(36008,36064,36161,u.__webglColorRenderbuffer[n]),!0===d&&(t.invalidateFramebuffer(36008,[c]),t.invalidateFramebuffer(36009,[c])),h){const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(36009,36064,3553,e,0)}t.blitFramebuffer(0,0,a,s,0,0,a,s,o,9728),p&&t.invalidateFramebuffer(36008,l)}if(n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),h)for(let e=0;e<r.length;e++){n.bindFramebuffer(36160,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+e,36161,u.__webglColorRenderbuffer[e]);const a=i.get(r[e]).__webglTexture;n.bindFramebuffer(36160,u.__webglFramebuffer),t.framebufferTexture2D(36009,36064+e,3553,a,0)}n.bindFramebuffer(36009,u.__webglMultisampledFramebuffer)}}function tt(t){return Math.min(h,t.samples)}function et(t){const n=i.get(t);return o&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function nt(t){const e=s.render.frame;f.get(t)!==e&&(f.set(t,e),t.update())}function it(t,n){const i=t.encoding,r=t.format,a=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Le||i!==ve&&(i===_e?!1===o?!0===e.has("EXT_sRGB")&&r===Ct?(t.format=Le,t.minFilter=dt,t.generateMipmaps=!1):n=bn.sRGBToLinear(n):r===Ct&&a===mt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",i)),n}this.allocateTextureUnit=O,this.resetTextureUnits=I,this.setTexture2D=U,this.setTexture2DArray=k,this.setTexture3D=z,this.setTextureCube=F,this.rebindTextures=Z,this.setupRenderTarget=K,this.updateRenderTargetMipmap=J,this.updateMultisampleRenderTarget=Q,this.setupDepthRenderbuffer=Y,this.setupFrameBufferTexture=X,this.useMultisampledRTT=et}function pu(t,e,n){const i=n.isWebGL2;function r(n,r=null){let a;if(n===mt)return 5121;if(n===wt)return 32819;if(n===St)return 32820;if(n===gt)return 5120;if(n===vt)return 5122;if(n===_t)return 5123;if(n===xt)return 5124;if(n===yt)return 5125;if(n===bt)return 5126;if(n===Mt)return i?5131:(a=e.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(n===Et)return 6406;if(n===Ct)return 6408;if(n===Lt)return 6409;if(n===Pt)return 6410;if(n===Dt)return 6402;if(n===Rt)return 34041;if(n===It)return 6403;if(n===At)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(n===Le)return a=e.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(n===Ot)return 36244;if(n===Nt)return 33319;if(n===Ut)return 33320;if(n===kt)return 36249;if(n===zt||n===Ft||n===Bt||n===Vt)if(r===_e){if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(n===zt)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ft)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Bt)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Vt)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(a=e.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(n===zt)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ft)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Bt)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Vt)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===Ht||n===Gt||n===Wt||n===jt){if(a=e.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(n===Ht)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Gt)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Wt)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===jt)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===Xt)return a=e.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===qt||n===$t){if(a=e.get("WEBGL_compressed_texture_etc"),null===a)return null;if(n===qt)return r===_e?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(n===$t)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(n===Yt||n===Zt||n===Kt||n===Jt||n===Qt||n===te||n===ee||n===ne||n===ie||n===re||n===ae||n===se||n===oe||n===le){if(a=e.get("WEBGL_compressed_texture_astc"),null===a)return null;if(n===Yt)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Zt)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Kt)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Jt)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Qt)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===te)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===ee)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ne)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===ie)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===re)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ae)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===se)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===oe)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===le)return r===_e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===ce){if(a=e.get("EXT_texture_compression_bptc"),null===a)return null;if(n===ce)return r===_e?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}return n===Tt?i?34042:(a=e.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[n]?t[n]:null}return{convert:r}}class fu extends kr{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class mu extends Ii{constructor(){super(),this.isGroup=!0,this.type="Group"}}const gu={type:"move"};class vu{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new mu,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 mu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Dn,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Dn),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new mu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Dn,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Dn),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,a=null;const s=this._targetRay,o=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){a=!0;for(const a of t.hand.values()){const t=e.getJointPose(a,n);if(void 0===l.joints[a.jointName]){const t=new mu;t.matrixAutoUpdate=!1,t.visible=!1,l.joints[a.jointName]=t,l.add(t)}const i=l.joints[a.jointName];null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=t.radius),i.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position),o=.02,c=.005;l.inputState.pinching&&s>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&s<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),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));null!==s&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),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,this.dispatchEvent(gu)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}}class _u extends Tn{constructor(t,e,n,i,r,a,s,o,l,c){if(c=void 0!==c?c:Dt,c!==Dt&&c!==Rt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===Dt&&(n=yt),void 0===n&&c===Rt&&(n=Tt),super(null,i,r,a,s,o,c,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==s?s:ct,this.minFilter=void 0!==o?o:ct,this.flipY=!1,this.generateMipmaps=!1}}class xu extends Pe{constructor(t,e){super();const n=this;let i=null,r=1,a=null,s="local-floor",o=null,l=null,c=null,u=null,h=null,d=null;const p=e.getContextAttributes();let f=null,m=null;const g=[],v=[],_=new kr;_.layers.enable(1),_.viewport=new En;const x=new kr;x.layers.enable(2),x.viewport=new En;const y=[_,x],b=new fu;b.layers.enable(1),b.layers.enable(2);let M=null,w=null;function S(t){const e=v.indexOf(t.inputSource);if(-1===e)return;const n=g[e];void 0!==n&&n.dispatchEvent({type:t.type,data:t.inputSource})}function T(){i.removeEventListener("select",S),i.removeEventListener("selectstart",S),i.removeEventListener("selectend",S),i.removeEventListener("squeeze",S),i.removeEventListener("squeezestart",S),i.removeEventListener("squeezeend",S),i.removeEventListener("end",T),i.removeEventListener("inputsourceschange",E);for(let t=0;t<g.length;t++){const e=v[t];null!==e&&(v[t]=null,g[t].disconnect(e))}M=null,w=null,t.setRenderTarget(f),h=null,u=null,c=null,i=null,m=null,I.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function E(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],i=v.indexOf(n);i>=0&&(v[i]=null,g[i].dispatchEvent({type:"disconnected",data:n}))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=v.indexOf(n);if(-1===i){for(let t=0;t<g.length;t++){if(t>=v.length){v.push(n),i=t;break}if(null===v[t]){v[t]=n,i=t;break}}if(-1===i)break}const r=g[i];r&&r.dispatchEvent({type:"connected",data:n})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=g[t];return void 0===e&&(e=new vu,g[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=g[t];return void 0===e&&(e=new vu,g[t]=e),e.getGripSpace()},this.getHand=function(t){let e=g[t];return void 0===e&&(e=new vu,g[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){s=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o||a},this.setReferenceSpace=function(t){o=t},this.getBaseLayer=function(){return null!==u?u:h},this.getBinding=function(){return c},this.getFrame=function(){return d},this.getSession=function(){return i},this.setSession=async function(l){if(i=l,null!==i){if(f=t.getRenderTarget(),i.addEventListener("select",S),i.addEventListener("selectstart",S),i.addEventListener("selectend",S),i.addEventListener("squeeze",S),i.addEventListener("squeezestart",S),i.addEventListener("squeezeend",S),i.addEventListener("end",T),i.addEventListener("inputsourceschange",E),!0!==p.xrCompatible&&await e.makeXRCompatible(),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||p.antialias,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:r};h=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:h}),m=new An(h.framebufferWidth,h.framebufferHeight,{format:Ct,type:mt,encoding:t.outputEncoding,stencilBuffer:p.stencil})}else{let n=null,a=null,s=null;p.depth&&(s=p.stencil?35056:33190,n=p.stencil?Rt:Dt,a=p.stencil?Tt:yt);const o={colorFormat:32856,depthFormat:s,scaleFactor:r};c=new XRWebGLBinding(i,e),u=c.createProjectionLayer(o),i.updateRenderState({layers:[u]}),m=new An(u.textureWidth,u.textureHeight,{format:Ct,type:mt,depthTexture:new _u(u.textureWidth,u.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0});const l=t.properties.get(m);l.__ignoreDepthValues=u.ignoreDepthValues}m.isXRRenderTarget=!0,this.setFoveation(1),o=null,a=await i.requestReferenceSpace(s),I.setContext(i),I.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const A=new Dn,C=new Dn;function L(t,e,n){A.setFromMatrixPosition(e.matrixWorld),C.setFromMatrixPosition(n.matrixWorld);const i=A.distanceTo(C),r=e.projectionMatrix.elements,a=n.projectionMatrix.elements,s=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(a[8]+1)/a[0],d=s*u,p=s*h,f=i/(-u+h),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=s+f,v=o+f,_=d-m,x=p+(i-m),y=l*o/v*g,b=c*o/v*g;t.projectionMatrix.makePerspective(_,x,y,b,g,v)}function P(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;b.near=x.near=_.near=t.near,b.far=x.far=_.far=t.far,M===b.near&&w===b.far||(i.updateRenderState({depthNear:b.near,depthFar:b.far}),M=b.near,w=b.far);const e=t.parent,n=b.cameras;P(b,e);for(let i=0;i<n.length;i++)P(n[i],e);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),t.matrix.copy(b.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale);const r=t.children;for(let i=0,a=r.length;i<a;i++)r[i].updateMatrixWorld(!0);2===n.length?L(b,_,x):b.projectionMatrix.copy(_.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){return null!==u?u.fixedFoveation:null!==h?h.fixedFoveation:void 0},this.setFoveation=function(t){null!==u&&(u.fixedFoveation=t),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=t)};let D=null;function R(e,n){if(l=n.getViewerPose(o||a),d=n,null!==l){const e=l.views;null!==h&&(t.setRenderTargetFramebuffer(m,h.framebuffer),t.setRenderTarget(m));let n=!1;e.length!==b.cameras.length&&(b.cameras.length=0,n=!0);for(let i=0;i<e.length;i++){const r=e[i];let a=null;if(null!==h)a=h.getViewport(r);else{const e=c.getViewSubImage(u,r);a=e.viewport,0===i&&(t.setRenderTargetTextures(m,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(m))}let s=y[i];void 0===s&&(s=new kr,s.layers.enable(i),s.viewport=new En,y[i]=s),s.matrix.fromArray(r.transform.matrix),s.projectionMatrix.fromArray(r.projectionMatrix),s.viewport.set(a.x,a.y,a.width,a.height),0===i&&b.matrix.copy(s.matrix),!0===n&&b.cameras.push(s)}}for(let t=0;t<g.length;t++){const e=v[t],i=g[t];null!==e&&void 0!==i&&i.update(e,n,o||a)}D&&D(e,n),d=null}const I=new Zr;I.setAnimationLoop(R),this.setAnimationLoop=function(t){D=t},this.dispose=function(){}}}function yu(t,e){function n(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function i(t,e,n,i,p){e.isMeshBasicMaterial||e.isMeshLambertMaterial?r(t,e):e.isMeshToonMaterial?(r(t,e),u(t,e)):e.isMeshPhongMaterial?(r(t,e),c(t,e)):e.isMeshStandardMaterial?(r(t,e),h(t,e),e.isMeshPhysicalMaterial&&d(t,e,p)):e.isMeshMatcapMaterial?(r(t,e),f(t,e)):e.isMeshDepthMaterial?r(t,e):e.isMeshDistanceMaterial?(r(t,e),m(t,e)):e.isMeshNormalMaterial?r(t,e):e.isLineBasicMaterial?(a(t,e),e.isLineDashedMaterial&&s(t,e)):e.isPointsMaterial?o(t,e,n,i):e.isSpriteMaterial?l(t,e):e.isShadowMaterial?(t.color.value.copy(e.color),t.opacity.value=e.opacity):e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)}function r(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map),i.alphaMap&&(n.alphaMap.value=i.alphaMap),i.bumpMap&&(n.bumpMap.value=i.bumpMap,n.bumpScale.value=i.bumpScale,i.side===p&&(n.bumpScale.value*=-1)),i.displacementMap&&(n.displacementMap.value=i.displacementMap,n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap),i.normalMap&&(n.normalMap.value=i.normalMap,n.normalScale.value.copy(i.normalScale),i.side===p&&n.normalScale.value.negate()),i.specularMap&&(n.specularMap.value=i.specularMap),i.alphaTest>0&&(n.alphaTest.value=i.alphaTest);const r=e.get(i).envMap;if(r&&(n.envMap.value=r,n.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,n.reflectivity.value=i.reflectivity,n.ior.value=i.ior,n.refractionRatio.value=i.refractionRatio),i.lightMap){n.lightMap.value=i.lightMap;const e=!0!==t.physicallyCorrectLights?Math.PI:1;n.lightMapIntensity.value=i.lightMapIntensity*e}let a,s;i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity),i.map?a=i.map:i.specularMap?a=i.specularMap:i.displacementMap?a=i.displacementMap:i.normalMap?a=i.normalMap:i.bumpMap?a=i.bumpMap:i.roughnessMap?a=i.roughnessMap:i.metalnessMap?a=i.metalnessMap:i.alphaMap?a=i.alphaMap:i.emissiveMap?a=i.emissiveMap:i.clearcoatMap?a=i.clearcoatMap:i.clearcoatNormalMap?a=i.clearcoatNormalMap:i.clearcoatRoughnessMap?a=i.clearcoatRoughnessMap:i.iridescenceMap?a=i.iridescenceMap:i.iridescenceThicknessMap?a=i.iridescenceThicknessMap:i.specularIntensityMap?a=i.specularIntensityMap:i.specularColorMap?a=i.specularColorMap:i.transmissionMap?a=i.transmissionMap:i.thicknessMap?a=i.thicknessMap:i.sheenColorMap?a=i.sheenColorMap:i.sheenRoughnessMap&&(a=i.sheenRoughnessMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),n.uvTransform.value.copy(a.matrix)),i.aoMap?s=i.aoMap:i.lightMap&&(s=i.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),n.uv2Transform.value.copy(s.matrix))}function a(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}function s(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function o(t,e,n,i){let r;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*i,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?r=e.map:e.alphaMap&&(r=e.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}function l(t,e){let n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function c(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}function u(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}function h(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap);const i=e.get(n).envMap;i&&(t.envMapIntensity.value=n.envMapIntensity)}function d(t,e,n){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap)),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===p&&t.clearcoatNormalScale.value.negate())),e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap)),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}function f(t,e){e.matcap&&(t.matcap.value=e.matcap)}function m(t,e){t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function bu(t,e,n,i){let r={},a={},s=[];const o=n.isWebGL2?t.getParameter(35375):0;function l(t,e){const n=e.program;i.uniformBlockBinding(t,n)}function c(t,n){let s=r[t.id];void 0===s&&(f(t),s=u(t),r[t.id]=s,t.addEventListener("dispose",g));const o=n.program;i.updateUBOMapping(t,o);const l=e.render.frame;a[t.id]!==l&&(d(t),a[t.id]=l)}function u(e){const n=h();e.__bindingPointIndex=n;const i=t.createBuffer(),r=e.__size,a=e.usage;return t.bindBuffer(35345,i),t.bufferData(35345,r,a),t.bindBuffer(35345,null),t.bindBufferBase(35345,n,i),i}function h(){for(let t=0;t<o;t++)if(-1===s.indexOf(t))return s.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(e){const n=r[e.id],i=e.uniforms,a=e.__cache;t.bindBuffer(35345,n);for(let r=0,s=i.length;r<s;r++){const e=i[r];if(!0===p(e,r,a)){const n=e.value,i=e.__offset;"number"===typeof n?(e.__data[0]=n,t.bufferSubData(35345,i,e.__data)):(e.value.isMatrix3?(e.__data[0]=e.value.elements[0],e.__data[1]=e.value.elements[1],e.__data[2]=e.value.elements[2],e.__data[3]=e.value.elements[0],e.__data[4]=e.value.elements[3],e.__data[5]=e.value.elements[4],e.__data[6]=e.value.elements[5],e.__data[7]=e.value.elements[0],e.__data[8]=e.value.elements[6],e.__data[9]=e.value.elements[7],e.__data[10]=e.value.elements[8],e.__data[11]=e.value.elements[0]):n.toArray(e.__data),t.bufferSubData(35345,i,e.__data))}}t.bindBuffer(35345,null)}function p(t,e,n){const i=t.value;if(void 0===n[e])return n[e]="number"===typeof i?i:i.clone(),!0;if("number"===typeof i){if(n[e]!==i)return n[e]=i,!0}else{const t=n[e];if(!1===t.equals(i))return t.copy(i),!0}return!1}function f(t){const e=t.uniforms;let n=0;const i=16;let r=0;for(let a=0,s=e.length;a<s;a++){const t=e[a],s=m(t);if(t.__data=new Float32Array(s.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,a>0){r=n%i;const e=i-r;0!==r&&e-s.boundary<0&&(n+=i-r,t.__offset=n)}n+=s.storage}return r=n%i,r>0&&(n+=i-r),t.__size=n,t.__cache={},this}function m(t){const e=t.value,n={boundary:0,storage:0};return"number"===typeof e?(n.boundary=4,n.storage=4):e.isVector2?(n.boundary=8,n.storage=8):e.isVector3||e.isColor?(n.boundary=16,n.storage=12):e.isVector4?(n.boundary=16,n.storage=16):e.isMatrix3?(n.boundary=48,n.storage=48):e.isMatrix4?(n.boundary=64,n.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),n}function g(e){const n=e.target;n.removeEventListener("dispose",g);const i=s.indexOf(n.__bindingPointIndex);s.splice(i,1),t.deleteBuffer(r[n.id]),delete r[n.id],delete a[n.id]}function v(){for(const e in r)t.deleteBuffer(r[e]);s=[],r={},a={}}return{bind:l,update:c,dispose:v}}function Mu(){const t=ln("canvas");return t.style.display="block",t}function wu(t={}){this.isWebGLRenderer=!0;const e=void 0!==t.canvas?t.canvas:Mu(),n=void 0!==t.context?t.context:null,r=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,o=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",u=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let h;h=null!==n?n.getContextAttributes().alpha:void 0!==t.alpha&&t.alpha;let m=null,g=null;const v=[],_=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=ve,this.physicallyCorrectLights=!1,this.toneMapping=$,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const x=this;let y=!1,b=0,M=0,w=null,S=-1,T=null;const E=new En,A=new En;let C=null,L=e.width,P=e.height,D=1,R=null,I=null;const O=new En(0,0,L,P),N=new En(0,0,L,P);let U=!1;const k=new Yr;let z=!1,F=!1,B=null;const V=new li,H=new an,G=new Dn,W={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return null===w?D:1}let X,q,Y,Z,K,J,Q,tt,et,nt,it,rt,at,st,ot,lt,ct,ut,ht,dt,pt,gt,vt,_t,xt=n;function yt(t,n){for(let i=0;i<t.length;i++){const r=t[i],a=e.getContext(r,n);if(null!==a)return a}return null}try{const t={alpha:!0,depth:r,stencil:a,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine","three.js r"+i),e.addEventListener("webglcontextlost",Tt,!1),e.addEventListener("webglcontextrestored",Et,!1),e.addEventListener("webglcontextcreationerror",At,!1),null===xt){const e=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&e.shift(),xt=yt(e,t),null===xt)throw yt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===xt.getShaderPrecisionFormat&&(xt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(qt){throw console.error("THREE.WebGLRenderer: "+qt.message),qt}function wt(){X=new rl(xt),q=new Uo(xt,X,t),X.init(q),gt=new pu(xt,X,q),Y=new hu(xt,X,q),Z=new ol,K=new $c,J=new du(xt,X,Y,K,q,gt,Z),Q=new zo(x),tt=new il(x),et=new Kr(xt,q),vt=new Oo(xt,X,et,q),nt=new al(xt,et,Z,vt),it=new hl(xt,nt,et,Z),ht=new ul(xt,q,J),lt=new ko(K),rt=new qc(x,Q,tt,X,q,vt,lt),at=new yu(x,K),st=new Jc,ot=new au(X,q),ut=new Io(x,Q,Y,it,h,o),ct=new uu(x,it,q),_t=new bu(xt,Z,q,Y),dt=new No(xt,X,Z,q),pt=new sl(xt,X,Z,q),Z.programs=rt.programs,x.capabilities=q,x.extensions=X,x.properties=K,x.renderLists=st,x.shadowMap=ct,x.state=Y,x.info=Z}wt();const St=new xu(x,xt);function Tt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),y=!0}function Et(){console.log("THREE.WebGLRenderer: Context Restored."),y=!1;const t=Z.autoReset,e=ct.enabled,n=ct.autoUpdate,i=ct.needsUpdate,r=ct.type;wt(),Z.autoReset=t,ct.enabled=e,ct.autoUpdate=n,ct.needsUpdate=i,ct.type=r}function At(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function Lt(t){const e=t.target;e.removeEventListener("dispose",Lt),Pt(e)}function Pt(t){Dt(t),K.remove(t)}function Dt(t){const e=K.get(t).programs;void 0!==e&&(e.forEach((function(t){rt.releaseProgram(t)})),t.isShaderMaterial&&rt.releaseShaderCache(t))}this.xr=St,this.getContext=function(){return xt},this.getContextAttributes=function(){return xt.getContextAttributes()},this.forceContextLoss=function(){const t=X.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=X.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return D},this.setPixelRatio=function(t){void 0!==t&&(D=t,this.setSize(L,P,!1))},this.getSize=function(t){return t.set(L,P)},this.setSize=function(t,n,i){St.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(L=t,P=n,e.width=Math.floor(t*D),e.height=Math.floor(n*D),!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(L*D,P*D).floor()},this.setDrawingBufferSize=function(t,n,i){L=t,P=n,D=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(E)},this.getViewport=function(t){return t.copy(O)},this.setViewport=function(t,e,n,i){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,n,i),Y.viewport(E.copy(O).multiplyScalar(D).floor())},this.getScissor=function(t){return t.copy(N)},this.setScissor=function(t,e,n,i){t.isVector4?N.set(t.x,t.y,t.z,t.w):N.set(t,e,n,i),Y.scissor(A.copy(N).multiplyScalar(D).floor())},this.getScissorTest=function(){return U},this.setScissorTest=function(t){Y.setScissorTest(U=t)},this.setOpaqueSort=function(t){R=t},this.setTransparentSort=function(t){I=t},this.getClearColor=function(t){return t.copy(ut.getClearColor())},this.setClearColor=function(){ut.setClearColor.apply(ut,arguments)},this.getClearAlpha=function(){return ut.getClearAlpha()},this.setClearAlpha=function(){ut.setClearAlpha.apply(ut,arguments)},this.clear=function(t=!0,e=!0,n=!0){let i=0;t&&(i|=16384),e&&(i|=256),n&&(i|=1024),xt.clear(i)},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(){e.removeEventListener("webglcontextlost",Tt,!1),e.removeEventListener("webglcontextrestored",Et,!1),e.removeEventListener("webglcontextcreationerror",At,!1),st.dispose(),ot.dispose(),K.dispose(),Q.dispose(),tt.dispose(),it.dispose(),vt.dispose(),_t.dispose(),rt.dispose(),St.dispose(),St.removeEventListener("sessionstart",Ot),St.removeEventListener("sessionend",Nt),B&&(B.dispose(),B=null),Ut.stop()},this.renderBufferDirect=function(t,e,n,i,r,a){null===e&&(e=W);const s=r.isMesh&&r.matrixWorld.determinant()<0,o=Wt(t,e,n,i,r);Y.setMaterial(i,s);let l=n.index;const c=n.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let u,h=1;!0===i.wireframe&&(l=nt.getWireframeAttribute(n),h=2),vt.setup(r,i,o,n,l);let d=dt;null!==l&&(u=et.get(l),d=pt,d.setIndex(u));const p=null!==l?l.count:c.count,f=n.drawRange.start*h,m=n.drawRange.count*h,g=null!==a?a.start*h:0,v=null!==a?a.count*h:1/0,_=Math.max(f,g),x=Math.min(p,f+m,g+v)-1,y=Math.max(0,x-_+1);if(0!==y){if(r.isMesh)!0===i.wireframe?(Y.setLineWidth(i.wireframeLinewidth*j()),d.setMode(1)):d.setMode(4);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),Y.setLineWidth(t*j()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);if(r.isInstancedMesh)d.renderInstances(_,y,r.count);else if(n.isInstancedBufferGeometry){const t=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(_,y,t)}else d.render(_,y)}},this.compile=function(t,e){function n(t,e,n){!0===t.transparent&&t.side===f?(t.side=p,t.needsUpdate=!0,Ht(t,e,n),t.side=d,t.needsUpdate=!0,Ht(t,e,n),t.side=f):Ht(t,e,n)}g=ot.get(t),g.init(),_.push(g),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(g.pushLight(t),t.castShadow&&g.pushShadow(t))})),g.setupLights(x.physicallyCorrectLights),t.traverse((function(e){const i=e.material;if(i)if(Array.isArray(i))for(let r=0;r<i.length;r++){const a=i[r];n(a,t,e)}else n(i,t,e)})),_.pop(),g=null};let Rt=null;function It(t){Rt&&Rt(t)}function Ot(){Ut.stop()}function Nt(){Ut.start()}const Ut=new Zr;function kt(t,e,n,i){if(!1===t.visible)return;const r=t.layers.test(e.layers);if(r)if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)g.pushLight(t),t.castShadow&&g.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||k.intersectsSprite(t)){i&&G.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=it.update(t),r=t.material;r.visible&&m.push(t,e,r,n,G.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==Z.render.frame&&(t.skeleton.update(),t.skeleton.frame=Z.render.frame),!t.frustumCulled||k.intersectsObject(t))){i&&G.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=it.update(t),r=t.material;if(Array.isArray(r)){const i=e.groups;for(let a=0,s=i.length;a<s;a++){const s=i[a],o=r[s.materialIndex];o&&o.visible&&m.push(t,e,o,n,G.z,s)}}else r.visible&&m.push(t,e,r,n,G.z,null)}const a=t.children;for(let s=0,o=a.length;s<o;s++)kt(a[s],e,n,i)}function zt(t,e,n,i){const r=t.opaque,a=t.transmissive,s=t.transparent;g.setupLightsView(n),a.length>0&&Ft(r,e,n),i&&Y.viewport(E.copy(i)),r.length>0&&Bt(r,e,n),a.length>0&&Bt(a,e,n),s.length>0&&Bt(s,e,n),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1)}function Ft(t,e,n){const i=q.isWebGL2;null===B&&(B=new An(1,1,{generateMipmaps:!0,type:X.has("EXT_color_buffer_half_float")?Mt:mt,minFilter:ft,samples:i&&!0===s?4:0})),x.getDrawingBufferSize(H),i?B.setSize(H.x,H.y):B.setSize(Qe(H.x),Qe(H.y));const r=x.getRenderTarget();x.setRenderTarget(B),x.clear();const a=x.toneMapping;x.toneMapping=$,Bt(t,e,n),x.toneMapping=a,J.updateMultisampleRenderTarget(B),J.updateRenderTargetMipmap(B),x.setRenderTarget(r)}function Bt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,a=t.length;r<a;r++){const a=t[r],s=a.object,o=a.geometry,l=null===i?a.material:i,c=a.group;s.layers.test(n.layers)&&Vt(s,e,n,o,l,c)}}function Vt(t,e,n,i,r,a){t.onBeforeRender(x,e,n,i,r,a),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(x,e,n,i,t,a),!0===r.transparent&&r.side===f?(r.side=p,r.needsUpdate=!0,x.renderBufferDirect(n,e,i,r,t,a),r.side=d,r.needsUpdate=!0,x.renderBufferDirect(n,e,i,r,t,a),r.side=f):x.renderBufferDirect(n,e,i,r,t,a),t.onAfterRender(x,e,n,i,r,a)}function Ht(t,e,n){!0!==e.isScene&&(e=W);const i=K.get(t),r=g.state.lights,a=g.state.shadowsArray,s=r.state.version,o=rt.getParameters(t,r.state,a,e,n),l=rt.getProgramCacheKey(o);let c=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.envMap=(t.isMeshStandardMaterial?tt:Q).get(t.envMap||i.environment),void 0===c&&(t.addEventListener("dispose",Lt),c=new Map,i.programs=c);let u=c.get(l);if(void 0!==u){if(i.currentProgram===u&&i.lightsStateVersion===s)return Gt(t,o),u}else o.uniforms=rt.getUniforms(t),t.onBuild(n,o,x),t.onBeforeCompile(o,x),u=rt.acquireProgram(o,l),c.set(l,u),i.uniforms=o.uniforms;const h=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(h.clippingPlanes=lt.uniform),Gt(t,o),i.needsLights=Xt(t),i.lightsStateVersion=s,i.needsLights&&(h.ambientLightColor.value=r.state.ambient,h.lightProbe.value=r.state.probe,h.directionalLights.value=r.state.directional,h.directionalLightShadows.value=r.state.directionalShadow,h.spotLights.value=r.state.spot,h.spotLightShadows.value=r.state.spotShadow,h.rectAreaLights.value=r.state.rectArea,h.ltc_1.value=r.state.rectAreaLTC1,h.ltc_2.value=r.state.rectAreaLTC2,h.pointLights.value=r.state.point,h.pointLightShadows.value=r.state.pointShadow,h.hemisphereLights.value=r.state.hemi,h.directionalShadowMap.value=r.state.directionalShadowMap,h.directionalShadowMatrix.value=r.state.directionalShadowMatrix,h.spotShadowMap.value=r.state.spotShadowMap,h.spotLightMatrix.value=r.state.spotLightMatrix,h.spotLightMap.value=r.state.spotLightMap,h.pointShadowMap.value=r.state.pointShadowMap,h.pointShadowMatrix.value=r.state.pointShadowMatrix);const d=u.getUniforms(),p=vc.seqWithValue(d.seq,h);return i.currentProgram=u,i.uniformsList=p,u}function Gt(t,e){const n=K.get(t);n.outputEncoding=e.outputEncoding,n.instancing=e.instancing,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}function Wt(t,e,n,i,r){!0!==e.isScene&&(e=W),J.resetTextureUnits();const a=e.fog,s=i.isMeshStandardMaterial?e.environment:null,o=null===w?x.outputEncoding:!0===w.isXRRenderTarget?w.texture.encoding:ve,l=(i.isMeshStandardMaterial?tt:Q).get(i.envMap||s),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,u=!!i.normalMap&&!!n.attributes.tangent,h=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,f=i.toneMapped?x.toneMapping:$,m=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==m?m.length:0,_=K.get(i),y=g.state.lights;if(!0===z&&(!0===F||t!==T)){const e=t===T&&i.id===S;lt.setState(i,t,e)}let b=!1;i.version===_.__version?_.needsLights&&_.lightsStateVersion!==y.state.version||_.outputEncoding!==o||r.isInstancedMesh&&!1===_.instancing?b=!0:r.isInstancedMesh||!0!==_.instancing?r.isSkinnedMesh&&!1===_.skinning?b=!0:r.isSkinnedMesh||!0!==_.skinning?_.envMap!==l||!0===i.fog&&_.fog!==a?b=!0:void 0===_.numClippingPlanes||_.numClippingPlanes===lt.numPlanes&&_.numIntersection===lt.numIntersection?(_.vertexAlphas!==c||_.vertexTangents!==u||_.morphTargets!==h||_.morphNormals!==d||_.morphColors!==p||_.toneMapping!==f||!0===q.isWebGL2&&_.morphTargetsCount!==v)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,_.__version=i.version);let M=_.currentProgram;!0===b&&(M=Ht(i,e,r));let E=!1,A=!1,C=!1;const L=M.getUniforms(),R=_.uniforms;if(Y.useProgram(M.program)&&(E=!0,A=!0,C=!0),i.id!==S&&(S=i.id,A=!0),E||T!==t){if(L.setValue(xt,"projectionMatrix",t.projectionMatrix),q.logarithmicDepthBuffer&&L.setValue(xt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),T!==t&&(T=t,A=!0,C=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=L.map.cameraPosition;void 0!==e&&e.setValue(xt,G.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&L.setValue(xt,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||r.isSkinnedMesh)&&L.setValue(xt,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){L.setOptional(xt,r,"bindMatrix"),L.setOptional(xt,r,"bindMatrixInverse");const t=r.skeleton;t&&(q.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),L.setValue(xt,"boneTexture",t.boneTexture,J),L.setValue(xt,"boneTextureSize",t.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const I=n.morphAttributes;if((void 0!==I.position||void 0!==I.normal||void 0!==I.color&&!0===q.isWebGL2)&&ht.update(r,n,i,M),(A||_.receiveShadow!==r.receiveShadow)&&(_.receiveShadow=r.receiveShadow,L.setValue(xt,"receiveShadow",r.receiveShadow)),i.isMeshGouraudMaterial&&null!==i.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),A&&(L.setValue(xt,"toneMappingExposure",x.toneMappingExposure),_.needsLights&&jt(R,C),a&&!0===i.fog&&at.refreshFogUniforms(R,a),at.refreshMaterialUniforms(R,i,D,P,B),vc.upload(xt,_.uniformsList,R,J)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(vc.upload(xt,_.uniformsList,R,J),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&L.setValue(xt,"center",r.center),L.setValue(xt,"modelViewMatrix",r.modelViewMatrix),L.setValue(xt,"normalMatrix",r.normalMatrix),L.setValue(xt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++)if(q.isWebGL2){const n=t[e];_t.update(n,M),_t.bind(n,M)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return M}function jt(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.directionalLightShadows.needsUpdate=e,t.pointLights.needsUpdate=e,t.pointLightShadows.needsUpdate=e,t.spotLights.needsUpdate=e,t.spotLightShadows.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function Xt(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}Ut.setAnimationLoop(It),"undefined"!==typeof self&&Ut.setContext(self),this.setAnimationLoop=function(t){Rt=t,St.setAnimationLoop(t),null===t?Ut.stop():Ut.start()},St.addEventListener("sessionstart",Ot),St.addEventListener("sessionend",Nt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===y)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===St.enabled&&!0===St.isPresenting&&(!0===St.cameraAutoUpdate&&St.updateCamera(e),e=St.getCamera()),!0===t.isScene&&t.onBeforeRender(x,t,e,w),g=ot.get(t,_.length),g.init(),_.push(g),V.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),k.setFromProjectionMatrix(V),F=this.localClippingEnabled,z=lt.init(this.clippingPlanes,F,e),m=st.get(t,v.length),m.init(),v.push(m),kt(t,e,0,x.sortObjects),m.finish(),!0===x.sortObjects&&m.sort(R,I),!0===z&&lt.beginShadows();const n=g.state.shadowsArray;if(ct.render(n,t,e),!0===z&&lt.endShadows(),!0===this.info.autoReset&&this.info.reset(),ut.render(m,t),g.setupLights(x.physicallyCorrectLights),e.isArrayCamera){const n=e.cameras;for(let e=0,i=n.length;e<i;e++){const i=n[e];zt(m,t,i,i.viewport)}}else zt(m,t,e);null!==w&&(J.updateMultisampleRenderTarget(w),J.updateRenderTargetMipmap(w)),!0===t.isScene&&t.onAfterRender(x,t,e),vt.resetDefaultState(),S=-1,T=null,_.pop(),g=_.length>0?_[_.length-1]:null,v.pop(),m=v.length>0?v[v.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(t,e,n){K.get(t.texture).__webglTexture=e,K.get(t.depthTexture).__webglTexture=n;const i=K.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===X.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=K.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){w=t,b=e,M=n;let i=!0;if(t){const e=K.get(t);void 0!==e.__useDefaultFramebuffer?(Y.bindFramebuffer(36160,null),i=!1):void 0===e.__webglFramebuffer?J.setupRenderTarget(t):e.__hasExternalTextures&&J.rebindTextures(t,K.get(t.texture).__webglTexture,K.get(t.depthTexture).__webglTexture)}let r=null,a=!1,s=!1;if(t){const n=t.texture;(n.isData3DTexture||n.isDataArrayTexture)&&(s=!0);const i=K.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=i[e],a=!0):r=q.isWebGL2&&t.samples>0&&!1===J.useMultisampledRTT(t)?K.get(t).__webglMultisampledFramebuffer:i,E.copy(t.viewport),A.copy(t.scissor),C=t.scissorTest}else E.copy(O).multiplyScalar(D).floor(),A.copy(N).multiplyScalar(D).floor(),C=U;const o=Y.bindFramebuffer(36160,r);if(o&&q.drawBuffers&&i&&Y.drawBuffers(t,r),Y.viewport(E),Y.scissor(A),Y.setScissorTest(C),a){const i=K.get(t.texture);xt.framebufferTexture2D(36160,36064,34069+e,i.__webglTexture,n)}else if(s){const i=K.get(t.texture),r=e||0;xt.framebufferTextureLayer(36160,36064,i.__webglTexture,n||0,r)}S=-1},this.readRenderTargetPixels=function(t,e,n,i,r,a,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=K.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(o=o[s]),o){Y.bindFramebuffer(36160,o);try{const s=t.texture,o=s.format,l=s.type;if(o!==Ct&&gt.convert(o)!==xt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Mt&&(X.has("EXT_color_buffer_half_float")||q.isWebGL2&&X.has("EXT_color_buffer_float"));if(l!==mt&&gt.convert(l)!==xt.getParameter(35738)&&(l!==bt||!(q.isWebGL2||X.has("OES_texture_float")||X.has("WEBGL_color_buffer_float")))&&!c)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&xt.readPixels(e,n,i,r,gt.convert(o),gt.convert(l),a)}finally{const t=null!==w?K.get(w).__webglFramebuffer:null;Y.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i);J.setTexture2D(e,0),xt.copyTexSubImage2D(3553,n,0,0,t.x,t.y,r,a),Y.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,a=e.image.height,s=gt.convert(n.format),o=gt.convert(n.type);J.setTexture2D(n,0),xt.pixelStorei(37440,n.flipY),xt.pixelStorei(37441,n.premultiplyAlpha),xt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?xt.texSubImage2D(3553,i,t.x,t.y,r,a,s,o,e.image.data):e.isCompressedTexture?xt.compressedTexSubImage2D(3553,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):xt.texSubImage2D(3553,i,t.x,t.y,s,o,e.image),0===i&&n.generateMipmaps&&xt.generateMipmap(3553),Y.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=t.max.x-t.min.x+1,s=t.max.y-t.min.y+1,o=t.max.z-t.min.z+1,l=gt.convert(i.format),c=gt.convert(i.type);let u;if(i.isData3DTexture)J.setTexture3D(i,0),u=32879;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");J.setTexture2DArray(i,0),u=35866}xt.pixelStorei(37440,i.flipY),xt.pixelStorei(37441,i.premultiplyAlpha),xt.pixelStorei(3317,i.unpackAlignment);const h=xt.getParameter(3314),d=xt.getParameter(32878),p=xt.getParameter(3316),f=xt.getParameter(3315),m=xt.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;xt.pixelStorei(3314,g.width),xt.pixelStorei(32878,g.height),xt.pixelStorei(3316,t.min.x),xt.pixelStorei(3315,t.min.y),xt.pixelStorei(32877,t.min.z),n.isDataTexture||n.isData3DTexture?xt.texSubImage3D(u,r,e.x,e.y,e.z,a,s,o,l,c,g.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),xt.compressedTexSubImage3D(u,r,e.x,e.y,e.z,a,s,o,l,g.data)):xt.texSubImage3D(u,r,e.x,e.y,e.z,a,s,o,l,c,g),xt.pixelStorei(3314,h),xt.pixelStorei(32878,d),xt.pixelStorei(3316,p),xt.pixelStorei(3315,f),xt.pixelStorei(32877,m),0===r&&i.generateMipmaps&&xt.generateMipmap(u),Y.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?J.setTextureCube(t,0):t.isData3DTexture?J.setTexture3D(t,0):t.isDataArrayTexture?J.setTexture2DArray(t,0):J.setTexture2D(t,0),Y.unbindTexture()},this.resetState=function(){b=0,M=0,w=null,Y.reset(),vt.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Su extends wu{}Su.prototype.isWebGL1Renderer=!0;class Tu extends Ii{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}const Eu=new Dn,Au=new En,Cu=new En,Lu=new Dn,Pu=new li;class Du extends Tr{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new li,this.bindMatrixInverse=new li}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new En,e=this.geometry.attributes.skinWeight;for(let n=0,i=e.count;n<i;n++){t.fromBufferAttribute(e,n);const i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const n=this.skeleton,i=this.geometry;Au.fromBufferAttribute(i.attributes.skinIndex,t),Cu.fromBufferAttribute(i.attributes.skinWeight,t),Eu.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let r=0;r<4;r++){const t=Cu.getComponent(r);if(0!==t){const i=Au.getComponent(r);Pu.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),e.addScaledVector(Lu.copy(Eu).applyMatrix4(Pu),t)}}return e.applyMatrix4(this.bindMatrixInverse)}}class Ru extends Ii{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Iu extends Tn{constructor(t=null,e=1,n=1,i,r,a,s,o,l=ct,c=ct,u,h){super(null,a,s,o,l,c,i,r,u,h),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ou=new li,Nu=new li;class Uu{constructor(t=[],e=[]){this.uuid=Ne(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new li)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new li;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){const t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=t.length;r<a;r++){const i=t[r]?t[r].matrixWorld:Nu;Ou.multiplyMatrices(i,e[r]),Ou.toArray(n,16*r)}null!==i&&(i.needsUpdate=!0)}clone(){return new Uu(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=Je(t),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const n=new Iu(e,t,t,Ct,bt);return n.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=n,this.boneTextureSize=t,this}getBoneByName(t){for(let e=0,n=this.bones.length;e<n;e++){const n=this.bones[e];if(n.name===t)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let n=0,i=t.bones.length;n<i;n++){const i=t.bones[n];let r=e[i];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",i),r=new Ru),this.bones.push(r),this.boneInverses.push((new li).fromArray(t.boneInverses[n]))}return this.init(),this}toJSON(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,n=this.boneInverses;for(let i=0,r=e.length;i<r;i++){const r=e[i];t.bones.push(r.uuid);const a=n[i];t.boneInverses.push(a.toArray())}return t}}class ku extends Xi{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new xn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const zu=new Dn,Fu=new Dn,Bu=new li,Vu=new oi,Hu=new Qn;class Gu extends Ii{constructor(t=new or,e=new ku){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,i=e.count;t<i;t++)zu.fromBufferAttribute(e,t-1),Fu.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=zu.distanceTo(Fu);t.setAttribute("lineDistance",new Qi(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Hu.copy(n.boundingSphere),Hu.applyMatrix4(i),Hu.radius+=r,!1===t.ray.intersectsSphere(Hu))return;Bu.copy(i).invert(),Vu.copy(t.ray).applyMatrix4(Bu);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=new Dn,c=new Dn,u=new Dn,h=new Dn,d=this.isLineSegments?2:1,p=n.index,f=n.attributes,m=f.position;if(null!==p){const n=Math.max(0,a.start),i=Math.min(p.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=d){const n=p.getX(r),i=p.getX(r+1);l.fromBufferAttribute(m,n),c.fromBufferAttribute(m,i);const a=Vu.distanceSqToSegment(l,c,h,u);if(a>o)continue;h.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(h);s<t.near||s>t.far||e.push({distance:s,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else{const n=Math.max(0,a.start),i=Math.min(m.count,a.start+a.count);for(let r=n,a=i-1;r<a;r+=d){l.fromBufferAttribute(m,r),c.fromBufferAttribute(m,r+1);const n=Vu.distanceSqToSegment(l,c,h,u);if(n>o)continue;h.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(h);i<t.near||i>t.far||e.push({distance:i,point:u.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry,e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}}class Wu{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let a=1;a<=t;a++)n=this.getPoint(a/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let a;a=e||t*n[r-1];let s,o=0,l=r-1;while(o<=l)if(i=Math.floor(o+(l-o)/2),s=n[i]-a,s<0)o=i+1;else{if(!(s>0)){l=i;break}l=i-1}if(i=l,n[i]===a)return i/(r-1);const c=n[i],u=n[i+1],h=u-c,d=(a-c)/h,p=(i+d)/(r-1);return p}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),s=this.getPoint(r),o=e||(a.isVector2?new an:new Dn);return o.copy(s).sub(a).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new Dn,i=[],r=[],a=[],s=new Dn,o=new li;for(let d=0;d<=t;d++){const e=d/t;i[d]=this.getTangentAt(e,new Dn)}r[0]=new Dn,a[0]=new Dn;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),u=Math.abs(i[0].y),h=Math.abs(i[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),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),a[0].crossVectors(i[0],r[0]);for(let d=1;d<=t;d++){if(r[d]=r[d-1].clone(),a[d]=a[d-1].clone(),s.crossVectors(i[d-1],i[d]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(Ue(i[d-1].dot(i[d]),-1,1));r[d].applyMatrix4(o.makeRotationAxis(s,t))}a[d].crossVectors(i[d],r[d])}if(!0===e){let e=Math.acos(Ue(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(s.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),a[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ju extends Xi{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new xn(16777215),this.specular=new xn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new xn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=be,this.normalScale=new an(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=j,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Xu extends Xi{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new xn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new xn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=be,this.normalScale=new an(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=j,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}function qu(t,e,n){return Yu(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)}function $u(t,e,n){return!t||!n&&t.constructor===e?t:"number"===typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function Yu(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Zu(t){function e(e,n){return t[e]-t[n]}const n=t.length,i=new Array(n);for(let r=0;r!==n;++r)i[r]=r;return i.sort(e),i}function Ku(t,e,n){const i=t.length,r=new t.constructor(i);for(let a=0,s=0;s!==i;++a){const i=n[a]*e;for(let n=0;n!==e;++n)r[s++]=t[i+n]}return r}function Ju(t,e,n,i){let r=1,a=t[0];while(void 0!==a&&void 0===a[i])a=t[r++];if(void 0===a)return;let s=a[i];if(void 0!==s)if(Array.isArray(s))do{s=a[i],void 0!==s&&(e.push(a.time),n.push.apply(n,s)),a=t[r++]}while(void 0!==a);else if(void 0!==s.toArray)do{s=a[i],void 0!==s&&(e.push(a.time),s.toArray(n,n.length)),a=t[r++]}while(void 0!==a);else do{s=a[i],void 0!==s&&(e.push(a.time),n.push(s)),a=t[r++]}while(void 0!==a)}class Qu{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{let a;n:{i:if(!(t<i)){for(let a=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=i,i=e[++n],t<i)break e}a=e.length;break n}if(t>=r)break t;{const s=e[1];t<s&&(n=2,r=s);for(let a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(i=r,r=e[--n-1],t>=r)break e}a=n,n=0}}while(n<a){const i=n+a>>>1;t<e[i]?a=i:n=i+1}if(i=e[n],r=e[n-1],void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let a=0;a!==i;++a)e[a]=n[r+a];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class th extends Qu{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:pe,endingEnd:pe}}intervalChanged_(t,e,n){const i=this.parameterPositions;let r=t-2,a=t+1,s=i[r],o=i[a];if(void 0===s)switch(this.getSettings_().endingStart){case fe:r=t,s=2*e-n;break;case me:r=i.length-2,s=e+i[r]-i[r+1];break;default:r=t,s=n}if(void 0===o)switch(this.getSettings_().endingEnd){case fe:a=t,o=2*n-e;break;case me:a=1,o=n+i[1]-i[0];break;default:a=t-1,o=e}const l=.5*(n-e),c=this.valueSize;this._weightPrev=l/(e-s),this._weightNext=l/(o-n),this._offsetPrev=r*c,this._offsetNext=a*c}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=t*s,l=o-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-e)/(i-e),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,_=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let y=0;y!==s;++y)r[y]=g*a[c+y]+v*a[l+y]+_*a[o+y]+x*a[u+y];return r}}class eh extends Qu{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=t*s,l=o-s,c=(n-e)/(i-e),u=1-c;for(let h=0;h!==s;++h)r[h]=a[l+h]*u+a[o+h]*c;return r}}class nh extends Qu{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}}class ih{constructor(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=$u(e,this.TimeBufferType),this.values=$u(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:$u(t.times,Array),values:$u(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(n.interpolation=e)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new nh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new eh(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new th(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case ue:e=this.InterpolantFactoryMethodDiscrete;break;case he:e=this.InterpolantFactoryMethodLinear;break;case de:e=this.InterpolantFactoryMethodSmooth;break}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ue;case this.InterpolantFactoryMethodLinear:return he;case this.InterpolantFactoryMethodSmooth:return de}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){const n=this.times,i=n.length;let r=0,a=i-1;while(r!==i&&n[r]<t)++r;while(-1!==a&&n[a]>e)--a;if(++a,0!==r||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const t=this.getValueSize();this.times=qu(n,r,a),this.values=qu(this.values,r*t,a*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let a=null;for(let s=0;s!==r;s++){const e=n[s];if("number"===typeof e&&isNaN(e)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,e),t=!1;break}if(null!==a&&a>e){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,e,a),t=!1;break}a=e}if(void 0!==i&&Yu(i))for(let s=0,o=i.length;s!==o;++s){const e=i[s];if(isNaN(e)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,e),t=!1;break}}return t}optimize(){const t=qu(this.times),e=qu(this.values),n=this.getValueSize(),i=this.getInterpolation()===de,r=t.length-1;let a=1;for(let s=1;s<r;++s){let r=!1;const o=t[s],l=t[s+1];if(o!==l&&(1!==s||o!==t[0]))if(i)r=!0;else{const t=s*n,i=t-n,a=t+n;for(let s=0;s!==n;++s){const n=e[t+s];if(n!==e[i+s]||n!==e[a+s]){r=!0;break}}}if(r){if(s!==a){t[a]=t[s];const i=s*n,r=a*n;for(let t=0;t!==n;++t)e[r+t]=e[i+t]}++a}}if(r>0){t[a]=t[r];for(let t=r*n,i=a*n,s=0;s!==n;++s)e[i+s]=e[t+s];++a}return a!==t.length?(this.times=qu(t,0,a),this.values=qu(e,0,a*n)):(this.times=t,this.values=e),this}clone(){const t=qu(this.times,0),e=qu(this.values,0),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}ih.prototype.TimeBufferType=Float32Array,ih.prototype.ValueBufferType=Float32Array,ih.prototype.DefaultInterpolation=he;class rh extends ih{}rh.prototype.ValueTypeName="bool",rh.prototype.ValueBufferType=Array,rh.prototype.DefaultInterpolation=ue,rh.prototype.InterpolantFactoryMethodLinear=void 0,rh.prototype.InterpolantFactoryMethodSmooth=void 0;class ah extends ih{}ah.prototype.ValueTypeName="color";class sh extends ih{}sh.prototype.ValueTypeName="number";class oh extends Qu{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){const r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-e)/(i-e);let l=t*s;for(let c=l+s;l!==c;l+=4)Pn.slerpFlat(r,0,a,l-s,a,l,o);return r}}class lh extends ih{InterpolantFactoryMethodLinear(t){return new oh(this.times,this.values,this.getValueSize(),t)}}lh.prototype.ValueTypeName="quaternion",lh.prototype.DefaultInterpolation=he,lh.prototype.InterpolantFactoryMethodSmooth=void 0;class ch extends ih{}ch.prototype.ValueTypeName="string",ch.prototype.ValueBufferType=Array,ch.prototype.DefaultInterpolation=ue,ch.prototype.InterpolantFactoryMethodLinear=void 0,ch.prototype.InterpolantFactoryMethodSmooth=void 0;class uh extends ih{}uh.prototype.ValueTypeName="vector";class hh{constructor(t,e=-1,n,i=ge){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=Ne(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let a=0,s=n.length;a!==s;++a)e.push(ph(n[a]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,a=n.length;r!==a;++r)e.push(ih.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,a=[];for(let s=0;s<r;s++){let t=[],o=[];t.push((s+r-1)%r,s,(s+1)%r),o.push(0,1,0);const l=Zu(t);t=Ku(t,1,l),o=Ku(o,1,l),i||0!==t[0]||(t.push(r),o.push(o[0])),a.push(new sh(".morphTargetInfluences["+e[s].name+"]",t,o).scale(1/n))}return new this(t,-1,a)}static findByName(t,e){let n=t;if(!Array.isArray(t)){const e=t;n=e.geometry&&e.geometry.animations||e.animations}for(let i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null}static CreateClipsFromMorphTargetSequences(t,e,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,o=t.length;s<o;s++){const e=t[s],n=e.name.match(r);if(n&&n.length>1){const t=n[1];let r=i[t];r||(i[t]=r=[]),r.push(e)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],e,n));return a}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const a=[],s=[];Ju(n,a,s,i),0!==a.length&&r.push(new t(e,a,s))}},i=[],r=t.name||"default",a=t.fps||30,s=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let u=0;u<l.length;u++){const t=l[u].keys;if(t&&0!==t.length)if(t[0].morphTargets){const e={};let n;for(n=0;n<t.length;n++)if(t[n].morphTargets)for(let i=0;i<t[n].morphTargets.length;i++)e[t[n].morphTargets[i]]=-1;for(const r in e){const e=[],a=[];for(let i=0;i!==t[n].morphTargets.length;++i){const i=t[n];e.push(i.time),a.push(i.morphTarget===r?1:0)}i.push(new sh(".morphTargetInfluence["+r+"]",e,a))}o=e.length*a}else{const r=".bones["+e[u].name+"]";n(uh,r+".position",t,"pos",i),n(lh,r+".quaternion",t,"rot",i),n(uh,r+".scale",t,"scl",i)}}if(0===i.length)return null;const c=new this(r,o,i,s);return c}resetDuration(){const t=this.tracks;let e=0;for(let n=0,i=t.length;n!==i;++n){const t=this.tracks[n];e=Math.max(e,t.times[t.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function dh(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return sh;case"vector":case"vector2":case"vector3":case"vector4":return uh;case"color":return ah;case"quaternion":return lh;case"bool":case"boolean":return rh;case"string":return ch}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function ph(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=dh(t.type);if(void 0===t.times){const e=[],n=[];Ju(t.keys,e,n,"value"),t.times=e,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const fh={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class mh{constructor(t,e,n){const i=this;let r=!1,a=0,s=0,o=void 0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===r&&void 0!==i.onStart&&i.onStart(t,a,s),r=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,s),a===s&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return o?o(t):t},this.setURLModifier=function(t){return o=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e],i=l[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return i}return null}}}const gh=new mh;class vh{constructor(t){this.manager=void 0!==t?t:gh,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(i,r){n.load(t,i,e,r)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const _h={};class xh extends Error{constructor(t,e){super(t),this.response=e}}class yh extends vh{constructor(t){super(t)}load(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=fh.get(t);if(void 0!==r)return this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==_h[t])return void _h[t].push({onLoad:e,onProgress:n,onError:i});_h[t]=[],_h[t].push({onLoad:e,onProgress:n,onError:i});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,o=this.responseType;fetch(a).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"===typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const n=_h[t],i=e.body.getReader(),r=e.headers.get("Content-Length"),a=r?parseInt(r):0,s=0!==a;let o=0;const l=new ReadableStream({start(t){function e(){i.read().then(({done:i,value:r})=>{if(i)t.close();else{o+=r.byteLength;const i=new ProgressEvent("progress",{lengthComputable:s,loaded:o,total:a});for(let t=0,e=n.length;t<e;t++){const e=n[t];e.onProgress&&e.onProgress(i)}t.enqueue(r),e()}})}e()}});return new Response(l)}throw new xh(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>{const e=new DOMParser;return e.parseFromString(t,s)});case"json":return t.json();default:if(void 0===s)return t.text();{const e=/charset="?([^;"\s]*)"?/i,n=e.exec(s),i=n&&n[1]?n[1].toLowerCase():void 0,r=new TextDecoder(i);return t.arrayBuffer().then(t=>r.decode(t))}}}).then(e=>{fh.add(t,e);const n=_h[t];delete _h[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onLoad&&i.onLoad(e)}}).catch(e=>{const n=_h[t];if(void 0===n)throw this.manager.itemError(t),e;delete _h[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class bh extends vh{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,a=fh.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout((function(){e&&e(a),r.manager.itemEnd(t)}),0),a;const s=ln("img");function o(){c(),fh.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(t),s.src=t,s}}class Mh extends vh{constructor(t){super(t)}load(t,e,n,i){const r=new Tn,a=new bh(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,(function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}}class wh extends Ii{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new xn(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}const Sh=new li,Th=new Dn,Eh=new Dn;class Ah{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new an(512,512),this.map=null,this.mapPass=null,this.matrix=new li,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Yr,this._frameExtents=new an(1,1),this._viewportCount=1,this._viewports=[new En(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Th.setFromMatrixPosition(t.matrixWorld),e.position.copy(Th),Eh.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Eh),e.updateMatrixWorld(),Sh.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Sh),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Ch extends Ah{constructor(){super(new kr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*Oe*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class Lh extends wh{constructor(t,e,n=0,i=Math.PI/3,r=0,a=1){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ii.DefaultUp),this.updateMatrix(),this.target=new Ii,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new Ch}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const Ph=new li,Dh=new Dn,Rh=new Dn;class Ih extends Ah{constructor(){super(new kr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new an(4,2),this._viewportCount=6,this._viewports=[new En(2,1,1,1),new En(0,1,1,1),new En(3,1,1,1),new En(1,1,1,1),new En(3,0,1,1),new En(1,0,1,1)],this._cubeDirections=[new Dn(1,0,0),new Dn(-1,0,0),new Dn(0,0,1),new Dn(0,0,-1),new Dn(0,1,0),new Dn(0,-1,0)],this._cubeUps=[new Dn(0,1,0),new Dn(0,1,0),new Dn(0,1,0),new Dn(0,1,0),new Dn(0,0,1),new Dn(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Dh.setFromMatrixPosition(t.matrixWorld),n.position.copy(Dh),Rh.copy(n.position),Rh.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(Rh),n.updateMatrixWorld(),i.makeTranslation(-Dh.x,-Dh.y,-Dh.z),Ph.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ph)}}class Oh extends wh{constructor(t,e,n=0,i=1){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Ih}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class Nh extends Ah{constructor(){super(new Fo(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Uh extends wh{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ii.DefaultUp),this.updateMatrix(),this.target=new Ii,this.shadow=new Nh}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class kh extends wh{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class zh{static decodeText(t){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,r=t.length;i<r;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(n){return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!==typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}}const Fh="\\[\\]\\.:\\/",Bh=new RegExp("["+Fh+"]","g"),Vh="[^"+Fh+"]",Hh="[^"+Fh.replace("\\.","")+"]",Gh=/((?:WC+[\/:])*)/.source.replace("WC",Vh),Wh=/(WCOD+)?/.source.replace("WCOD",Hh),jh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Vh),Xh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Vh),qh=new RegExp("^"+Gh+Wh+jh+Xh+"$"),$h=["material","materials","bones","map"];class Yh{constructor(t,e,n){const i=n||Zh.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)}setValue(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}class Zh{constructor(t,e,n){this.path=e,this.parsedPath=n||Zh.parseTrackName(e),this.node=Zh.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new Zh.Composite(t,e,n):new Zh(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Bh,"")}static parseTrackName(t){const e=qh.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==$h.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.name===e||r.uuid===e)return r;const a=n(r.children);if(a)return a}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)t[e++]=n[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,n=e.objectName,i=e.propertyName;let r=e.propertyIndex;if(t||(t=Zh.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let i=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===i){i=e;break}break;case"map":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==i){if(void 0===t[i])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[i]}}const a=t[i];if(void 0===a){const n=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}let s=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Zh.Composite=Yh,Zh.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Zh.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Zh.prototype.GetterByBindingType=[Zh.prototype._getValue_direct,Zh.prototype._getValue_array,Zh.prototype._getValue_arrayElement,Zh.prototype._getValue_toArray],Zh.prototype.SetterByBindingTypeAndVersioning=[[Zh.prototype._setValue_direct,Zh.prototype._setValue_direct_setNeedsUpdate,Zh.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Zh.prototype._setValue_array,Zh.prototype._setValue_array_setNeedsUpdate,Zh.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Zh.prototype._setValue_arrayElement,Zh.prototype._setValue_arrayElement_setNeedsUpdate,Zh.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Zh.prototype._setValue_fromArray,Zh.prototype._setValue_fromArray_setNeedsUpdate,Zh.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1);class Kh{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Ue(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:i}})),"undefined"!==typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=i)},8710:function(t,e,n){"use strict";n.d(e,"a",(function(){return Be}));var i={};n.r(i),n.d(i,"Deflate",(function(){return Et})),n.d(i,"AsyncDeflate",(function(){return At})),n.d(i,"deflate",(function(){return Ct})),n.d(i,"deflateSync",(function(){return Lt})),n.d(i,"Inflate",(function(){return Pt})),n.d(i,"AsyncInflate",(function(){return Dt})),n.d(i,"inflate",(function(){return Rt})),n.d(i,"inflateSync",(function(){return It})),n.d(i,"Gzip",(function(){return Ot})),n.d(i,"AsyncGzip",(function(){return Nt})),n.d(i,"gzip",(function(){return Ut})),n.d(i,"gzipSync",(function(){return kt})),n.d(i,"Gunzip",(function(){return zt})),n.d(i,"AsyncGunzip",(function(){return Ft})),n.d(i,"gunzip",(function(){return Bt})),n.d(i,"gunzipSync",(function(){return Vt})),n.d(i,"Zlib",(function(){return Ht})),n.d(i,"AsyncZlib",(function(){return Gt})),n.d(i,"zlib",(function(){return Wt})),n.d(i,"zlibSync",(function(){return jt})),n.d(i,"Unzlib",(function(){return Xt})),n.d(i,"AsyncUnzlib",(function(){return qt})),n.d(i,"unzlib",(function(){return $t})),n.d(i,"unzlibSync",(function(){return Yt})),n.d(i,"compress",(function(){return Ut})),n.d(i,"AsyncCompress",(function(){return Nt})),n.d(i,"compressSync",(function(){return kt})),n.d(i,"Compress",(function(){return Ot})),n.d(i,"Decompress",(function(){return Zt})),n.d(i,"AsyncDecompress",(function(){return Kt})),n.d(i,"decompress",(function(){return Jt})),n.d(i,"decompressSync",(function(){return Qt})),n.d(i,"DecodeUTF8",(function(){return ae})),n.d(i,"EncodeUTF8",(function(){return se})),n.d(i,"strToU8",(function(){return oe})),n.d(i,"strFromU8",(function(){return le})),n.d(i,"ZipPassThrough",(function(){return ge})),n.d(i,"ZipDeflate",(function(){return ve})),n.d(i,"AsyncZipDeflate",(function(){return _e})),n.d(i,"Zip",(function(){return xe})),n.d(i,"zip",(function(){return ye})),n.d(i,"zipSync",(function(){return be})),n.d(i,"UnzipPassThrough",(function(){return Me})),n.d(i,"UnzipInflate",(function(){return we})),n.d(i,"AsyncUnzipInflate",(function(){return Se})),n.d(i,"Unzip",(function(){return Te})),n.d(i,"unzip",(function(){return Ee})),n.d(i,"unzipSync",(function(){return Ae}));var r=n("5a89"),a={},s=function(t){return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},o=function(t){return new Worker(t)};
  14. /*!
  15. fflate - fast JavaScript compression/decompression
  16. <https://101arrowz.github.io/fflate>
  17. Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
  18. version 0.6.9
  19. */try{URL.revokeObjectURL(s(""))}catch(un){s=function(t){return"data:application/javascript;charset=UTF-8,"+encodeURI(t)},o=function(t){return new Worker(t,{type:"module"})}}var l=function(t,e,n,i,r){var l=o(a[e]||(a[e]=s(t)));return l.onerror=function(t){return r(t.error,null)},l.onmessage=function(t){return r(null,t.data)},l.postMessage(n,i),l},c=Uint8Array,u=Uint16Array,h=Uint32Array,d=new c([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),p=new c([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new c([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m=function(t,e){for(var n=new u(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new h(n[30]);for(i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return[n,r]},g=m(d,2),v=g[0],_=g[1];v[28]=258,_[258]=28;for(var x=m(p,0),y=x[0],b=x[1],M=new u(32768),w=0;w<32768;++w){var S=(43690&w)>>>1|(21845&w)<<1;S=(52428&S)>>>2|(13107&S)<<2,S=(61680&S)>>>4|(3855&S)<<4,M[w]=((65280&S)>>>8|(255&S)<<8)>>>1}var T=function(t,e,n){for(var i=t.length,r=0,a=new u(e);r<i;++r)++a[t[r]-1];var s,o=new u(e);for(r=0;r<e;++r)o[r]=o[r-1]+a[r-1]<<1;if(n){s=new u(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],h=e-t[r],d=o[t[r]-1]++<<h,p=d|(1<<h)-1;d<=p;++d)s[M[d]>>>l]=c}else for(s=new u(i),r=0;r<i;++r)t[r]&&(s[r]=M[o[t[r]-1]++]>>>15-t[r]);return s},E=new c(288);for(w=0;w<144;++w)E[w]=8;for(w=144;w<256;++w)E[w]=9;for(w=256;w<280;++w)E[w]=7;for(w=280;w<288;++w)E[w]=8;var A=new c(32);for(w=0;w<32;++w)A[w]=5;var C=T(E,9,0),L=T(E,9,1),P=T(A,5,0),D=T(A,5,1),R=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},I=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(7&e)&n},O=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},N=function(t){return(t/8|0)+(7&t&&1)},U=function(t,e,n){(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof u?u:t instanceof h?h:c)(n-e);return i.set(t.subarray(e,n)),i},k=function(t,e,n){var i=t.length;if(!i||n&&!n.l&&i<5)return e||new c(0);var r=!e||n,a=!n||n.i;n||(n={}),e||(e=new c(3*i));var s=function(t){var n=e.length;if(t>n){var i=new c(Math.max(2*n,t));i.set(e),e=i}},o=n.f||0,l=n.p||0,u=n.b||0,h=n.l,m=n.d,g=n.m,_=n.n,x=8*i;do{if(!h){n.f=o=I(t,l,1);var b=I(t,l+1,3);if(l+=3,!b){var M=N(l)+4,w=t[M-4]|t[M-3]<<8,S=M+w;if(S>i){if(a)throw"unexpected EOF";break}r&&s(u+w),e.set(t.subarray(M,S),u),n.b=u+=w,n.p=l=8*S;continue}if(1==b)h=L,m=D,g=9,_=5;else{if(2!=b)throw"invalid block type";var E=I(t,l,31)+257,A=I(t,l+10,15)+4,C=E+I(t,l+5,31)+1;l+=14;for(var P=new c(C),k=new c(19),z=0;z<A;++z)k[f[z]]=I(t,l+3*z,7);l+=3*A;var F=R(k),B=(1<<F)-1,V=T(k,F,1);for(z=0;z<C;){var H=V[I(t,l,B)];l+=15&H;M=H>>>4;if(M<16)P[z++]=M;else{var G=0,W=0;16==M?(W=3+I(t,l,3),l+=2,G=P[z-1]):17==M?(W=3+I(t,l,7),l+=3):18==M&&(W=11+I(t,l,127),l+=7);while(W--)P[z++]=G}}var j=P.subarray(0,E),X=P.subarray(E);g=R(j),_=R(X),h=T(j,g,1),m=T(X,_,1)}if(l>x){if(a)throw"unexpected EOF";break}}r&&s(u+131072);for(var q=(1<<g)-1,$=(1<<_)-1,Y=l;;Y=l){G=h[O(t,l)&q];var Z=G>>>4;if(l+=15&G,l>x){if(a)throw"unexpected EOF";break}if(!G)throw"invalid length/literal";if(Z<256)e[u++]=Z;else{if(256==Z){Y=l,h=null;break}var K=Z-254;if(Z>264){z=Z-257;var J=d[z];K=I(t,l,(1<<J)-1)+v[z],l+=J}var Q=m[O(t,l)&$],tt=Q>>>4;if(!Q)throw"invalid distance";l+=15&Q;X=y[tt];if(tt>3){J=p[tt];X+=O(t,l)&(1<<J)-1,l+=J}if(l>x){if(a)throw"unexpected EOF";break}r&&s(u+131072);for(var et=u+K;u<et;u+=4)e[u]=e[u-X],e[u+1]=e[u+1-X],e[u+2]=e[u+2-X],e[u+3]=e[u+3-X];u=et}}n.l=h,n.p=Y,n.b=u,h&&(o=1,n.m=g,n.d=m,n.n=_)}while(!o);return u==e.length?e:U(e,0,u)},z=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>>8},F=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>>8,t[i+2]|=n>>>16},B=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,a=n.slice();if(!r)return[q,0];if(1==r){var s=new c(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],h=0,d=1,p=2;n[0]={s:-1,f:o.f+l.f,l:o,r:l};while(d!=r-1)o=n[n[h].f<n[p].f?h++:p++],l=n[h!=d&&n[h].f<n[p].f?h++:p++],n[d++]={s:-1,f:o.f+l.f,l:o,r:l};var f=a[0].s;for(i=1;i<r;++i)a[i].s>f&&(f=a[i].s);var m=new u(f+1),g=V(n[d-1],m,0);if(g>e){i=0;var v=0,_=g-e,x=1<<_;for(a.sort((function(t,e){return m[e.s]-m[t.s]||t.f-e.f}));i<r;++i){var y=a[i].s;if(!(m[y]>e))break;v+=x-(1<<g-m[y]),m[y]=e}v>>>=_;while(v>0){var b=a[i].s;m[b]<e?v-=1<<e-m[b]++-1:++i}for(;i>=0&&v;--i){var M=a[i].s;m[M]==e&&(--m[M],++v)}g=e}return[new c(m),g]},V=function(t,e,n){return-1==t.s?Math.max(V(t.l,e,n+1),V(t.r,e,n+1)):e[t.s]=n},H=function(t){var e=t.length;while(e&&!t[--e]);for(var n=new u(++e),i=0,r=t[0],a=1,s=function(t){n[i++]=t},o=1;o<=e;++o)if(t[o]==r&&o!=e)++a;else{if(!r&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(r),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}while(a--)s(r);a=1,r=t[o]}return[n.subarray(0,i),e]},G=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},W=function(t,e,n){var i=n.length,r=N(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var a=0;a<i;++a)t[r+a+4]=n[a];return 8*(r+4+i)},j=function(t,e,n,i,r,a,s,o,l,c,h){z(e,h++,n),++r[256];for(var m=B(r,15),g=m[0],v=m[1],_=B(a,15),x=_[0],y=_[1],b=H(g),M=b[0],w=b[1],S=H(x),L=S[0],D=S[1],R=new u(19),I=0;I<M.length;++I)R[31&M[I]]++;for(I=0;I<L.length;++I)R[31&L[I]]++;for(var O=B(R,7),N=O[0],U=O[1],k=19;k>4&&!N[f[k-1]];--k);var V,j,X,q,$=c+5<<3,Y=G(r,E)+G(a,A)+s,Z=G(r,g)+G(a,x)+s+14+3*k+G(R,N)+(2*R[16]+3*R[17]+7*R[18]);if($<=Y&&$<=Z)return W(e,h,t.subarray(l,l+c));if(z(e,h,1+(Z<Y)),h+=2,Z<Y){V=T(g,v,0),j=g,X=T(x,y,0),q=x;var K=T(N,U,0);z(e,h,w-257),z(e,h+5,D-1),z(e,h+10,k-4),h+=14;for(I=0;I<k;++I)z(e,h+3*I,N[f[I]]);h+=3*k;for(var J=[M,L],Q=0;Q<2;++Q){var tt=J[Q];for(I=0;I<tt.length;++I){var et=31&tt[I];z(e,h,K[et]),h+=N[et],et>15&&(z(e,h,tt[I]>>>5&127),h+=tt[I]>>>12)}}}else V=C,j=E,X=P,q=A;for(I=0;I<o;++I)if(i[I]>255){et=i[I]>>>18&31;F(e,h,V[et+257]),h+=j[et+257],et>7&&(z(e,h,i[I]>>>23&31),h+=d[et]);var nt=31&i[I];F(e,h,X[nt]),h+=q[nt],nt>3&&(F(e,h,i[I]>>>5&8191),h+=p[nt])}else F(e,h,V[i[I]]),h+=j[i[I]];return F(e,h,V[256]),h+j[256]},X=new h([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),q=new c(0),$=function(t,e,n,i,r,a){var s=t.length,o=new c(i+s+5*(1+Math.ceil(s/7e3))+r),l=o.subarray(i,o.length-r),f=0;if(!e||s<8)for(var m=0;m<=s;m+=65535){var g=m+65535;g<s?f=W(l,f,t.subarray(m,g)):(l[m]=a,f=W(l,f,t.subarray(m,s)))}else{for(var v=X[e-1],x=v>>>13,y=8191&v,M=(1<<n)-1,w=new u(32768),S=new u(M+1),T=Math.ceil(n/3),E=2*T,A=function(e){return(t[e]^t[e+1]<<T^t[e+2]<<E)&M},C=new h(25e3),L=new u(288),P=new u(32),D=0,R=0,I=(m=0,0),O=0,k=0;m<s;++m){var z=A(m),F=32767&m,B=S[z];if(w[F]=B,S[z]=F,O<=m){var V=s-m;if((D>7e3||I>24576)&&V>423){f=j(t,l,0,C,L,P,R,I,k,m-k,f),I=D=R=0,k=m;for(var H=0;H<286;++H)L[H]=0;for(H=0;H<30;++H)P[H]=0}var G=2,$=0,Y=y,Z=F-B&32767;if(V>2&&z==A(m-Z)){var K=Math.min(x,V)-1,J=Math.min(32767,m),Q=Math.min(258,V);while(Z<=J&&--Y&&F!=B){if(t[m+G]==t[m+G-Z]){for(var tt=0;tt<Q&&t[m+tt]==t[m+tt-Z];++tt);if(tt>G){if(G=tt,$=Z,tt>K)break;var et=Math.min(Z,tt-2),nt=0;for(H=0;H<et;++H){var it=m-Z+H+32768&32767,rt=w[it],at=it-rt+32768&32767;at>nt&&(nt=at,B=it)}}}F=B,B=w[F],Z+=F-B+32768&32767}}if($){C[I++]=268435456|_[G]<<18|b[$];var st=31&_[G],ot=31&b[$];R+=d[st]+p[ot],++L[257+st],++P[ot],O=m+G,++D}else C[I++]=t[m],++L[t[m]]}}f=j(t,l,a,C,L,P,R,I,k,m-k,f),!a&&7&f&&(f=W(l,f+1,q))}return U(o,0,i+N(f)+r)},Y=function(){for(var t=new h(256),e=0;e<256;++e){var n=e,i=9;while(--i)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Z=function(){var t=-1;return{p:function(e){for(var n=t,i=0;i<e.length;++i)n=Y[255&n^e[i]]^n>>>8;t=n},d:function(){return~t}}},K=function(){var t=1,e=0;return{p:function(n){for(var i=t,r=e,a=n.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)r+=i+=n[s];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,e=r},d:function(){return t%=65521,e%=65521,(255&t)<<24|t>>>8<<16|(255&e)<<8|e>>>8}}},J=function(t,e,n,i,r){return $(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,i,!r)},Q=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},tt=function(t,e,n){for(var i=t(),r=t.toString(),a=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/ /g,"").split(","),s=0;s<i.length;++s){var o=i[s],l=a[s];if("function"==typeof o){e+=";"+l+"=";var c=o.toString();if(o.prototype)if(-1!=c.indexOf("[native code]")){var u=c.indexOf(" ",8)+1;e+=c.slice(u,c.indexOf("(",u))}else for(var h in e+=c,o.prototype)e+=";"+l+".prototype."+h+"="+o.prototype[h].toString();else e+=c}else n[l]=o}return[e,n]},et=[],nt=function(t){var e=[];for(var n in t)(t[n]instanceof c||t[n]instanceof u||t[n]instanceof h)&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},it=function(t,e,n,i){var r;if(!et[n]){for(var a="",s={},o=t.length-1,c=0;c<o;++c)r=tt(t[c],a,s),a=r[0],s=r[1];et[n]=tt(t[o],a,s)}var u=Q({},et[n][1]);return l(et[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,nt(u),i)},rt=function(){return[c,u,h,d,p,f,v,y,L,D,M,T,R,I,O,N,U,k,It,ut,ht]},at=function(){return[c,u,h,d,p,f,_,b,C,E,P,A,M,X,q,T,z,F,B,V,H,G,W,j,N,U,$,J,Lt,ut]},st=function(){return[xt,Mt,_t,Z,Y]},ot=function(){return[yt,bt]},lt=function(){return[wt,_t,K]},ct=function(){return[St]},ut=function(t){return postMessage(t,[t.buffer])},ht=function(t){return t&&t.size&&new c(t.size)},dt=function(t,e,n,i,r,a){var s=it(n,i,r,(function(t,e){s.terminate(),a(t,e)}));return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},pt=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},ft=function(t,e,n,i,r){var a,s=it(t,i,r,(function(t,n){t?(s.terminate(),e.ondata.call(e,t)):(n[1]&&s.terminate(),e.ondata.call(e,t,n[0],n[1]))}));s.postMessage(n),e.push=function(t,n){if(a)throw"stream finished";if(!e.ondata)throw"no stream handler";s.postMessage([t,a=n],[t.buffer])},e.terminate=function(){s.terminate()}},mt=function(t,e){return t[e]|t[e+1]<<8},gt=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},vt=function(t,e){return gt(t,e)+4294967296*gt(t,e+4)},_t=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},xt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&_t(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;i<=n.length;++i)t[i+10]=n.charCodeAt(i)}},yt=function(t){if(31!=t[0]||139!=t[1]||8!=t[2])throw"invalid gzip data";var e=t[3],n=10;4&e&&(n+=t[10]|2+(t[11]<<8));for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(2&e)},bt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Mt=function(t){return 10+(t.filename&&t.filename.length+1||0)},wt=function(t,e){var n=e.level,i=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=i<<6|(i?32-2*i:1)},St=function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"};function Tt(t,e){return e||"function"!=typeof t||(e=t,t={}),this.ondata=e,t}var Et=function(){function t(t,e){e||"function"!=typeof t||(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(J(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=e,this.p(t,e||!1)},t}(),At=function(){function t(t,e){ft([at,function(){return[pt,Et]}],this,Tt.call(this,t,e),(function(t){var e=new Et(t.data);onmessage=pt(e)}),6)}return t}();function Ct(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return dt(t,e,[at],(function(t){return ut(Lt(t.data[0],t.data[1]))}),0,n)}function Lt(t,e){return J(t,e||{},0,0)}var Pt=function(){function t(t){this.s={},this.p=new c(0),this.ondata=t}return t.prototype.e=function(t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var e=this.p.length,n=new c(e+t.length);n.set(this.p),n.set(t,e),this.p=n},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=k(this.p,this.o,this.s);this.ondata(U(n,e,this.s.b),this.d),this.o=U(n,this.s.b-32768),this.s.b=this.o.length,this.p=U(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Dt=function(){function t(t){this.ondata=t,ft([rt,function(){return[pt,Pt]}],this,0,(function(){var t=new Pt;onmessage=pt(t)}),7)}return t}();function Rt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return dt(t,e,[rt],(function(t){return ut(It(t.data[0],ht(t.data[1])))}),1,n)}function It(t,e){return k(t,e)}var Ot=function(){function t(t,e){this.c=Z(),this.l=0,this.v=1,Et.call(this,t,e)}return t.prototype.push=function(t,e){Et.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=J(t,this.o,this.v&&Mt(this.o),e&&8,!e);this.v&&(xt(n,this.o),this.v=0),e&&(_t(n,n.length-8,this.c.d()),_t(n,n.length-4,this.l)),this.ondata(n,e)},t}(),Nt=function(){function t(t,e){ft([at,st,function(){return[pt,Et,Ot]}],this,Tt.call(this,t,e),(function(t){var e=new Ot(t.data);onmessage=pt(e)}),8)}return t}();function Ut(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return dt(t,e,[at,st,function(){return[kt]}],(function(t){return ut(kt(t.data[0],t.data[1]))}),2,n)}function kt(t,e){e||(e={});var n=Z(),i=t.length;n.p(t);var r=J(t,e,Mt(e),8),a=r.length;return xt(r,e),_t(r,a-8,n.d()),_t(r,a-4,i),r}var zt=function(){function t(t){this.v=1,Pt.call(this,t)}return t.prototype.push=function(t,e){if(Pt.prototype.e.call(this,t),this.v){var n=this.p.length>3?yt(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}if(e){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Pt.prototype.c.call(this,e)},t}(),Ft=function(){function t(t){this.ondata=t,ft([rt,ot,function(){return[pt,Pt,zt]}],this,0,(function(){var t=new zt;onmessage=pt(t)}),9)}return t}();function Bt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return dt(t,e,[rt,ot,function(){return[Vt]}],(function(t){return ut(Vt(t.data[0]))}),3,n)}function Vt(t,e){return k(t.subarray(yt(t),-8),e||new c(bt(t)))}var Ht=function(){function t(t,e){this.c=K(),this.v=1,Et.call(this,t,e)}return t.prototype.push=function(t,e){Et.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=J(t,this.o,this.v&&2,e&&4,!e);this.v&&(wt(n,this.o),this.v=0),e&&_t(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),Gt=function(){function t(t,e){ft([at,lt,function(){return[pt,Et,Ht]}],this,Tt.call(this,t,e),(function(t){var e=new Ht(t.data);onmessage=pt(e)}),10)}return t}();function Wt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return dt(t,e,[at,lt,function(){return[jt]}],(function(t){return ut(jt(t.data[0],t.data[1]))}),4,n)}function jt(t,e){e||(e={});var n=K();n.p(t);var i=J(t,e,2,4);return wt(i,e),_t(i,i.length-4,n.d()),i}var Xt=function(){function t(t){this.v=1,Pt.call(this,t)}return t.prototype.push=function(t,e){if(Pt.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}if(e){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Pt.prototype.c.call(this,e)},t}(),qt=function(){function t(t){this.ondata=t,ft([rt,ct,function(){return[pt,Pt,Xt]}],this,0,(function(){var t=new Xt;onmessage=pt(t)}),11)}return t}();function $t(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return dt(t,e,[rt,ct,function(){return[Yt]}],(function(t){return ut(Yt(t.data[0],ht(t.data[1])))}),5,n)}function Yt(t,e){return k((St(t),t.subarray(2,-4)),e)}var Zt=function(){function t(t){this.G=zt,this.I=Pt,this.Z=Xt,this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new c(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var i=this,r=function(){i.ondata.apply(i,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(r):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(r):new this.Z(r),this.s.push(this.p,e),this.p=null}}},t}(),Kt=function(){function t(t){this.G=Ft,this.I=Dt,this.Z=qt,this.ondata=t}return t.prototype.push=function(t,e){Zt.prototype.push.call(this,t,e)},t}();function Jt(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";return 31==t[0]&&139==t[1]&&8==t[2]?Bt(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Rt(t,e,n):$t(t,e,n)}function Qt(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Vt(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?It(t,e):Yt(t,e)}var te=function(t,e,n,i){for(var r in t){var a=t[r],s=e+r;a instanceof c?n[s]=[a,i]:Array.isArray(a)?n[s]=[a[0],Q(i,a[1])]:te(a,s+"/",n,i)}},ee="undefined"!=typeof TextEncoder&&new TextEncoder,ne="undefined"!=typeof TextDecoder&&new TextDecoder,ie=0;try{ne.decode(q,{stream:!0}),ie=1}catch(un){}var re=function(t){for(var e="",n=0;;){var i=t[n++],r=(i>127)+(i>223)+(i>239);if(n+r>t.length)return[e,U(t,n-1)];r?3==r?(i=((15&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=1&r?String.fromCharCode((31&i)<<6|63&t[n++]):String.fromCharCode((15&i)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(i)}},ae=function(){function t(t){this.ondata=t,ie?this.t=new TextDecoder:this.p=q}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(e=!!e,this.t){if(this.ondata(this.t.decode(t,{stream:!0}),e),e){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var n=new c(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var i=re(n),r=i[0],a=i[1];if(e){if(a.length)throw"invalid utf-8 data";this.p=null}else this.p=a;this.ondata(r,e)}},t}(),se=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(oe(t),this.d=e||!1)},t}();function oe(t,e){if(e){for(var n=new c(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}if(ee)return ee.encode(t);var r=t.length,a=new c(t.length+(t.length>>1)),s=0,o=function(t){a[s++]=t};for(i=0;i<r;++i){if(s+5>a.length){var l=new c(s+8+(r-i<<1));l.set(a),a=l}var u=t.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>6),o(128|63&u)):u>55295&&u<57344?(u=65536+(1047552&u)|1023&t.charCodeAt(++i),o(240|u>>18),o(128|u>>12&63),o(128|u>>6&63),o(128|63&u)):(o(224|u>>12),o(128|u>>6&63),o(128|63&u))}return U(a,0,s)}function le(t,e){if(e){for(var n="",i=0;i<t.length;i+=16384)n+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return n}if(ne)return ne.decode(t);var r=re(t),a=r[0],s=r[1];if(s.length)throw"invalid utf-8 data";return a}var ce=function(t){return 1==t?3:t<6?2:9==t?1:0},ue=function(t,e){return e+30+mt(t,e+26)+mt(t,e+28)},he=function(t,e,n){var i=mt(t,e+28),r=le(t.subarray(e+46,e+46+i),!(2048&mt(t,e+8))),a=e+46+i,s=gt(t,e+20),o=n&&4294967295==s?de(t,a):[s,gt(t,e+24),gt(t,e+42)],l=o[0],c=o[1],u=o[2];return[mt(t,e+10),l,c,r,a+mt(t,e+30)+mt(t,e+32),u]},de=function(t,e){for(;1!=mt(t,e);e+=4+mt(t,e+2));return[vt(t,e+12),vt(t,e+4),vt(t,e+20)]},pe=function(t){var e=0;if(t)for(var n in t){var i=t[n].length;if(i>65535)throw"extra field too long";e+=i+4}return e},fe=function(t,e,n,i,r,a,s,o){var l=i.length,c=n.extra,u=o&&o.length,h=pe(c);_t(t,e,null!=s?33639248:67324752),e+=4,null!=s&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(null==a&&8),t[e++]=r&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),p=d.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";if(_t(t,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,null!=a&&(_t(t,e,n.crc),_t(t,e+4,a),_t(t,e+8,n.size)),_t(t,e+12,l),_t(t,e+14,h),e+=16,null!=s&&(_t(t,e,u),_t(t,e+6,n.attrs),_t(t,e+10,s),e+=14),t.set(i,e),e+=l,h)for(var f in c){var m=c[f],g=m.length;_t(t,e,+f),_t(t,e+2,g),t.set(m,e+4),e+=4+g}return u&&(t.set(o,e),e+=u),e},me=function(t,e,n,i,r){_t(t,e,101010256),_t(t,e+8,n),_t(t,e+10,n),_t(t,e+12,i),_t(t,e+16,r)},ge=function(){function t(t){this.filename=t,this.c=Z(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),ve=function(){function t(t,e){var n=this;e||(e={}),ge.call(this,t),this.d=new Et(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=ce(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(un){this.ondata(un,null,e)}},t.prototype.push=function(t,e){ge.prototype.push.call(this,t,e)},t}(),_e=function(){function t(t,e){var n=this;e||(e={}),ge.call(this,t),this.d=new At(e,(function(t,e,i){n.ondata(t,e,i)})),this.compression=8,this.flag=ce(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ge.prototype.push.call(this,t,e)},t}(),xe=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(2&this.d)throw"stream finished";var n=oe(t.filename),i=n.length,r=t.comment,a=r&&oe(r),s=i!=t.filename.length||a&&r.length!=a.length,o=i+pe(t.extra)+30;if(i>65535)throw"filename too long";var l=new c(o);fe(l,0,t,n,s);var u=[l],h=function(){for(var t=0,n=u;t<n.length;t++){var i=n[t];e.ondata(null,i,!1)}u=[]},d=this.d;this.d=0;var p=this.u.length,f=Q(t,{f:n,u:s,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),d){var t=e.u[p+1];t?t.r():e.d=1}d=1}}),m=0;t.ondata=function(n,i,r){if(n)e.ondata(n,i,r),e.terminate();else if(m+=i.length,u.push(i),r){var a=new c(16);_t(a,0,134695760),_t(a,4,t.crc),_t(a,8,m),_t(a,12,t.size),u.push(a),f.c=m,f.b=o+m+16,f.crc=t.crc,f.size=t.size,d&&f.r(),d=1}else d&&h()},this.u.push(f)},t.prototype.end=function(){var t=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3},t.prototype.e=function(){for(var t=0,e=0,n=0,i=0,r=this.u;i<r.length;i++){var a=r[i];n+=46+a.f.length+pe(a.extra)+(a.o?a.o.length:0)}for(var s=new c(n+22),o=0,l=this.u;o<l.length;o++){a=l[o];fe(s,t,a,a.f,a.u,a.c,e,a.o),t+=46+a.f.length+pe(a.extra)+(a.o?a.o.length:0),e+=a.b}me(s,t,this.u.length,n,e),this.ondata(null,s,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){var n=e[t];n.t()}this.d=2},t}();function ye(t,e,n){if(n||(n=e,e={}),"function"!=typeof n)throw"no callback";var i={};te(t,"",i,e);var r=Object.keys(i),a=r.length,s=0,o=0,l=a,u=new Array(a),h=[],d=function(){for(var t=0;t<h.length;++t)h[t]()},p=function(){var t=new c(o+22),e=s,i=o-s;o=0;for(var r=0;r<l;++r){var a=u[r];try{var h=a.c.length;fe(t,o,a,a.f,a.u,h);var d=30+a.f.length+pe(a.extra),p=o+d;t.set(a.c,p),fe(t,s,a,a.f,a.u,h,o,a.m),s+=16+d+(a.m?a.m.length:0),o=p+h}catch(un){return n(un,null)}}me(t,s,u.length,i,e),n(null,t)};a||p();for(var f=function(t){var e=r[t],l=i[e],c=l[0],f=l[1],m=Z(),g=c.length;m.p(c);var v=oe(e),_=v.length,x=f.comment,y=x&&oe(x),b=y&&y.length,M=pe(f.extra),w=0==f.level?0:8,S=function(i,r){if(i)d(),n(i,null);else{var l=r.length;u[t]=Q(f,{size:g,crc:m.d(),c:r,f:v,m:y,u:_!=e.length||y&&x.length!=b,compression:w}),s+=30+_+M+l,o+=76+2*(_+M)+(b||0)+l,--a||p()}};if(_>65535&&S("filename too long",null),w)if(g<16e4)try{S(null,Lt(c,f))}catch(un){S(un,null)}else h.push(Ct(c,f,S));else S(null,c)},m=0;m<l;++m)f(m);return d}function be(t,e){e||(e={});var n={},i=[];te(t,"",n,e);var r=0,a=0;for(var s in n){var o=n[s],l=o[0],u=o[1],h=0==u.level?0:8,d=oe(s),p=d.length,f=u.comment,m=f&&oe(f),g=m&&m.length,v=pe(u.extra);if(p>65535)throw"filename too long";var _=h?Lt(l,u):l,x=_.length,y=Z();y.p(l),i.push(Q(u,{size:l.length,crc:y.d(),c:_,f:d,m:m,u:p!=s.length||m&&f.length!=g,o:r,compression:h})),r+=30+p+v+x,a+=76+2*(p+v)+(g||0)+x}for(var b=new c(a+22),M=r,w=a-r,S=0;S<i.length;++S){d=i[S];fe(b,d.o,d,d.f,d.u,d.c.length);var T=30+d.f.length+pe(d.extra);b.set(d.c,d.o+T),fe(b,r,d,d.f,d.u,d.c.length,d.o,d.m),r+=16+T+(d.m?d.m.length:0)}return me(b,r,i.length,w,M),b}var Me=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),we=function(){function t(){var t=this;this.i=new Pt((function(e,n){t.ondata(null,e,n)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(un){this.ondata(un,t,e)}},t.compression=8,t}(),Se=function(){function t(t,e){var n=this;e<32e4?this.i=new Pt((function(t,e){n.ondata(null,t,e)})):(this.i=new Dt((function(t,e,i){n.ondata(t,e,i)})),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=U(t,0)),this.i.push(t,e)},t.compression=8,t}(),Te=function(){function t(t){this.onfile=t,this.k=[],this.o={0:Me},this.p=q}return t.prototype.push=function(t,e){var n=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var i=Math.min(this.c,t.length),r=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(r,!this.c):this.k[0].push(r),t=t.subarray(i),t.length)return this.push(t,e)}else{var a=0,s=0,o=void 0,l=void 0;this.p.length?t.length?(l=new c(this.p.length+t.length),l.set(this.p),l.set(t,this.p.length)):l=this.p:l=t;for(var u=l.length,h=this.c,d=h&&this.d,p=function(){var t,e=gt(l,s);if(67324752==e){a=1,o=s,f.d=null,f.c=0;var i=mt(l,s+6),r=mt(l,s+8),c=2048&i,d=8&i,p=mt(l,s+26),m=mt(l,s+28);if(u>s+30+p+m){var g=[];f.k.unshift(g),a=2;var v,_=gt(l,s+18),x=gt(l,s+22),y=le(l.subarray(s+30,s+=30+p),!c);4294967295==_?(t=d?[-2]:de(l,s),_=t[0],x=t[1]):d&&(_=-1),s+=m,f.c=_;var b={name:y,compression:r,start:function(){if(!b.ondata)throw"no callback";if(_){var t=n.o[r];if(!t)throw"unknown compression type "+r;v=_<0?new t(y):new t(y,_,x),v.ondata=function(t,e,n){b.ondata(t,e,n)};for(var e=0,i=g;e<i.length;e++){var a=i[e];v.push(a,!1)}n.k[0]==g&&n.c?n.d=v:v.push(q,!0)}else b.ondata(null,q,!0)},terminate:function(){v&&v.terminate&&v.terminate()}};_>=0&&(b.size=_,b.originalSize=x),f.onfile(b)}return"break"}if(h){if(134695760==e)return o=s+=12+(-2==h&&8),a=3,f.c=0,"break";if(33639248==e)return o=s-=4,a=3,f.c=0,"break"}},f=this;s<u-4;++s){var m=p();if("break"===m)break}if(this.p=q,h<0){var g=a?l.subarray(0,o-12-(-2==h&&8)-(134695760==gt(l,o-16)&&4)):l.subarray(0,s);d?d.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(l.subarray(s),e);this.p=l.subarray(s)}if(e){if(this.c)throw"invalid zip file";this.p=null}},t.prototype.register=function(t){this.o[t.compression]=t},t}();function Ee(t,e){if("function"!=typeof e)throw"no callback";for(var n=[],i=function(){for(var t=0;t<n.length;++t)n[t]()},r={},a=t.length-22;101010256!=gt(t,a);--a)if(!a||t.length-a>65558)return void e("invalid zip file",null);var s=mt(t,a+8);s||e(null,{});var o=s,l=gt(t,a+16),u=4294967295==l;if(u){if(a=gt(t,a-12),101075792!=gt(t,a))return void e("invalid zip file",null);o=s=gt(t,a+32),l=gt(t,a+48)}for(var h=function(o){var h=he(t,l,u),d=h[0],p=h[1],f=h[2],m=h[3],g=h[4],v=h[5],_=ue(t,v);l=g;var x=function(t,n){t?(i(),e(t,null)):(r[m]=n,--s||e(null,r))};if(d)if(8==d){var y=t.subarray(_,_+p);if(p<32e4)try{x(null,It(y,new c(f)))}catch(a){x(a,null)}else n.push(Rt(y,{size:f},x))}else x("unknown compression type "+d,null);else x(null,U(t,_,_+p))},d=0;d<o;++d)h(d);return i}function Ae(t){for(var e={},n=t.length-22;101010256!=gt(t,n);--n)if(!n||t.length-n>65558)throw"invalid zip file";var i=mt(t,n+8);if(!i)return{};var r=gt(t,n+16),a=4294967295==r;if(a){if(n=gt(t,n-12),101075792!=gt(t,n))throw"invalid zip file";i=gt(t,n+32),r=gt(t,n+48)}for(var s=0;s<i;++s){var o=he(t,r,a),l=o[0],u=o[1],h=o[2],d=o[3],p=o[4],f=o[5],m=ue(t,f);if(r=p,l){if(8!=l)throw"unknown compression type "+l;e[d]=It(t.subarray(m,m+u),new c(h))}else e[d]=U(t,m,m+u)}return e}function Ce(t,e,n){const i=n.length-t-1;if(e>=n[i])return i-1;if(e<=n[t])return t;let r=t,a=i,s=Math.floor((r+a)/2);while(e<n[s]||e>=n[s+1])e<n[s]?a=s:r=s,s=Math.floor((r+a)/2);return s}function Le(t,e,n,i){const r=[],a=[],s=[];r[0]=1;for(let o=1;o<=n;++o){a[o]=e-i[t+1-o],s[o]=i[t+o]-e;let n=0;for(let t=0;t<o;++t){const e=s[t+1],i=a[o-t],l=r[t]/(e+i);r[t]=n+e*l,n=i*l}r[o]=n}return r}function Pe(t,e,n,i){const a=Ce(t,i,e),s=Le(a,i,t,e),o=new r["U"](0,0,0,0);for(let r=0;r<=t;++r){const e=n[a-t+r],i=s[r],l=e.w*i;o.x+=e.x*l,o.y+=e.y*l,o.z+=e.z*l,o.w+=e.w*i}return o}function De(t,e,n,i,r){const a=[];for(let h=0;h<=n;++h)a[h]=0;const s=[];for(let h=0;h<=i;++h)s[h]=a.slice(0);const o=[];for(let h=0;h<=n;++h)o[h]=a.slice(0);o[0][0]=1;const l=a.slice(0),c=a.slice(0);for(let h=1;h<=n;++h){l[h]=e-r[t+1-h],c[h]=r[t+h]-e;let n=0;for(let t=0;t<h;++t){const e=c[t+1],i=l[h-t];o[h][t]=e+i;const r=o[t][h-1]/o[h][t];o[t][h]=n+e*r,n=i*r}o[h][h]=n}for(let h=0;h<=n;++h)s[0][h]=o[h][n];for(let h=0;h<=n;++h){let t=0,e=1;const r=[];for(let i=0;i<=n;++i)r[i]=a.slice(0);r[0][0]=1;for(let a=1;a<=i;++a){let i=0;const l=h-a,c=n-a;h>=a&&(r[e][0]=r[t][0]/o[c+1][l],i=r[e][0]*o[l][c]);const u=l>=-1?1:-l,d=h-1<=c?a-1:n-h;for(let n=u;n<=d;++n)r[e][n]=(r[t][n]-r[t][n-1])/o[c+1][l+n],i+=r[e][n]*o[l+n][c];h<=c&&(r[e][a]=-r[t][a-1]/o[c+1][h],i+=r[e][a]*o[h][c]),s[a][h]=i;const p=t;t=e,e=p}}let u=n;for(let h=1;h<=i;++h){for(let t=0;t<=n;++t)s[h][t]*=u;u*=n-h}return s}function Re(t,e,n,i,a){const s=a<t?a:t,o=[],l=Ce(t,i,e),c=De(l,i,t,s,e),u=[];for(let r=0;r<n.length;++r){const t=n[r].clone(),e=t.w;t.x*=e,t.y*=e,t.z*=e,u[r]=t}for(let r=0;r<=s;++r){const e=u[l-t].clone().multiplyScalar(c[r][0]);for(let n=1;n<=t;++n)e.add(u[l-t+n].clone().multiplyScalar(c[r][n]));o[r]=e}for(let h=s+1;h<=a+1;++h)o[h]=new r["U"](0,0,0);return o}function Ie(t,e){let n=1;for(let r=2;r<=t;++r)n*=r;let i=1;for(let r=2;r<=e;++r)i*=r;for(let r=2;r<=t-e;++r)i*=r;return n/i}function Oe(t){const e=t.length,n=[],i=[];for(let s=0;s<e;++s){const e=t[s];n[s]=new r["T"](e.x,e.y,e.z),i[s]=e.w}const a=[];for(let r=0;r<e;++r){const t=n[r].clone();for(let e=1;e<=r;++e)t.sub(a[r-e].clone().multiplyScalar(Ie(r,e)*i[e]));a[r]=t.divideScalar(i[0])}return a}function Ne(t,e,n,i,r){const a=Re(t,e,n,i,r);return Oe(a)}class Ue extends r["g"]{constructor(t,e,n,i,a){super(),this.degree=t,this.knots=e,this.controlPoints=[],this.startKnot=i||0,this.endKnot=a||this.knots.length-1;for(let s=0;s<n.length;++s){const t=n[s];this.controlPoints[s]=new r["U"](t.x,t.y,t.z,t.w)}}getPoint(t,e=new r["T"]){const n=e,i=this.knots[this.startKnot]+t*(this.knots[this.endKnot]-this.knots[this.startKnot]),a=Pe(this.degree,this.knots,this.controlPoints,i);return 1!==a.w&&a.divideScalar(a.w),n.set(a.x,a.y,a.z)}getTangent(t,e=new r["T"]){const n=e,i=this.knots[0]+t*(this.knots[this.knots.length-1]-this.knots[0]),a=Ne(this.degree,this.knots,this.controlPoints,i,1);return n.copy(a[1]).normalize(),n}}let ke,ze,Fe;class Be extends r["q"]{constructor(t){super(t)}load(t,e,n,i){const a=this,s=""===a.path?r["r"].extractUrlBase(t):a.path,o=new r["l"](this.manager);o.setPath(a.path),o.setResponseType("arraybuffer"),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(t,(function(n){try{e(a.parse(n,s))}catch(un){i?i(un):console.error(un),a.manager.itemError(t)}}),n,i)}parse(t,e){if($e(t))ke=(new je).parse(t);else{const e=sn(t);if(!Ye(e))throw new Error("THREE.FBXLoader: Unknown format.");if(Ze(e)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Ze(e));ke=(new We).parse(e)}const n=new r["Q"](this.manager).setPath(this.resourcePath||e).setCrossOrigin(this.crossOrigin);return new Ve(n,this.manager).parse(ke)}}class Ve{constructor(t,e){this.textureLoader=t,this.manager=e}parse(){ze=this.parseConnections();const t=this.parseImages(),e=this.parseTextures(t),n=this.parseMaterials(e),i=this.parseDeformers(),r=(new He).parse(i);return this.parseScene(i,r,n),Fe}parseConnections(){const t=new Map;if("Connections"in ke){const e=ke.Connections.connections;e.forEach((function(e){const n=e[0],i=e[1],r=e[2];t.has(n)||t.set(n,{parents:[],children:[]});const a={ID:i,relationship:r};t.get(n).parents.push(a),t.has(i)||t.set(i,{parents:[],children:[]});const s={ID:n,relationship:r};t.get(i).children.push(s)}))}return t}parseImages(){const t={},e={};if("Video"in ke.Objects){const n=ke.Objects.Video;for(const i in n){const r=n[i],a=parseInt(i);if(t[a]=r.RelativeFilename||r.Filename,"Content"in r){const t=r.Content instanceof ArrayBuffer&&r.Content.byteLength>0,a="string"===typeof r.Content&&""!==r.Content;if(t||a){const t=this.parseImage(n[i]);e[r.RelativeFilename||r.Filename]=t}}}}for(const n in t){const i=t[n];void 0!==e[i]?t[n]=e[i]:t[n]=t[n].split("\\").pop()}return t}parseImage(t){const e=t.Content,n=t.RelativeFilename||t.Filename,i=n.slice(n.lastIndexOf(".")+1).toLowerCase();let r;switch(i){case"bmp":r="image/bmp";break;case"jpg":case"jpeg":r="image/jpeg";break;case"png":r="image/png";break;case"tif":r="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),r="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+i+'" is not supported.')}if("string"===typeof e)return"data:"+r+";base64,"+e;{const t=new Uint8Array(e);return window.URL.createObjectURL(new Blob([t],{type:r}))}}parseTextures(t){const e=new Map;if("Texture"in ke.Objects){const n=ke.Objects.Texture;for(const i in n){const r=this.parseTexture(n[i],t);e.set(parseInt(i),r)}}return e}parseTexture(t,e){const n=this.loadTexture(t,e);n.ID=t.id,n.name=t.attrName;const i=t.WrapModeU,a=t.WrapModeV,s=void 0!==i?i.value:0,o=void 0!==a?a.value:0;if(n.wrapS=0===s?r["I"]:r["e"],n.wrapT=0===o?r["I"]:r["e"],"Scaling"in t){const e=t.Scaling.value;n.repeat.x=e[0],n.repeat.y=e[1]}if("Translation"in t){const e=t.Translation.value;n.offset.x=e[0],n.offset.y=e[1]}return n}loadTexture(t,e){let n;const i=this.textureLoader.path,a=ze.get(t.id).children;let s;void 0!==a&&a.length>0&&void 0!==e[a[0].ID]&&(n=e[a[0].ID],0!==n.indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));const o=t.FileName.slice(-3).toLowerCase();if("tga"===o){const e=this.manager.getHandler(".tga");null===e?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),s=new r["P"]):(e.setPath(this.textureLoader.path),s=e.load(n))}else"psd"===o?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),s=new r["P"]):s=this.textureLoader.load(n);return this.textureLoader.setPath(i),s}parseMaterials(t){const e=new Map;if("Material"in ke.Objects){const n=ke.Objects.Material;for(const i in n){const r=this.parseMaterial(n[i],t);null!==r&&e.set(parseInt(i),r)}}return e}parseMaterial(t,e){const n=t.id,i=t.attrName;let a=t.ShadingModel;if("object"===typeof a&&(a=a.value),!ze.has(n))return null;const s=this.parseParameters(t,e,n);let o;switch(a.toLowerCase()){case"phong":o=new r["y"];break;case"lambert":o=new r["x"];break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',a),o=new r["y"];break}return o.setValues(s),o.name=i,o}parseParameters(t,e,n){const i={};t.BumpFactor&&(i.bumpScale=t.BumpFactor.value),t.Diffuse?i.color=(new r["f"]).fromArray(t.Diffuse.value):!t.DiffuseColor||"Color"!==t.DiffuseColor.type&&"ColorRGB"!==t.DiffuseColor.type||(i.color=(new r["f"]).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(i.displacementScale=t.DisplacementFactor.value),t.Emissive?i.emissive=(new r["f"]).fromArray(t.Emissive.value):!t.EmissiveColor||"Color"!==t.EmissiveColor.type&&"ColorRGB"!==t.EmissiveColor.type||(i.emissive=(new r["f"]).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(i.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(i.opacity=parseFloat(t.Opacity.value)),i.opacity<1&&(i.transparent=!0),t.ReflectionFactor&&(i.reflectivity=t.ReflectionFactor.value),t.Shininess&&(i.shininess=t.Shininess.value),t.Specular?i.specular=(new r["f"]).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(i.specular=(new r["f"]).fromArray(t.SpecularColor.value));const a=this;return ze.get(n).children.forEach((function(t){const n=t.relationship;switch(n){case"Bump":i.bumpMap=a.getTexture(e,t.ID);break;case"Maya|TEX_ao_map":i.aoMap=a.getTexture(e,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=a.getTexture(e,t.ID),void 0!==i.map&&(i.map.encoding=r["X"]);break;case"DisplacementColor":i.displacementMap=a.getTexture(e,t.ID);break;case"EmissiveColor":i.emissiveMap=a.getTexture(e,t.ID),void 0!==i.emissiveMap&&(i.emissiveMap.encoding=r["X"]);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=a.getTexture(e,t.ID);break;case"ReflectionColor":i.envMap=a.getTexture(e,t.ID),void 0!==i.envMap&&(i.envMap.mapping=r["i"],i.envMap.encoding=r["X"]);break;case"SpecularColor":i.specularMap=a.getTexture(e,t.ID),void 0!==i.specularMap&&(i.specularMap.encoding=r["X"]);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=a.getTexture(e,t.ID),i.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",n);break}})),i}getTexture(t,e){return"LayeredTexture"in ke.Objects&&e in ke.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),e=ze.get(e).children[0].ID),t.get(e)}parseDeformers(){const t={},e={};if("Deformer"in ke.Objects){const n=ke.Objects.Deformer;for(const i in n){const r=n[i],a=ze.get(parseInt(i));if("Skin"===r.attrType){const e=this.parseSkeleton(a,n);e.ID=i,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),e.geometryID=a.parents[0].ID,t[i]=e}else if("BlendShape"===r.attrType){const t={id:i};t.rawTargets=this.parseMorphTargets(a,n),t.id=i,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),e[i]=t}}}return{skeletons:t,morphTargets:e}}parseSkeleton(t,e){const n=[];return t.children.forEach((function(t){const i=e[t.ID];if("Cluster"!==i.attrType)return;const a={ID:t.ID,indices:[],weights:[],transformLink:(new r["v"]).fromArray(i.TransformLink.a)};"Indexes"in i&&(a.indices=i.Indexes.a,a.weights=i.Weights.a),n.push(a)})),{rawBones:n,bones:[]}}parseMorphTargets(t,e){const n=[];for(let i=0;i<t.children.length;i++){const r=t.children[i],a=e[r.ID],s={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if("BlendShapeChannel"!==a.attrType)return;s.geoID=ze.get(parseInt(r.ID)).children.filter((function(t){return void 0===t.relationship}))[0].ID,n.push(s)}return n}parseScene(t,e,n){Fe=new r["n"];const i=this.parseModels(t.skeletons,e,n),a=ke.Objects.Model,s=this;i.forEach((function(t){const e=a[t.ID];s.setLookAtProperties(t,e);const n=ze.get(t.ID).parents;n.forEach((function(e){const n=i.get(e.ID);void 0!==n&&n.add(t)})),null===t.parent&&Fe.add(t)})),this.bindSkeleton(t.skeletons,e,i),this.createAmbientLight(),Fe.traverse((function(t){if(t.userData.transformData){t.parent&&(t.userData.transformData.parentMatrix=t.parent.matrix,t.userData.transformData.parentMatrixWorld=t.parent.matrixWorld);const e=nn(t.userData.transformData);t.applyMatrix4(e),t.updateWorldMatrix()}}));const o=(new Ge).parse();1===Fe.children.length&&Fe.children[0].isGroup&&(Fe.children[0].animations=o,Fe=Fe.children[0]),Fe.animations=o}parseModels(t,e,n){const i=new Map,a=ke.Objects.Model;for(const s in a){const o=parseInt(s),l=a[s],c=ze.get(o);let u=this.buildSkeleton(c,t,o,l.attrName);if(!u){switch(l.attrType){case"Camera":u=this.createCamera(c);break;case"Light":u=this.createLight(c);break;case"Mesh":u=this.createMesh(c,e,n);break;case"NurbsCurve":u=this.createCurve(c,e);break;case"LimbNode":case"Root":u=new r["c"];break;case"Null":default:u=new r["n"];break}u.name=l.attrName?r["F"].sanitizeNodeName(l.attrName):"",u.ID=o}this.getTransformData(u,l),i.set(o,u)}return i}buildSkeleton(t,e,n,i){let a=null;return t.parents.forEach((function(t){for(const s in e){const o=e[s];o.rawBones.forEach((function(e,s){if(e.ID===t.ID){const t=a;a=new r["c"],a.matrixWorld.copy(e.transformLink),a.name=i?r["F"].sanitizeNodeName(i):"",a.ID=n,o.bones[s]=a,null!==t&&a.add(t)}}))}})),a}createCamera(t){let e,n;if(t.children.forEach((function(t){const e=ke.Objects.NodeAttribute[t.ID];void 0!==e&&(n=e)})),void 0===n)e=new r["A"];else{let t=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(t=1);let i=1;void 0!==n.NearPlane&&(i=n.NearPlane.value/1e3);let a=1e3;void 0!==n.FarPlane&&(a=n.FarPlane.value/1e3);let s=window.innerWidth,o=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(s=n.AspectWidth.value,o=n.AspectHeight.value);const l=s/o;let c=45;void 0!==n.FieldOfView&&(c=n.FieldOfView.value);const u=n.FocalLength?n.FocalLength.value:null;switch(t){case 0:e=new r["D"](c,l,i,a),null!==u&&e.setFocalLength(u);break;case 1:e=new r["B"](-s/2,s/2,o/2,-o/2,i,a);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+t+"."),e=new r["A"];break}}return e}createLight(t){let e,n;if(t.children.forEach((function(t){const e=ke.Objects.NodeAttribute[t.ID];void 0!==e&&(n=e)})),void 0===n)e=new r["A"];else{let t;t=void 0===n.LightType?0:n.LightType.value;let i=16777215;void 0!==n.Color&&(i=(new r["f"]).fromArray(n.Color.value));let a=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(a=0);let s=0;void 0!==n.FarAttenuationEnd&&(s=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);const o=1;switch(t){case 0:e=new r["E"](i,a,s,o);break;case 1:e=new r["h"](i,a);break;case 2:let t=Math.PI/3;void 0!==n.InnerAngle&&(t=r["t"].degToRad(n.InnerAngle.value));let l=0;void 0!==n.OuterAngle&&(l=r["t"].degToRad(n.OuterAngle.value),l=Math.max(l,1)),e=new r["N"](i,a,s,t,l,o);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),e=new r["E"](i,a);break}void 0!==n.CastShadows&&1===n.CastShadows.value&&(e.castShadow=!0)}return e}createMesh(t,e,n){let i,a=null,s=null;const o=[];return t.children.forEach((function(t){e.has(t.ID)&&(a=e.get(t.ID)),n.has(t.ID)&&o.push(n.get(t.ID))})),o.length>1?s=o:o.length>0?s=o[0]:(s=new r["y"]({color:13421772}),o.push(s)),"color"in a.attributes&&o.forEach((function(t){t.vertexColors=!0})),a.FBX_Deformer?(i=new r["L"](a,s),i.normalizeSkinWeights()):i=new r["w"](a,s),i}createCurve(t,e){const n=t.children.reduce((function(t,n){return e.has(n.ID)&&(t=e.get(n.ID)),t}),null),i=new r["p"]({color:3342591,linewidth:1});return new r["o"](n,i)}getTransformData(t,e){const n={};"InheritType"in e&&(n.inheritType=parseInt(e.InheritType.value)),n.eulerOrder="RotationOrder"in e?rn(e.RotationOrder.value):"ZYX","Lcl_Translation"in e&&(n.translation=e.Lcl_Translation.value),"PreRotation"in e&&(n.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(n.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(n.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(n.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(n.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(n.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(n.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(n.rotationPivot=e.RotationPivot.value),t.userData.transformData=n}setLookAtProperties(t,e){if("LookAtProperty"in e){const e=ze.get(t.ID).children;e.forEach((function(e){if("LookAtProperty"===e.relationship){const n=ke.Objects.Model[e.ID];if("Lcl_Translation"in n){const e=n.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(e),Fe.add(t.target)):t.lookAt((new r["T"]).fromArray(e))}}}))}}bindSkeleton(t,e,n){const i=this.parsePoseNodes();for(const a in t){const s=t[a],o=ze.get(parseInt(s.ID)).parents;o.forEach((function(t){if(e.has(t.ID)){const e=t.ID,a=ze.get(e);a.parents.forEach((function(t){if(n.has(t.ID)){const e=n.get(t.ID);e.bind(new r["K"](s.bones),i[t.ID])}}))}}))}}parsePoseNodes(){const t={};if("Pose"in ke.Objects){const e=ke.Objects.Pose;for(const n in e)if("BindPose"===e[n].attrType&&e[n].NbPoseNodes>0){const i=e[n].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new r["v"]).fromArray(e.Matrix.a)})):t[i.Node]=(new r["v"]).fromArray(i.Matrix.a)}}return t}createAmbientLight(){if("GlobalSettings"in ke&&"AmbientColor"in ke.GlobalSettings){const t=ke.GlobalSettings.AmbientColor.value,e=t[0],n=t[1],i=t[2];if(0!==e||0!==n||0!==i){const t=new r["f"](e,n,i);Fe.add(new r["a"](t,1))}}}}class He{parse(t){const e=new Map;if("Geometry"in ke.Objects){const n=ke.Objects.Geometry;for(const i in n){const r=ze.get(parseInt(i)),a=this.parseGeometry(r,n[i],t);e.set(parseInt(i),a)}}return e}parseGeometry(t,e,n){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,n);case"NurbsCurve":return this.parseNurbsGeometry(e)}}parseMeshGeometry(t,e,n){const i=n.skeletons,r=[],a=t.parents.map((function(t){return ke.Objects.Model[t.ID]}));if(0===a.length)return;const s=t.children.reduce((function(t,e){return void 0!==i[e.ID]&&(t=i[e.ID]),t}),null);t.children.forEach((function(t){void 0!==n.morphTargets[t.ID]&&r.push(n.morphTargets[t.ID])}));const o=a[0],l={};"RotationOrder"in o&&(l.eulerOrder=rn(o.RotationOrder.value)),"InheritType"in o&&(l.inheritType=parseInt(o.InheritType.value)),"GeometricTranslation"in o&&(l.translation=o.GeometricTranslation.value),"GeometricRotation"in o&&(l.rotation=o.GeometricRotation.value),"GeometricScaling"in o&&(l.scale=o.GeometricScaling.value);const c=nn(l);return this.genGeometry(e,s,r,c)}genGeometry(t,e,n,i){const a=new r["d"];t.attrName&&(a.name=t.attrName);const s=this.parseGeoNode(t,e),o=this.genBuffers(s),l=new r["m"](o.vertex,3);if(l.applyMatrix4(i),a.setAttribute("position",l),o.colors.length>0&&a.setAttribute("color",new r["m"](o.colors,3)),e&&(a.setAttribute("skinIndex",new r["R"](o.weightsIndices,4)),a.setAttribute("skinWeight",new r["m"](o.vertexWeights,4)),a.FBX_Deformer=e),o.normal.length>0){const t=(new r["u"]).getNormalMatrix(i),e=new r["m"](o.normal,3);e.applyNormalMatrix(t),a.setAttribute("normal",e)}if(o.uvs.forEach((function(t,e){let n="uv"+(e+1).toString();0===e&&(n="uv"),a.setAttribute(n,new r["m"](o.uvs[e],2))})),s.material&&"AllSame"!==s.material.mappingType){let t=o.materialIndex[0],e=0;if(o.materialIndex.forEach((function(n,i){n!==t&&(a.addGroup(e,i-e,t),t=n,e=i)})),a.groups.length>0){const e=a.groups[a.groups.length-1],n=e.start+e.count;n!==o.materialIndex.length&&a.addGroup(n,o.materialIndex.length-n,t)}0===a.groups.length&&a.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(a,t,n,i),a}parseGeoNode(t,e){const n={};if(n.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],n.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(n.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(n.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(n.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){n.uv=[];let e=0;while(t.LayerElementUV[e])t.LayerElementUV[e].UV&&n.uv.push(this.parseUVs(t.LayerElementUV[e])),e++}return n.weightTable={},null!==e&&(n.skeleton=e,e.rawBones.forEach((function(t,e){t.indices.forEach((function(i,r){void 0===n.weightTable[i]&&(n.weightTable[i]=[]),n.weightTable[i].push({id:e,weight:t.weights[r]})}))}))),n}genBuffers(t){const e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,i=0,r=!1,a=[],s=[],o=[],l=[],c=[],u=[];const h=this;return t.vertexIndices.forEach((function(d,p){let f,m=!1;d<0&&(d^=-1,m=!0);let g=[],v=[];if(a.push(3*d,3*d+1,3*d+2),t.color){const e=Qe(p,n,d,t.color);o.push(e[0],e[1],e[2])}if(t.skeleton){if(void 0!==t.weightTable[d]&&t.weightTable[d].forEach((function(t){v.push(t.weight),g.push(t.id)})),v.length>4){r||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),r=!0);const t=[0,0,0,0],e=[0,0,0,0];v.forEach((function(n,i){let r=n,a=g[i];e.forEach((function(e,n,i){if(r>e){i[n]=r,r=e;const s=t[n];t[n]=a,a=s}}))})),g=t,v=e}while(v.length<4)v.push(0),g.push(0);for(let t=0;t<4;++t)c.push(v[t]),u.push(g[t])}if(t.normal){const e=Qe(p,n,d,t.normal);s.push(e[0],e[1],e[2])}t.material&&"AllSame"!==t.material.mappingType&&(f=Qe(p,n,d,t.material)[0],f<0&&(console.warn("THREE.FBXLoader: Invalid material index:",f),f=0)),t.uv&&t.uv.forEach((function(t,e){const i=Qe(p,n,d,t);void 0===l[e]&&(l[e]=[]),l[e].push(i[0]),l[e].push(i[1])})),i++,m&&(h.genFace(e,t,a,f,s,o,l,c,u,i),n++,i=0,a=[],s=[],o=[],l=[],c=[],u=[])})),e}genFace(t,e,n,i,r,a,s,o,l,c){for(let u=2;u<c;u++)t.vertex.push(e.vertexPositions[n[0]]),t.vertex.push(e.vertexPositions[n[1]]),t.vertex.push(e.vertexPositions[n[2]]),t.vertex.push(e.vertexPositions[n[3*(u-1)]]),t.vertex.push(e.vertexPositions[n[3*(u-1)+1]]),t.vertex.push(e.vertexPositions[n[3*(u-1)+2]]),t.vertex.push(e.vertexPositions[n[3*u]]),t.vertex.push(e.vertexPositions[n[3*u+1]]),t.vertex.push(e.vertexPositions[n[3*u+2]]),e.skeleton&&(t.vertexWeights.push(o[0]),t.vertexWeights.push(o[1]),t.vertexWeights.push(o[2]),t.vertexWeights.push(o[3]),t.vertexWeights.push(o[4*(u-1)]),t.vertexWeights.push(o[4*(u-1)+1]),t.vertexWeights.push(o[4*(u-1)+2]),t.vertexWeights.push(o[4*(u-1)+3]),t.vertexWeights.push(o[4*u]),t.vertexWeights.push(o[4*u+1]),t.vertexWeights.push(o[4*u+2]),t.vertexWeights.push(o[4*u+3]),t.weightsIndices.push(l[0]),t.weightsIndices.push(l[1]),t.weightsIndices.push(l[2]),t.weightsIndices.push(l[3]),t.weightsIndices.push(l[4*(u-1)]),t.weightsIndices.push(l[4*(u-1)+1]),t.weightsIndices.push(l[4*(u-1)+2]),t.weightsIndices.push(l[4*(u-1)+3]),t.weightsIndices.push(l[4*u]),t.weightsIndices.push(l[4*u+1]),t.weightsIndices.push(l[4*u+2]),t.weightsIndices.push(l[4*u+3])),e.color&&(t.colors.push(a[0]),t.colors.push(a[1]),t.colors.push(a[2]),t.colors.push(a[3*(u-1)]),t.colors.push(a[3*(u-1)+1]),t.colors.push(a[3*(u-1)+2]),t.colors.push(a[3*u]),t.colors.push(a[3*u+1]),t.colors.push(a[3*u+2])),e.material&&"AllSame"!==e.material.mappingType&&(t.materialIndex.push(i),t.materialIndex.push(i),t.materialIndex.push(i)),e.normal&&(t.normal.push(r[0]),t.normal.push(r[1]),t.normal.push(r[2]),t.normal.push(r[3*(u-1)]),t.normal.push(r[3*(u-1)+1]),t.normal.push(r[3*(u-1)+2]),t.normal.push(r[3*u]),t.normal.push(r[3*u+1]),t.normal.push(r[3*u+2])),e.uv&&e.uv.forEach((function(e,n){void 0===t.uvs[n]&&(t.uvs[n]=[]),t.uvs[n].push(s[n][0]),t.uvs[n].push(s[n][1]),t.uvs[n].push(s[n][2*(u-1)]),t.uvs[n].push(s[n][2*(u-1)+1]),t.uvs[n].push(s[n][2*u]),t.uvs[n].push(s[n][2*u+1])}))}addMorphTargets(t,e,n,i){if(0===n.length)return;t.morphTargetsRelative=!0,t.morphAttributes.position=[];const r=this;n.forEach((function(n){n.rawTargets.forEach((function(n){const a=ke.Objects.Geometry[n.geoID];void 0!==a&&r.genMorphGeometry(t,e,a,i,n.name)}))}))}genMorphGeometry(t,e,n,i,a){const s=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],o=void 0!==n.Vertices?n.Vertices.a:[],l=void 0!==n.Indexes?n.Indexes.a:[],c=3*t.attributes.position.count,u=new Float32Array(c);for(let r=0;r<l.length;r++){const t=3*l[r];u[t]=o[3*r],u[t+1]=o[3*r+1],u[t+2]=o[3*r+2]}const h={vertexIndices:s,vertexPositions:u},d=this.genBuffers(h),p=new r["m"](d.vertex,3);p.name=a||n.attrName,p.applyMatrix4(i),t.morphAttributes.position.push(p)}parseNormals(t){const e=t.MappingInformationType,n=t.ReferenceInformationType,i=t.Normals.a;let r=[];return"IndexToDirect"===n&&("NormalIndex"in t?r=t.NormalIndex.a:"NormalsIndex"in t&&(r=t.NormalsIndex.a)),{dataSize:3,buffer:i,indices:r,mappingType:e,referenceType:n}}parseUVs(t){const e=t.MappingInformationType,n=t.ReferenceInformationType,i=t.UV.a;let r=[];return"IndexToDirect"===n&&(r=t.UVIndex.a),{dataSize:2,buffer:i,indices:r,mappingType:e,referenceType:n}}parseVertexColors(t){const e=t.MappingInformationType,n=t.ReferenceInformationType,i=t.Colors.a;let r=[];return"IndexToDirect"===n&&(r=t.ColorIndex.a),{dataSize:4,buffer:i,indices:r,mappingType:e,referenceType:n}}parseMaterialIndices(t){const e=t.MappingInformationType,n=t.ReferenceInformationType;if("NoMappingInformation"===e)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const i=t.Materials.a,r=[];for(let a=0;a<i.length;++a)r.push(a);return{dataSize:1,buffer:i,indices:r,mappingType:e,referenceType:n}}parseNurbsGeometry(t){if(void 0===Ue)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new r["d"];const e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new r["d"];const n=e-1,i=t.KnotVector.a,a=[],s=t.Points.a;for(let h=0,d=s.length;h<d;h+=4)a.push((new r["U"]).fromArray(s,h));let o,l;if("Closed"===t.Form)a.push(a[0]);else if("Periodic"===t.Form){o=n,l=i.length-1-o;for(let t=0;t<n;++t)a.push(a[t])}const c=new Ue(n,i,a,o,l),u=c.getPoints(12*a.length);return(new r["d"]).setFromPoints(u)}}class Ge{parse(){const t=[],e=this.parseClips();if(void 0!==e)for(const n in e){const i=e[n],r=this.addClip(i);t.push(r)}return t}parseClips(){if(void 0===ke.Objects.AnimationCurve)return;const t=this.parseAnimationCurveNodes();this.parseAnimationCurves(t);const e=this.parseAnimationLayers(t),n=this.parseAnimStacks(e);return n}parseAnimationCurveNodes(){const t=ke.Objects.AnimationCurveNode,e=new Map;for(const n in t){const i=t[n];if(null!==i.attrName.match(/S|R|T|DeformPercent/)){const t={id:i.id,attr:i.attrName,curves:{}};e.set(t.id,t)}}return e}parseAnimationCurves(t){const e=ke.Objects.AnimationCurve;for(const n in e){const i={id:e[n].id,times:e[n].KeyTime.a.map(Ke),values:e[n].KeyValueFloat.a},r=ze.get(i.id);if(void 0!==r){const e=r.parents[0].ID,n=r.parents[0].relationship;n.match(/X/)?t.get(e).curves["x"]=i:n.match(/Y/)?t.get(e).curves["y"]=i:n.match(/Z/)?t.get(e).curves["z"]=i:n.match(/d|DeformPercent/)&&t.has(e)&&(t.get(e).curves["morph"]=i)}}}parseAnimationLayers(t){const e=ke.Objects.AnimationLayer,n=new Map;for(const i in e){const e=[],a=ze.get(parseInt(i));if(void 0!==a){const s=a.children;s.forEach((function(n,i){if(t.has(n.ID)){const a=t.get(n.ID);if(void 0!==a.curves.x||void 0!==a.curves.y||void 0!==a.curves.z){if(void 0===e[i]){const t=ze.get(n.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID;if(void 0!==t){const a=ke.Objects.Model[t.toString()];if(void 0===a)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",n);const s={modelName:a.attrName?r["F"].sanitizeNodeName(a.attrName):"",ID:a.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Fe.traverse((function(t){t.ID===a.id&&(s.transform=t.matrix,t.userData.transformData&&(s.eulerOrder=t.userData.transformData.eulerOrder))})),s.transform||(s.transform=new r["v"]),"PreRotation"in a&&(s.preRotation=a.PreRotation.value),"PostRotation"in a&&(s.postRotation=a.PostRotation.value),e[i]=s}}e[i]&&(e[i][a.attr]=a)}else if(void 0!==a.curves.morph){if(void 0===e[i]){const t=ze.get(n.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID,a=ze.get(t).parents[0].ID,s=ze.get(a).parents[0].ID,o=ze.get(s).parents[0].ID,l=ke.Objects.Model[o],c={modelName:l.attrName?r["F"].sanitizeNodeName(l.attrName):"",morphName:ke.Objects.Deformer[t].attrName};e[i]=c}e[i][a.attr]=a}}})),n.set(parseInt(i),e)}}return n}parseAnimStacks(t){const e=ke.Objects.AnimationStack,n={};for(const i in e){const r=ze.get(parseInt(i)).children;r.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const a=t.get(r[0].ID);n[i]={name:e[i].attrName,layer:a}}return n}addClip(t){let e=[];const n=this;return t.layer.forEach((function(t){e=e.concat(n.generateTracks(t))})),new r["b"](t.name,-1,e)}generateTracks(t){const e=[];let n=new r["T"],i=new r["G"],a=new r["T"];if(t.transform&&t.transform.decompose(n,i,a),n=n.toArray(),i=(new r["j"]).setFromQuaternion(i,t.eulerOrder).toArray(),a=a.toArray(),void 0!==t.T&&Object.keys(t.T.curves).length>0){const i=this.generateVectorTrack(t.modelName,t.T.curves,n,"position");void 0!==i&&e.push(i)}if(void 0!==t.R&&Object.keys(t.R.curves).length>0){const n=this.generateRotationTrack(t.modelName,t.R.curves,i,t.preRotation,t.postRotation,t.eulerOrder);void 0!==n&&e.push(n)}if(void 0!==t.S&&Object.keys(t.S.curves).length>0){const n=this.generateVectorTrack(t.modelName,t.S.curves,a,"scale");void 0!==n&&e.push(n)}if(void 0!==t.DeformPercent){const n=this.generateMorphTrack(t);void 0!==n&&e.push(n)}return e}generateVectorTrack(t,e,n,i){const a=this.getTimesForAllAxes(e),s=this.getKeyframeTrackValues(a,e,n);return new r["V"](t+"."+i,a,s)}generateRotationTrack(t,e,n,i,a,s){void 0!==e.x&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(r["t"].degToRad)),void 0!==e.y&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(r["t"].degToRad)),void 0!==e.z&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(r["t"].degToRad));const o=this.getTimesForAllAxes(e),l=this.getKeyframeTrackValues(o,e,n);void 0!==i&&(i=i.map(r["t"].degToRad),i.push(s),i=(new r["j"]).fromArray(i),i=(new r["G"]).setFromEuler(i)),void 0!==a&&(a=a.map(r["t"].degToRad),a.push(s),a=(new r["j"]).fromArray(a),a=(new r["G"]).setFromEuler(a).invert());const c=new r["G"],u=new r["j"],h=[];for(let r=0;r<l.length;r+=3)u.set(l[r],l[r+1],l[r+2],s),c.setFromEuler(u),void 0!==i&&c.premultiply(i),void 0!==a&&c.multiply(a),c.toArray(h,r/3*4);return new r["H"](t+".quaternion",o,h)}generateMorphTrack(t){const e=t.DeformPercent.curves.morph,n=e.values.map((function(t){return t/100})),i=Fe.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new r["z"](t.modelName+".morphTargetInfluences["+i+"]",e.times,n)}getTimesForAllAxes(t){let e=[];if(void 0!==t.x&&(e=e.concat(t.x.times)),void 0!==t.y&&(e=e.concat(t.y.times)),void 0!==t.z&&(e=e.concat(t.z.times)),e=e.sort((function(t,e){return t-e})),e.length>1){let t=1,n=e[0];for(let i=1;i<e.length;i++){const r=e[i];r!==n&&(e[t]=r,n=r,t++)}e=e.slice(0,t)}return e}getKeyframeTrackValues(t,e,n){const i=n,r=[];let a=-1,s=-1,o=-1;return t.forEach((function(t){if(e.x&&(a=e.x.times.indexOf(t)),e.y&&(s=e.y.times.indexOf(t)),e.z&&(o=e.z.times.indexOf(t)),-1!==a){const t=e.x.values[a];r.push(t),i[0]=t}else r.push(i[0]);if(-1!==s){const t=e.y.values[s];r.push(t),i[1]=t}else r.push(i[1]);if(-1!==o){const t=e.z.values[o];r.push(t),i[2]=t}else r.push(i[2])})),r}interpolateRotations(t){for(let e=1;e<t.values.length;e++){const n=t.values[e-1],i=t.values[e]-n,r=Math.abs(i);if(r>=180){const a=r/180,s=i/a;let o=n+s;const l=t.times[e-1],c=t.times[e]-l,u=c/a;let h=l+u;const d=[],p=[];while(h<t.times[e])d.push(h),h+=u,p.push(o),o+=s;t.times=cn(t.times,e,d),t.values=cn(t.values,e,p)}}}}class We{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(t){this.nodeStack.push(t),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(t,e){this.currentProp=t,this.currentPropName=e}parse(t){this.currentIndent=0,this.allNodes=new qe,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const e=this,n=t.split(/[\r\n]+/);return n.forEach((function(t,i){const r=t.match(/^[\s\t]*;/),a=t.match(/^[\s\t]*$/);if(r||a)return;const s=t.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){",""),o=t.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=t.match("^\\t{"+(e.currentIndent-1)+"}}");s?e.parseNodeBegin(t,s):o?e.parseNodeProperty(t,o,n[++i]):l?e.popStack():t.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(t)})),this.allNodes}parseNodeBegin(t,e){const n=e[1].trim().replace(/^"/,"").replace(/"$/,""),i=e[2].split(",").map((function(t){return t.trim().replace(/^"/,"").replace(/"$/,"")})),r={name:n},a=this.parseNodeAttr(i),s=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(n,r):n in s?("PoseNode"===n?s.PoseNode.push(r):void 0!==s[n].id&&(s[n]={},s[n][s[n].id]=s[n]),""!==a.id&&(s[n][a.id]=r)):"number"===typeof a.id?(s[n]={},s[n][a.id]=r):"Properties70"!==n&&(s[n]="PoseNode"===n?[r]:r),"number"===typeof a.id&&(r.id=a.id),""!==a.name&&(r.attrName=a.name),""!==a.type&&(r.attrType=a.type),this.pushStack(r)}parseNodeAttr(t){let e=t[0];""!==t[0]&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));let n="",i="";return t.length>1&&(n=t[1].replace(/^(\w+)::/,""),i=t[2]),{id:e,name:n,type:i}}parseNodeProperty(t,e,n){let i=e[1].replace(/^"/,"").replace(/"$/,"").trim(),r=e[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===i&&","===r&&(r=n.replace(/"/g,"").replace(/,$/,"").trim());const a=this.getCurrentNode(),s=a.name;if("Properties70"!==s){if("C"===i){const t=r.split(",").slice(1),e=parseInt(t[0]),n=parseInt(t[1]);let s=r.split(",").slice(3);s=s.map((function(t){return t.trim().replace(/^"/,"")})),i="connections",r=[e,n],on(r,s),void 0===a[i]&&(a[i]=[])}"Node"===i&&(a.id=r),i in a&&Array.isArray(a[i])?a[i].push(r):"a"!==i?a[i]=r:a.a=r,this.setCurrentProp(a,i),"a"===i&&","!==r.slice(-1)&&(a.a=an(r))}else this.parseNodeSpecialProperty(t,i,r)}parseNodePropertyContinued(t){const e=this.getCurrentNode();e.a+=t,","!==t.slice(-1)&&(e.a=an(e.a))}parseNodeSpecialProperty(t,e,n){const i=n.split('",').map((function(t){return t.trim().replace(/^\"/,"").replace(/\s/,"_")})),r=i[0],a=i[1],s=i[2],o=i[3];let l=i[4];switch(a){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=an(l);break}this.getPrevNode()[r]={type:a,type2:s,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),r)}}class je{parse(t){const e=new Xe(t);e.skip(23);const n=e.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const i=new qe;while(!this.endOfContent(e)){const t=this.parseNode(e,n);null!==t&&i.add(t.name,t)}return i}endOfContent(t){return t.size()%16===0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()}parseNode(t,e){const n={},i=e>=7500?t.getUint64():t.getUint32(),r=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();const a=t.getUint8(),s=t.getString(a);if(0===i)return null;const o=[];for(let h=0;h<r;h++)o.push(this.parseProperty(t));const l=o.length>0?o[0]:"",c=o.length>1?o[1]:"",u=o.length>2?o[2]:"";n.singleProperty=1===r&&t.getOffset()===i;while(i>t.getOffset()){const i=this.parseNode(t,e);null!==i&&this.parseSubNode(s,n,i)}return n.propertyList=o,"number"===typeof l&&(n.id=l),""!==c&&(n.attrName=c),""!==u&&(n.attrType=u),""!==s&&(n.name=s),n}parseSubNode(t,e,n){if(!0===n.singleProperty){const t=n.propertyList[0];Array.isArray(t)?(e[n.name]=n,n.a=t):e[n.name]=t}else if("Connections"===t&&"C"===n.name){const t=[];n.propertyList.forEach((function(e,n){0!==n&&t.push(e)})),void 0===e.connections&&(e.connections=[]),e.connections.push(t)}else if("Properties70"===n.name){const t=Object.keys(n);t.forEach((function(t){e[t]=n[t]}))}else if("Properties70"===t&&"P"===n.name){let t=n.propertyList[0],i=n.propertyList[1];const r=n.propertyList[2],a=n.propertyList[3];let s;0===t.indexOf("Lcl ")&&(t=t.replace("Lcl ","Lcl_")),0===i.indexOf("Lcl ")&&(i=i.replace("Lcl ","Lcl_")),s="Color"===i||"ColorRGB"===i||"Vector"===i||"Vector3D"===i||0===i.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],e[t]={type:i,type2:r,flag:a,value:s}}else void 0===e[n.name]?"number"===typeof n.id?(e[n.name]={},e[n.name][n.id]=n):e[n.name]=n:"PoseNode"===n.name?(Array.isArray(e[n.name])||(e[n.name]=[e[n.name]]),e[n.name].push(n)):void 0===e[n.name][n.id]&&(e[n.name][n.id]=n)}parseProperty(t){const e=t.getString(1);let n;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return n=t.getUint32(),t.getArrayBuffer(n);case"S":return n=t.getUint32(),t.getString(n);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=t.getUint32(),a=t.getUint32(),s=t.getUint32();if(0===a)switch(e){case"b":case"c":return t.getBooleanArray(r);case"d":return t.getFloat64Array(r);case"f":return t.getFloat32Array(r);case"i":return t.getInt32Array(r);case"l":return t.getInt64Array(r)}"undefined"===typeof i&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const o=Yt(new Uint8Array(t.getArrayBuffer(s))),l=new Xe(o.buffer);switch(e){case"b":case"c":return l.getBooleanArray(r);case"d":return l.getFloat64Array(r);case"f":return l.getFloat32Array(r);case"i":return l.getInt32Array(r);case"l":return l.getInt64Array(r)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}}class Xe{constructor(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===e||e}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(t){this.offset+=t}getBoolean(){return 1===(1&this.getUint8())}getBooleanArray(t){const e=[];for(let n=0;n<t;n++)e.push(this.getBoolean());return e}getUint8(){const t=this.dv.getUint8(this.offset);return this.offset+=1,t}getInt16(){const t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}getInt32(){const t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}getInt32Array(t){const e=[];for(let n=0;n<t;n++)e.push(this.getInt32());return e}getUint32(){const t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}getInt64(){let t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),2147483648&e?(e=4294967295&~e,t=4294967295&~t,4294967295===t&&(e=e+1&4294967295),t=t+1&4294967295,-(4294967296*e+t)):4294967296*e+t}getInt64Array(t){const e=[];for(let n=0;n<t;n++)e.push(this.getInt64());return e}getUint64(){let t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),4294967296*e+t}getFloat32(){const t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}getFloat32Array(t){const e=[];for(let n=0;n<t;n++)e.push(this.getFloat32());return e}getFloat64(){const t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}getFloat64Array(t){const e=[];for(let n=0;n<t;n++)e.push(this.getFloat64());return e}getArrayBuffer(t){const e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}getString(t){let e=[];for(let i=0;i<t;i++)e[i]=this.getUint8();const n=e.indexOf(0);return n>=0&&(e=e.slice(0,n)),r["r"].decodeText(new Uint8Array(e))}}class qe{add(t,e){this[t]=e}}function $e(t){const e="Kaydara FBX Binary \0";return t.byteLength>=e.length&&e===sn(t,0,e.length)}function Ye(t){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function i(e){const i=t[e-1];return t=t.slice(n+e),n++,i}for(let r=0;r<e.length;++r){const t=i(1);if(t===e[r])return!1}return!0}function Ze(t){const e=/FBXVersion: (\d+)/,n=t.match(e);if(n){const t=parseInt(n[1]);return t}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Ke(t){return t/46186158e3}const Je=[];function Qe(t,e,n,i){let r;switch(i.mappingType){case"ByPolygonVertex":r=t;break;case"ByPolygon":r=e;break;case"ByVertice":r=n;break;case"AllSame":r=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}"IndexToDirect"===i.referenceType&&(r=i.indices[r]);const a=r*i.dataSize,s=a+i.dataSize;return ln(Je,i.buffer,a,s)}const tn=new r["j"],en=new r["T"];function nn(t){const e=new r["v"],n=new r["v"],i=new r["v"],a=new r["v"],s=new r["v"],o=new r["v"],l=new r["v"],c=new r["v"],u=new r["v"],h=new r["v"],d=new r["v"],p=new r["v"],f=t.inheritType?t.inheritType:0;if(t.translation&&e.setPosition(en.fromArray(t.translation)),t.preRotation){const e=t.preRotation.map(r["t"].degToRad);e.push(t.eulerOrder||r["j"].DefaultOrder),n.makeRotationFromEuler(tn.fromArray(e))}if(t.rotation){const e=t.rotation.map(r["t"].degToRad);e.push(t.eulerOrder||r["j"].DefaultOrder),i.makeRotationFromEuler(tn.fromArray(e))}if(t.postRotation){const e=t.postRotation.map(r["t"].degToRad);e.push(t.eulerOrder||r["j"].DefaultOrder),a.makeRotationFromEuler(tn.fromArray(e)),a.invert()}t.scale&&s.scale(en.fromArray(t.scale)),t.scalingOffset&&l.setPosition(en.fromArray(t.scalingOffset)),t.scalingPivot&&o.setPosition(en.fromArray(t.scalingPivot)),t.rotationOffset&&c.setPosition(en.fromArray(t.rotationOffset)),t.rotationPivot&&u.setPosition(en.fromArray(t.rotationPivot)),t.parentMatrixWorld&&(d.copy(t.parentMatrix),h.copy(t.parentMatrixWorld));const m=n.clone().multiply(i).multiply(a),g=new r["v"];g.extractRotation(h);const v=new r["v"];v.copyPosition(h);const _=v.clone().invert().multiply(h),x=g.clone().invert().multiply(_),y=s,b=new r["v"];if(0===f)b.copy(g).multiply(m).multiply(x).multiply(y);else if(1===f)b.copy(g).multiply(x).multiply(m).multiply(y);else{const t=(new r["v"]).scale((new r["T"]).setFromMatrixScale(d)),e=t.clone().invert(),n=x.clone().multiply(e);b.copy(g).multiply(m).multiply(n).multiply(y)}const M=u.clone().invert(),w=o.clone().invert();let S=e.clone().multiply(c).multiply(u).multiply(n).multiply(i).multiply(a).multiply(M).multiply(l).multiply(o).multiply(s).multiply(w);const T=(new r["v"]).copyPosition(S),E=h.clone().multiply(T);return p.copyPosition(E),S=p.clone().multiply(b),S.premultiply(h.invert()),S}function rn(t){t=t||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===t?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[t]}function an(t){const e=t.split(",").map((function(t){return parseFloat(t)}));return e}function sn(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=t.byteLength),r["r"].decodeText(new Uint8Array(t,e,n))}function on(t,e){for(let n=0,i=t.length,r=e.length;n<r;n++,i++)t[i]=e[n]}function ln(t,e,n,i){for(let r=n,a=0;r<i;r++,a++)t[a]=e[r];return t}function cn(t,e,n){return t.slice(0,e).concat(n).concat(t.slice(e))}},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}t.exports=n}}]);
  20. //# sourceMappingURL=chunk-vendors.f4c95e77.js.map