diff --git a/.gitignore b/.gitignore
index 1522ee7..f5e11dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,7 @@ url_exct_frontend/node_modules
./frontend/url_exct_frontend/coverage
# production
-./frontend/url_exct_frontend/build
+#./frontend/url_exct_frontend/build
# misc
./frontend/url_exct_frontend/.DS_Store
diff --git a/url_exct_frontend/build/asset-manifest.json b/url_exct_frontend/build/asset-manifest.json
new file mode 100644
index 0000000..117190b
--- /dev/null
+++ b/url_exct_frontend/build/asset-manifest.json
@@ -0,0 +1,12 @@
+{
+ "files": {
+ "main.css": "/static/css/main.31d6cfe0.css",
+ "main.js": "/static/js/main.a7e45ac4.js",
+ "index.html": "/index.html",
+ "main.a7e45ac4.js.map": "/static/js/main.a7e45ac4.js.map"
+ },
+ "entrypoints": [
+ "static/css/main.31d6cfe0.css",
+ "static/js/main.a7e45ac4.js"
+ ]
+}
\ No newline at end of file
diff --git a/url_exct_frontend/build/favicon.ico b/url_exct_frontend/build/favicon.ico
new file mode 100644
index 0000000..a11777c
Binary files /dev/null and b/url_exct_frontend/build/favicon.ico differ
diff --git a/url_exct_frontend/build/index.html b/url_exct_frontend/build/index.html
new file mode 100644
index 0000000..ef42ca7
--- /dev/null
+++ b/url_exct_frontend/build/index.html
@@ -0,0 +1 @@
+
React App
\ No newline at end of file
diff --git a/url_exct_frontend/build/logo192.png b/url_exct_frontend/build/logo192.png
new file mode 100644
index 0000000..fc44b0a
Binary files /dev/null and b/url_exct_frontend/build/logo192.png differ
diff --git a/url_exct_frontend/build/logo512.png b/url_exct_frontend/build/logo512.png
new file mode 100644
index 0000000..a4e47a6
Binary files /dev/null and b/url_exct_frontend/build/logo512.png differ
diff --git a/url_exct_frontend/build/manifest.json b/url_exct_frontend/build/manifest.json
new file mode 100644
index 0000000..080d6c7
--- /dev/null
+++ b/url_exct_frontend/build/manifest.json
@@ -0,0 +1,25 @@
+{
+ "short_name": "React App",
+ "name": "Create React App Sample",
+ "icons": [
+ {
+ "src": "favicon.ico",
+ "sizes": "64x64 32x32 24x24 16x16",
+ "type": "image/x-icon"
+ },
+ {
+ "src": "logo192.png",
+ "type": "image/png",
+ "sizes": "192x192"
+ },
+ {
+ "src": "logo512.png",
+ "type": "image/png",
+ "sizes": "512x512"
+ }
+ ],
+ "start_url": ".",
+ "display": "standalone",
+ "theme_color": "#000000",
+ "background_color": "#ffffff"
+}
diff --git a/url_exct_frontend/build/robots.txt b/url_exct_frontend/build/robots.txt
new file mode 100644
index 0000000..e9e57dc
--- /dev/null
+++ b/url_exct_frontend/build/robots.txt
@@ -0,0 +1,3 @@
+# https://www.robotstxt.org/robotstxt.html
+User-agent: *
+Disallow:
diff --git a/url_exct_frontend/build/static/css/main.31d6cfe0.css b/url_exct_frontend/build/static/css/main.31d6cfe0.css
new file mode 100644
index 0000000..e69de29
diff --git a/url_exct_frontend/build/static/js/main.a7e45ac4.js b/url_exct_frontend/build/static/js/main.a7e45ac4.js
new file mode 100644
index 0000000..215eb33
--- /dev/null
+++ b/url_exct_frontend/build/static/js/main.a7e45ac4.js
@@ -0,0 +1,3 @@
+/*! For license information please see main.a7e45ac4.js.LICENSE.txt */
+(()=>{var e={784:(e,t,n)=>{"use strict";var r=n(184),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),g=0;g{e=n.nmd(e);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object AsyncFunction]",s="[object Function]",l="[object GeneratorFunction]",c="[object Null]",u="[object Object]",d="[object Proxy]",h="[object Undefined]",f=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,m={};m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m[o]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m[s]=m["[object Map]"]=m["[object Number]"]=m[u]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1;var g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,v="object"==typeof self&&self&&self.Object===Object&&self,y=g||v||Function("return this")(),b=t&&!t.nodeType&&t,x=b&&e&&!e.nodeType&&e,w=x&&x.exports===b,_=w&&g.process,S=function(){try{var e=x&&x.require&&x.require("util").types;return e||_&&_.binding&&_.binding("util")}catch(t){}}(),M=S&&S.isTypedArray;var E,T,C=Array.prototype,A=Function.prototype,k=Object.prototype,P=y["__core-js_shared__"],R=A.toString,L=k.hasOwnProperty,O=function(){var e=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),z=k.toString,D=R.call(Object),N=RegExp("^"+R.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=w?y.Buffer:void 0,F=y.Symbol,B=y.Uint8Array,j=I?I.allocUnsafe:void 0,U=(E=Object.getPrototypeOf,T=Object,function(e){return E(T(e))}),H=Object.create,G=k.propertyIsEnumerable,V=C.splice,W=F?F.toStringTag:void 0,q=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),X=I?I.isBuffer:void 0,Y=Math.max,$=Date.now,Z=ye(y,"Map"),J=ye(Object,"create"),Q=function(){function e(){}return function(t){if(!Pe(t))return{};if(H)return H(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},ee.prototype.set=function(e,t){var n=this.__data__,r=ae(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(Z||ee),string:new K}},te.prototype.delete=function(e){var t=ve(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ve(this,e).get(e)},te.prototype.has=function(e){return ve(this,e).has(e)},te.prototype.set=function(e,t){var n=ve(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ne.prototype.clear=function(){this.__data__=new ee,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ee){var r=n.__data__;if(!Z||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(r)}return n.set(e,t),this.size=n.size,this};var le,ce=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),a=o.length;a--;){var s=o[le?a:++r];if(!1===t(i[s],s,i))break}return e};function ue(e){return null==e?void 0===e?h:c:W&&W in Object(e)?function(e){var t=L.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(o){}var i=z.call(e);r&&(t?e[W]=n:delete e[W]);return i}(e):function(e){return z.call(e)}(e)}function de(e){return Re(e)&&ue(e)==o}function he(e){return!(!Pe(e)||function(e){return!!O&&O in e}(e))&&(Ae(e)?N:f).test(function(e){if(null!=e){try{return R.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function fe(e){if(!Pe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=xe(e),n=[];for(var r in e)("constructor"!=r||!t&&L.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,i){e!==t&&ce(t,(function(o,a){if(i||(i=new ne),Pe(o))!function(e,t,n,r,i,o,a){var s=we(e,n),l=we(t,n),c=a.get(l);if(c)return void ie(e,n,c);var d=o?o(s,l,n+"",e,t,a):void 0,h=void 0===d;if(h){var f=Ee(l),p=!f&&Ce(l),m=!f&&!p&&Le(l);d=l,f||p||m?Ee(s)?d=s:Re(g=s)&&Te(g)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ge);function Se(e,t){return e===t||e!==e&&t!==t}var Me=de(function(){return arguments}())?de:function(e){return Re(e)&&L.call(e,"callee")&&!G.call(e,"callee")},Ee=Array.isArray;function Te(e){return null!=e&&ke(e.length)&&!Ae(e)}var Ce=X||function(){return!1};function Ae(e){if(!Pe(e))return!1;var t=ue(e);return t==s||t==l||t==a||t==d}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Pe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Re(e){return null!=e&&"object"==typeof e}var Le=M?function(e){return function(t){return e(t)}}(M):function(e){return Re(e)&&ke(e.length)&&!!m[ue(e)]};function Oe(e){return Te(e)?re(e,!0):fe(e)}var ze,De=(ze=function(e,t,n,r){pe(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=ze.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(e,t,n){if(!Pe(n))return!1;var r=typeof t;return!!("number"==r?Te(n)&&be(t,n.length):"string"==r&&t in n)&&Se(n[t],e)}(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=24)}([function(e,t){e.exports=n(60)},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"ServerStyleSheet",(function(){return Be})),n.d(t,"StyleSheetConsumer",(function(){return ie})),n.d(t,"StyleSheetContext",(function(){return re})),n.d(t,"StyleSheetManager",(function(){return ue})),n.d(t,"ThemeConsumer",(function(){return Re})),n.d(t,"ThemeContext",(function(){return Pe})),n.d(t,"ThemeProvider",(function(){return Le})),n.d(t,"__PRIVATE__",(function(){return He})),n.d(t,"createGlobalStyle",(function(){return Ie})),n.d(t,"css",(function(){return be})),n.d(t,"isStyledComponent",(function(){return x})),n.d(t,"keyframes",(function(){return Fe})),n.d(t,"useTheme",(function(){return Ue})),n.d(t,"version",(function(){return _})),n.d(t,"withTheme",(function(){return je}));var r=n(11),i=n(0),o=n.n(i),a=n(21),s=n.n(a),l=n(22),c=n(23),u=n(13),d=n(12),h=n.n(d);function f(){return(f=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var C=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&T(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(w))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(w,"active"),r.setAttribute("data-styled-version","5.2.1");var a=F();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},j=function(){function e(e){var t=this.element=B(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(c+=e+",")})),r+=""+s+l+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),q=/(a)(d)/gi,X=function(e){return String.fromCharCode(e+(e>25?39:97))};function Y(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=X(t%52)+n;return(X(t%52)+n).replace(q,"$1-$2")}var $=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Z=function(e){return $(5381,e)};function J(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(o,"."+a,void 0,r);t.insertRules(r,a,s)}i.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,c=$(this.baseHash,n.hash),u="",d=0;d>>0);if(!t.hasNameForId(r,m)){var g=n(u,"."+m,void 0,r);t.insertRules(r,m,g)}i.push(m)}}return i.join(" ")},e}(),ee=/^\s*\/\/.*$/gm,te=[":","[",".","#"];function ne(e){var t,n,r,i,o=void 0===e?v:e,a=o.options,s=void 0===a?v:a,c=o.plugins,u=void 0===c?g:c,d=new l.a(s),h=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,s,l,c,u,d){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(i[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){h.push(e)})),p=function(e,r,o){return 0===r&&te.includes(o[n.length])||o.match(i)?e:"."+t};function m(e,o,a,s){void 0===s&&(s="&");var l=e.replace(ee,""),c=o&&a?a+" "+o+" { "+l+" }":l;return t=s,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),d(a||!o?"":o,c)}return d.use([].concat(u,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,p))},f,function(e){if(-2===e){var t=h;return h=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||T(15),$(e,t.name)}),5381).toString():"",m}var re=o.a.createContext(),ie=re.Consumer,oe=o.a.createContext(),ae=(oe.Consumer,new W),se=ne();function le(){return Object(i.useContext)(re)||ae}function ce(){return Object(i.useContext)(oe)||se}function ue(e){var t=Object(i.useState)(e.stylisPlugins),n=t[0],r=t[1],a=le(),l=Object(i.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=Object(i.useMemo)((function(){return ne({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(i.useEffect)((function(){s()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),o.a.createElement(re.Provider,{value:l},o.a.createElement(oe.Provider,{value:c},e.children))}var de=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=se);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return T(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=se),this.name+e.hash},e}(),he=/([A-Z])/,fe=/([A-Z])/g,pe=/^ms-/,me=function(e){return"-"+e.toLowerCase()};function ge(e){return he.test(e)?e.replace(fe,me).replace(pe,"-ms-"):e}var ve=function(e){return null==e||!1===e||""===e};function ye(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,_e=/(^-|-$)/g;function Se(e){return e.replace(we,"-").replace(_e,"")}var Me=function(e){return Y(Z(e)>>>0)};function Ee(e){return"string"==typeof e&&!0}var Te=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ce=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ae(e,t,n){var r=e[n];Te(t)&&Te(r)?ke(r,t):e[n]=t}function ke(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(Ee(e)?e:Se(b(e)));return ze(e,f({},i,{attrs:_,componentId:o}),n)},Object.defineProperty(M,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?ke({},e.defaultProps,t):t}}),M.toString=function(){return"."+M.styledComponentId},a&&h()(M,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),M}var De=function(e){return function e(t,n,i){if(void 0===i&&(i=v),!Object(r.isValidElementType)(n))return T(1,String(n));var o=function(){return t(n,i,be.apply(void 0,arguments))};return o.withConfig=function(r){return e(t,n,f({},i,{},r))},o.attrs=function(r){return e(t,n,f({},i,{attrs:Array.prototype.concat(i.attrs,r).filter(Boolean)}))},o}(ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){De[e]=De(e)}));var Ne=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=J(e),W.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var i=r(ye(this.rules,t,n,r).join(""),""),o=this.componentId+e;n.insertRules(o,o,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&W.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function Ie(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"+t+""},this.getStyleTags=function(){return e.sealed?T(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return T(2);var n=((t={})[w]="",t["data-styled-version"]="5.2.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=F();return r&&(n.nonce=r),[o.a.createElement("style",f({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new W({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?T(2):o.a.createElement(ue,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return T(3)},e}(),je=function(e){var t=o.a.forwardRef((function(t,n){var r=Object(i.useContext)(Pe),a=e.defaultProps,s=xe(t,r,a);return o.a.createElement(e,f({},t,{theme:s,ref:n}))}));return h()(t,e),t.displayName="WithTheme("+b(e)+")",t},Ue=function(){return Object(i.useContext)(Pe)},He={StyleSheet:W,masterSheet:ae};t.default=De}.call(this,n(26))},function(e,t,n){var r;"undefined"!=typeof self&&self,e.exports=(r=n(0),function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=s;case"max":return l<=s;default:return l===s}}));return s&&!n||!s&&n}))},t.parse=r;var s=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,l=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,c=/^(?:(min|max)-)?(.+)/,u=/(em|rem|px|cm|mm|in|pt|pc)?$/,d=/(dpi|dpcm|dppx)?$/},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var o=0;o>",x={array:h("array"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:d(r),arrayOf:function(e){return d((function(t,n,r,i,o){if("function"!=typeof e)return new u("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new u("Invalid "+i+" `"+o+"` of type `"+p(a)+"` supplied to `"+r+"`, expected an array.");for(var l=0;l1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),r)},oneOfType:function(e){if(!Array.isArray(e))return i("Invalid argument supplied to oneOfType, expected an instance of array."),r;for(var t=0;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["children","device","onChange"]),a=Object(r.a)(o,n,i);return"function"==typeof t?t(a):a?t:null};var r=n(0)}]))},function(e,t,n){var r;r=function(){var e={};e.TAU=2*Math.PI,e.extend=function(e,t){for(var n in t)e[n]=t[n];return e},e.lerp=function(e,t,n){return(t-e)*n+e},e.modulo=function(e,t){return(e%t+t)%t};var t={2:function(e){return e*e},3:function(e){return e*e*e},4:function(e){return e*e*e*e},5:function(e){return e*e*e*e*e}};return e.easeInOut=function(e,n){if(1==n)return e;var r=(e=Math.max(0,Math.min(1,e)))<.5,i=r?e:1-e,o=(t[n]||t[2])(i/=.5);return o/=2,r?o:1-o},e},e.exports?e.exports=r():this.Zdog=r()},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(3),n(6),n(15),n(16));else{var i=t.Zdog;i.Anchor=r(i,i.Vector,i.CanvasRenderer,i.SvgRenderer)}}(this,(function(e,t,n,r){var i=e.TAU,o={x:1,y:1,z:1};function a(e){this.create(e||{})}return a.prototype.create=function(n){this.children=[],e.extend(this,this.constructor.defaults),this.setOptions(n),this.translate=new t(n.translate),this.rotate=new t(n.rotate),this.scale=new t(o).multiply(this.scale),this.origin=new t,this.renderOrigin=new t,this.addTo&&this.addTo.addChild(this)},a.defaults={},a.optionKeys=Object.keys(a.defaults).concat(["rotate","translate","scale","addTo"]),a.prototype.setOptions=function(e){var t=this.constructor.optionKeys;for(var n in e)-1!=t.indexOf(n)&&(this[n]=e[n])},a.prototype.addChild=function(e){-1==this.children.indexOf(e)&&(e.remove(),e.addTo=this,this.children.push(e))},a.prototype.removeChild=function(e){var t=this.children.indexOf(e);-1!=t&&this.children.splice(t,1)},a.prototype.remove=function(){this.addTo&&this.addTo.removeChild(this)},a.prototype.update=function(){this.reset(),this.children.forEach((function(e){e.update()})),this.transform(this.translate,this.rotate,this.scale)},a.prototype.reset=function(){this.renderOrigin.set(this.origin)},a.prototype.transform=function(e,t,n){this.renderOrigin.transform(e,t,n),this.children.forEach((function(r){r.transform(e,t,n)}))},a.prototype.updateGraph=function(){this.update(),this.updateFlatGraph(),this.flatGraph.forEach((function(e){e.updateSortValue()})),this.flatGraph.sort(a.shapeSorter)},a.shapeSorter=function(e,t){return e.sortValue-t.sortValue},Object.defineProperty(a.prototype,"flatGraph",{get:function(){return this._flatGraph||this.updateFlatGraph(),this._flatGraph},set:function(e){this._flatGraph=e}}),a.prototype.updateFlatGraph=function(){this.flatGraph=this.getFlatGraph()},a.prototype.getFlatGraph=function(){var e=[this];return this.addChildFlatGraph(e)},a.prototype.addChildFlatGraph=function(e){return this.children.forEach((function(t){var n=t.getFlatGraph();Array.prototype.push.apply(e,n)})),e},a.prototype.updateSortValue=function(){this.sortValue=this.renderOrigin.z},a.prototype.render=function(){},a.prototype.renderGraphCanvas=function(e){if(!e)throw new Error("ctx is "+e+". Canvas context required for render. Check .renderGraphCanvas( ctx ).");this.flatGraph.forEach((function(t){t.render(e,n)}))},a.prototype.renderGraphSvg=function(e){if(!e)throw new Error("svg is "+e+". SVG required for render. Check .renderGraphSvg( svg ).");this.flatGraph.forEach((function(t){t.render(e,r)}))},a.prototype.copy=function(t){var n={};return this.constructor.optionKeys.forEach((function(e){n[e]=this[e]}),this),e.extend(n,t),new(0,this.constructor)(n)},a.prototype.copyGraph=function(e){var t=this.copy(e);return this.children.forEach((function(e){e.copyGraph({addTo:t})})),t},a.prototype.normalizeRotate=function(){this.rotate.x=e.modulo(this.rotate.x,i),this.rotate.y=e.modulo(this.rotate.y,i),this.rotate.z=e.modulo(this.rotate.z,i)},a.subclass=function t(n){return function(r){function i(e){this.create(e||{})}return i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.defaults=e.extend({},n.defaults),e.extend(i.defaults,r),i.optionKeys=n.optionKeys.slice(0),Object.keys(i.defaults).forEach((function(e){1!=!i.optionKeys.indexOf(e)&&i.optionKeys.push(e)})),i.subclass=t(i),i}}(a),a}))},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(3),n(6),n(8),n(4));else{var i=t.Zdog;i.Shape=r(i,i.Vector,i.PathCommand,i.Anchor)}}(this,(function(e,t,n,r){var i=r.subclass({stroke:1,fill:!1,color:"#333",closed:!0,visible:!0,path:[{}],front:{z:1},backface:!0});i.prototype.create=function(e){r.prototype.create.call(this,e),this.updatePath(),this.front=new t(e.front||this.front),this.renderFront=new t(this.front),this.renderNormal=new t};var o=["move","line","bezier","arc"];i.prototype.updatePath=function(){this.setPath(),this.updatePathCommands()},i.prototype.setPath=function(){},i.prototype.updatePathCommands=function(){var e;this.pathCommands=this.path.map((function(t,r){var i=Object.keys(t),a=i[0],s=t[a];1==i.length&&-1!=o.indexOf(a)||(a="line",s=t);var l="line"==a||"move"==a,c=Array.isArray(s);l&&!c&&(s=[s]);var u=new n(a=0===r?"move":a,s,e);return e=u.endRenderPoint,u}))},i.prototype.reset=function(){this.renderOrigin.set(this.origin),this.renderFront.set(this.front),this.pathCommands.forEach((function(e){e.reset()}))},i.prototype.transform=function(e,t,n){this.renderOrigin.transform(e,t,n),this.renderFront.transform(e,t,n),this.renderNormal.set(this.renderOrigin).subtract(this.renderFront),this.pathCommands.forEach((function(r){r.transform(e,t,n)})),this.children.forEach((function(r){r.transform(e,t,n)}))},i.prototype.updateSortValue=function(){var e=this.pathCommands.length,t=this.pathCommands[0].endRenderPoint,n=this.pathCommands[e-1].endRenderPoint;e>2&&t.isSame(n)&&(e-=1);for(var r=0,i=0;i0,this.backface||!this.isFacingBack)){if(!t)throw new Error("Zdog renderer required. Set to "+t);var r=1==n;t.isCanvas&&r?this.renderCanvasDot(e,t):this.renderPath(e,t)}};var a=e.TAU;return i.prototype.renderCanvasDot=function(e){var t=this.getLineWidth();if(t){e.fillStyle=this.getRenderColor();var n=this.pathCommands[0].endRenderPoint;e.beginPath();var r=t/2;e.arc(n.x,n.y,r,0,a),e.fill()}},i.prototype.getLineWidth=function(){return this.stroke?1==this.stroke?1:this.stroke:0},i.prototype.getRenderColor=function(){return"string"==typeof this.backface&&this.isFacingBack?this.backface:this.color},i.prototype.renderPath=function(e,t){var n=this.getRenderElement(e,t),r=!(2==this.pathCommands.length&&"line"==this.pathCommands[1].method)&&this.closed,i=this.getRenderColor();t.renderPath(e,n,this.pathCommands,r),t.stroke(e,n,this.stroke,i,this.getLineWidth()),t.fill(e,n,this.fill,i),t.end(e,n)},i.prototype.getRenderElement=function(e,t){if(t.isSvg)return this.svgElement||(this.svgElement=document.createElementNS("http://www.w3.org/2000/svg","path"),this.svgElement.setAttribute("stroke-linecap","round"),this.svgElement.setAttribute("stroke-linejoin","round")),this.svgElement},i}))},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(3));else{var i=t.Zdog;i.Vector=r(i)}}(this,(function(e){function t(e){this.set(e)}var n=e.TAU;function r(e,t,r,i){if(t&&t%n!=0){var o=Math.cos(t),a=Math.sin(t),s=e[r],l=e[i];e[r]=s*o-l*a,e[i]=l*o+s*a}}function i(e){return Math.abs(e-1)<1e-8?1:Math.sqrt(e)}return t.prototype.set=function(e){return this.x=e&&e.x||0,this.y=e&&e.y||0,this.z=e&&e.z||0,this},t.prototype.write=function(e){return e?(this.x=null!=e.x?e.x:this.x,this.y=null!=e.y?e.y:this.y,this.z=null!=e.z?e.z:this.z,this):this},t.prototype.rotate=function(e){if(e)return this.rotateZ(e.z),this.rotateY(e.y),this.rotateX(e.x),this},t.prototype.rotateZ=function(e){r(this,e,"x","y")},t.prototype.rotateX=function(e){r(this,e,"y","z")},t.prototype.rotateY=function(e){r(this,e,"x","z")},t.prototype.isSame=function(e){return!!e&&this.x===e.x&&this.y===e.y&&this.z===e.z},t.prototype.add=function(e){return e?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0,this):this},t.prototype.subtract=function(e){return e?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0,this):this},t.prototype.multiply=function(e){return null==e||("number"==typeof e?(this.x*=e,this.y*=e,this.z*=e):(this.x*=null!=e.x?e.x:1,this.y*=null!=e.y?e.y:1,this.z*=null!=e.z?e.z:1)),this},t.prototype.transform=function(e,t,n){return this.multiply(n),this.rotate(t),this.add(e),this},t.prototype.lerp=function(t,n){return this.x=e.lerp(this.x,t.x||0,n),this.y=e.lerp(this.y,t.y||0,n),this.z=e.lerp(this.z,t.z||0,n),this},t.prototype.magnitude=function(){return i(this.x*this.x+this.y*this.y+this.z*this.z)},t.prototype.magnitude2d=function(){return i(this.x*this.x+this.y*this.y)},t.prototype.copy=function(){return new t(this)},t}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.r(t),n.d(t,"gsap",(function(){return Gr})),n.d(t,"default",(function(){return Gr})),n.d(t,"CSSPlugin",(function(){return Hr})),n.d(t,"TweenMax",(function(){return Vr})),n.d(t,"TweenLite",(function(){return Yt})),n.d(t,"TimelineMax",(function(){return Bt})),n.d(t,"TimelineLite",(function(){return Bt})),n.d(t,"Power0",(function(){return _n})),n.d(t,"Power1",(function(){return Sn})),n.d(t,"Power2",(function(){return Mn})),n.d(t,"Power3",(function(){return En})),n.d(t,"Power4",(function(){return Tn})),n.d(t,"Linear",(function(){return Cn})),n.d(t,"Quad",(function(){return An})),n.d(t,"Cubic",(function(){return kn})),n.d(t,"Quart",(function(){return Pn})),n.d(t,"Quint",(function(){return Rn})),n.d(t,"Strong",(function(){return Ln})),n.d(t,"Elastic",(function(){return On})),n.d(t,"Back",(function(){return zn})),n.d(t,"SteppedEase",(function(){return Dn})),n.d(t,"Bounce",(function(){return Nn})),n.d(t,"Sine",(function(){return In})),n.d(t,"Expo",(function(){return Fn})),n.d(t,"Circ",(function(){return Bn}));var o,a,s,l,c,u,d,h,f,p,m,g,v,y,b,x,w,_,S,M,E,T,C,A,k,P,R,L,O={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},z={duration:.5,overwrite:!1,delay:0},D=1e8,N=2*Math.PI,I=N/4,F=0,B=Math.sqrt,j=Math.cos,U=Math.sin,H=function(e){return"string"==typeof e},G=function(e){return"function"==typeof e},V=function(e){return"number"==typeof e},W=function(e){return void 0===e},q=function(e){return"object"==typeof e},X=function(e){return!1!==e},Y=function(){return"undefined"!=typeof window},$=function(e){return G(e)||H(e)},Z="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},J=Array.isArray,Q=/(?:-?\.?\d|\.)+/gi,K=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ee=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,te=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ne=/[+-]=-?[.\d]+/,re=/[#\-+.]*\b[a-z\d-=+%.]+/gi,ie=/[\d.+\-=]+(?:e[-+]\d*)*/i,oe={},ae={},se=function(e){return(ae=Oe(e,oe))&&fn},le=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},ce=function(e,t){return!t&&console.warn(e)},ue=function(e,t){return e&&(oe[e]=t)&&ae&&(ae[e]=t)||oe},de=function(){return 0},he={},fe=[],pe={},me={},ge={},ve=30,ye=[],be="",xe=function(e){var t,n,r=e[0];if(q(r)||G(r)||(e=[e]),!(t=(r._gsap||{}).harness)){for(n=ye.length;n--&&!ye[n].targetTest(r););t=ye[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new It(e[n],t)))||e.splice(n,1);return e},we=function(e){return e._gsap||xe(it(e))[0]._gsap},_e=function(e,t,n){return(n=e[t])&&G(n)?e[t]():W(n)&&e.getAttribute&&e.getAttribute(t)||n},Se=function(e,t){return(e=e.split(",")).forEach(t)||e},Me=function(e){return Math.round(1e5*e)/1e5||0},Ee=function(e,t){for(var n=t.length,r=0;e.indexOf(t[r])<0&&++re._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},je=function(e){return e._repeat?Ue(e._tTime,e=e.duration()+e._rDelay)*e:0},Ue=function(e,t){var n=Math.floor(e/=t);return e&&n===e?n-1:n},He=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Ge=function(e){return e._end=Me(e._start+(e._tDur/Math.abs(e._ts||e._rts||1e-8)||0))},Ve=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=Me(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Ge(e),n._dirty||Be(n,e)),e},We=function(e,t){var n;if((t._time||t._initted&&!t._dur)&&(n=He(e.rawTime(),t),(!t._dur||et(0,t.totalDuration(),n)-t._tTime>1e-8)&&t.render(n,!0)),Be(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-1e-8}},qe=function(e,t,n,r){return t.parent&&Fe(t),t._start=Me(n+t._delay),t._end=Me(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),function(e,t,n,r,i){void 0===n&&(n="_first"),void 0===r&&(r="_last");var o,a=e[r];if(i)for(o=t[i];a&&a[i]>o;)a=a._prev;a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=t._dp=e}(e,t,"_first","_last",e._sort?"_start":0),e._recent=t,r||We(e,t),e},Xe=function(e,t){return(oe.ScrollTrigger||le("scrollTrigger",t))&&oe.ScrollTrigger.create(t,e)},Ye=function(e,t,n,r){return Vt(e,t),e._initted?!n&&e._pt&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&d!==Mt.frame?(fe.push(e),e._lazy=[t,r],1):void 0:1},$e=function(e,t,n,r){var i=e._repeat,o=Me(t)||0,a=e._tTime/e._tDur;return a&&!r&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:Me(o*(i+1)+e._rDelay*i):o,a&&!r?Ve(e,e._tTime=e._tDur*a):e.parent&&Ge(e),n||Be(e.parent,e),e},Ze=function(e){return e instanceof Bt?Be(e):$e(e,e._dur)},Je={_start:0,endTime:de},Qe=function e(t,n){var r,i,o=t.labels,a=t._recent||Je,s=t.duration()>=D?a.endTime(!1):t._dur;return H(n)&&(isNaN(n)||n in o)?"<"===(r=n.charAt(0))||">"===r?("<"===r?a._start:a.endTime(a._repeat>=0))+(parseFloat(n.substr(1))||0):(r=n.indexOf("="))<0?(n in o||(o[n]=s),o[n]):(i=+(n.charAt(r-1)+n.substr(r+1)),r>1?e(t,n.substr(0,r-1))+i:s+i):null==n?s:+n},Ke=function(e,t){return e||0===e?t(e):t},et=function(e,t,n){return nt?t:n},tt=function(e){if("string"!=typeof e)return"";var t=ie.exec(e);return t?e.substr(t.index+t[0].length):""},nt=[].slice,rt=function(e,t){return e&&q(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&q(e[0]))&&!e.nodeType&&e!==s},it=function(e,t){return!H(e)||t||!l&&Et()?J(e)?function(e,t,n){return void 0===n&&(n=[]),e.forEach((function(e){var r;return H(e)&&!t||rt(e,1)?(r=n).push.apply(r,it(e)):n.push(e)}))||n}(e,t):rt(e)?nt.call(e,0):e?[e]:[]:nt.call(c.querySelectorAll(e),0)},ot=function(e){return e.sort((function(){return.5-Math.random()}))},at=function(e){if(G(e))return e;var t=q(e)?e:{each:e},n=Lt(t.ease),r=t.from||0,i=parseFloat(t.base)||0,o={},a=r>0&&r<1,s=isNaN(r)||a,l=t.axis,c=r,u=r;return H(r)?c=u={center:.5,edges:.5,end:1}[r]||0:!a&&s&&(c=r[0],u=r[1]),function(e,a,d){var h,f,p,m,g,v,y,b,x,w=(d||t).length,_=o[w];if(!_){if(!(x="auto"===t.grid?0:(t.grid||[1,D])[1])){for(y=-D;y<(y=d[x++].getBoundingClientRect().left)&&xy&&(y=g),gw?w-1:l?"y"===l?w/x:x:Math.max(x,w/x))||0)*("edges"===r?-1:1),_.b=w<0?i-w:i,_.u=tt(t.amount||t.each)||0,n=n&&w<0?Pt(n):n}return w=(_[e]-_.min)/_.max||0,Me(_.b+(n?n(w):w)*_.v)+_.u}},st=function(e){var t=e<1?Math.pow(10,(e+"").length-2):1;return function(n){var r=Math.round(parseFloat(n)/e)*e*t;return(r-r%1)/t+(V(n)?0:tt(n))}},lt=function(e,t){var n,r,i=J(e);return!i&&q(e)&&(n=i=e.radius||D,e.values?(e=it(e.values),(r=!V(e[0]))&&(n*=n)):e=st(e.increment)),Ke(t,i?G(e)?function(t){return r=e(t),Math.abs(r-t)<=n?r:t}:function(t){for(var i,o,a=parseFloat(r?t.x:t),s=parseFloat(r?t.y:0),l=D,c=0,u=e.length;u--;)(i=r?(i=e[u].x-a)*i+(o=e[u].y-s)*o:Math.abs(e[u]-a))(i=Math.abs(i))&&(o=r,s=i);return o},pt=function(e,t,n){var r,i,o=e.vars,a=o[t];if(a)return r=o[t+"Params"],i=o.callbackScope||e,n&&fe.length&&Ce(),r?a.apply(i,r):a.call(i)},mt=function(e){return Fe(e),e.progress()<1&&pt(e,"onInterrupt"),e},gt={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},vt=function(e,t,n){return 255*(6*(e=e<0?e+1:e>1?e-1:e)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)+.5|0},yt=function(e,t,n){var r,i,o,a,s,l,c,u,d,h,f=e?V(e)?[e>>16,e>>8&255,255&e]:0:gt.black;if(!f){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),gt[e])f=gt[e];else if("#"===e.charAt(0)){if(e.length<6&&(r=e.charAt(1),i=e.charAt(2),o=e.charAt(3),e="#"+r+r+i+i+o+o+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(f=parseInt(e.substr(1,6),16))>>16,f>>8&255,255&f,parseInt(e.substr(7),16)/255];f=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e]}else if("hsl"===e.substr(0,3))if(f=h=e.match(Q),t){if(~e.indexOf("="))return f=e.match(K),n&&f.length<4&&(f[3]=1),f}else a=+f[0]%360/360,s=+f[1]/100,r=2*(l=+f[2]/100)-(i=l<=.5?l*(s+1):l+s-l*s),f.length>3&&(f[3]*=1),f[0]=vt(a+1/3,r,i),f[1]=vt(a,r,i),f[2]=vt(a-1/3,r,i);else f=e.match(Q)||gt.transparent;f=f.map(Number)}return t&&!h&&(r=f[0]/255,i=f[1]/255,o=f[2]/255,l=((c=Math.max(r,i,o))+(u=Math.min(r,i,o)))/2,c===u?a=s=0:(d=c-u,s=l>.5?d/(2-c-u):d/(c+u),a=c===r?(i-o)/d+(iw&&(S+=a-_),((n=(i=(M+=a)-S)-T)>0||s)&&(o=++v.frame,y=i-1e3*v.time,v.time=i/=1e3,T+=n+(n>=E?4:E-n),r=1),s||(p=m(e)),r)for(b=0;b=t&&b--},_listeners:C=[]}),Et=function(){return!f&&Mt.wake()},Tt={},Ct=/^[\d.\-M][\d.\-,\s]/,At=/["']/g,kt=function(e){for(var t,n,r,i={},o=e.substr(1,e.length-3).split(":"),a=o[0],s=1,l=o.length;s1&&a.config?a.config.apply(null,~e.indexOf("{")?[kt(o[1])]:(t=e,n=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",n),t.substring(n,~i&&i=1?n:1,o=(r||(t?.3:.45))/(n<1?n:1),a=o/N*(Math.asin(1/i)||0),s=function(e){return 1===e?1:i*Math.pow(2,-10*e)*U((e-a)*o)+1},l="out"===t?s:"in"===t?function(e){return 1-s(1-e)}:zt(s);return o=N/o,l.config=function(n,r){return e(t,n,r)},l},Nt=function e(t,n){void 0===n&&(n=1.70158);var r=function(e){return e?--e*e*((n+1)*e+n)+1:0},i="out"===t?r:"in"===t?function(e){return 1-r(1-e)}:zt(r);return i.config=function(n){return e(t,n)},i};Se("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var n=t<5?t+1:t;Ot(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},(function(e){return 1-Math.pow(1-e,n)}),(function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow(2*(1-e),n)/2}))})),Tt.Linear.easeNone=Tt.none=Tt.Linear.easeIn,Ot("Elastic",Dt("in"),Dt("out"),Dt()),k=7.5625,R=1/(P=2.75),Ot("Bounce",(function(e){return 1-L(1-e)}),L=function(e){return e0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,$e(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(Et(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Ve(this,e),!n._dp||n.parent||We(n,this);n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e0||!this._tDur&&!e)&&qe(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&1e-8===Math.abs(this._zTime)||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),Ae(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+je(this))%this._dur||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?e:1-e)+je(this),t):this.duration()?Math.min(1,this._time/this._dur):this.ratio},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?Ue(this._tTime,n)+1:1},t.timeScale=function(e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var t=this.parent&&this._ts?He(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e}(this.totalTime(et(-this._delay,this._tDur,t),!0))},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Et(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&(this._tTime-=1e-8)&&1e-8!==Math.abs(this._zTime)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e;var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&qe(t,this,e-this._delay),this}return this._start},t.endTime=function(e){return this._start+(X(e)?this.totalDuration():this.duration())/Math.abs(this._ts)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?He(t.rawTime(e),this):this._tTime:this._tTime},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(t._ts||1),t=t._dp;return n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,Ze(this)):-2===this._repeat?1/0:this._repeat},t.repeatDelay=function(e){return arguments.length?(this._rDelay=e,Ze(this)):this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(Qe(this,e),X(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,X(t))},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,n=this._start;return!(t&&!(this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=n&&e1?(t?(r[e]=t,n&&(r[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this;return new Promise((function(n){var r=G(e)?e:Pe,i=function(){var e=t.then;t.then=null,G(r)&&(r=r(t))&&(r.then||r===t)&&(t.then=e),n(r),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?i():t._prom=i}))},t.kill=function(){mt(this)},e}();Re(Ft.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Bt=function(e){function t(t,n){var i;return void 0===t&&(t={}),(i=e.call(this,t,n)||this).labels={},i.smoothChildTiming=!!t.smoothChildTiming,i.autoRemoveChildren=!!t.autoRemoveChildren,i._sort=X(t.sortChildren),i.parent&&We(i.parent,r(i)),t.scrollTrigger&&Xe(r(i),t.scrollTrigger),i}i(t,e);var n=t.prototype;return n.to=function(e,t,n){return new Yt(e,Te(arguments,0,this),Qe(this,V(t)?arguments[3]:n)),this},n.from=function(e,t,n){return new Yt(e,Te(arguments,1,this),Qe(this,V(t)?arguments[3]:n)),this},n.fromTo=function(e,t,n,r){return new Yt(e,Te(arguments,2,this),Qe(this,V(t)?arguments[4]:r)),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,Ne(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new Yt(e,t,Qe(this,n),1),this},n.call=function(e,t,n){return qe(this,Yt.delayedCall(0,e,t),Qe(this,n))},n.staggerTo=function(e,t,n,r,i,o,a){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=o,n.onCompleteParams=a,n.parent=this,new Yt(e,n,Qe(this,i)),this},n.staggerFrom=function(e,t,n,r,i,o,a){return n.runBackwards=1,Ne(n).immediateRender=X(n.immediateRender),this.staggerTo(e,t,n,r,i,o,a)},n.staggerFromTo=function(e,t,n,r,i,o,a,s){return r.startAt=n,Ne(r).immediateRender=X(r.immediateRender),this.staggerTo(e,t,r,i,o,a,s)},n.render=function(e,t,n){var r,i,o,s,l,c,u,d,h,f,p,m,g=this._time,v=this._dirty?this.totalDuration():this._tDur,y=this._dur,b=this!==a&&e>v-1e-8&&e>=0?v:e<1e-8?0:e,x=this._zTime<0!=e<0&&(this._initted||!y);if(b!==this._tTime||n||x){if(g!==this._time&&y&&(b+=this._time-g,e+=this._time-g),r=b,h=this._start,c=!(d=this._ts),x&&(y||(g=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(p=this._yoyo,l=y+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*l+e,t,n);if(r=Me(b%l),b===v?(s=this._repeat,r=y):((s=~~(b/l))&&s===b/l&&(r=y,s--),r>y&&(r=y)),f=Ue(this._tTime,l),!g&&this._tTime&&f!==s&&(f=s),p&&1&s&&(r=y-r,m=1),s!==f&&!this._lock){var w=p&&1&f,_=w===(p&&1&s);if(st)for(r=e._first;r&&r._start<=n;){if(!r._dur&&"isPause"===r.data&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if(!r._dur&&"isPause"===r.data&&r._start=0)&&!t&&pt(this,"onStart"),r>=g&&e>=0)for(i=this._first;i;){if(o=i._next,(i._act||r>=i._start)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(r-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(r-i._start)*i._ts,t,n),r!==this._time||!this._ts&&!c){u=0,o&&(b+=this._zTime=-1e-8);break}}i=o}else{i=this._last;for(var S=e<0?e:r;i;){if(o=i._prev,(i._act||S<=i._end)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(S-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(S-i._start)*i._ts,t,n),r!==this._time||!this._ts&&!c){u=0,o&&(b+=this._zTime=S?-1e-8:1e-8);break}}i=o}}if(u&&!t&&(this.pause(),u.render(r>=g?0:-1e-8)._zTime=r>=g?1:-1,this._ts))return this._start=h,Ge(this),this.render(e,t,n);this._onUpdate&&!t&&pt(this,"onUpdate",!0),(b===v&&v>=this.totalDuration()||!b&&g)&&(h!==this._start&&Math.abs(d)===Math.abs(this._ts)||this._lock||((e||!y)&&(b===v&&this._ts>0||!b&&this._ts<0)&&Fe(this,1),t||e<0&&!g||!b&&!g||(pt(this,b===v?"onComplete":"onReverseComplete",!0),this._prom&&!(b0)&&this._prom())))}return this},n.add=function(e,t){var n=this;if(V(t)||(t=Qe(this,t)),!(e instanceof Ft)){if(J(e))return e.forEach((function(e){return n.add(e,t)})),this;if(H(e))return this.addLabel(e,t);if(!G(e))return this;e=Yt.delayedCall(0,e)}return this!==e?qe(this,e,t):this},n.getChildren=function(e,t,n,r){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=-D);for(var i=[],o=this._first;o;)o._start>=r&&(o instanceof Yt?t&&i.push(o):(n&&i.push(o),e&&i.push.apply(i,o.getChildren(!0,t,n)))),o=o._next;return i},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return H(e)?this.removeLabel(e):G(e)?this.killTweensOf(e):(Ie(this,e),e===this._recent&&(this._recent=this._last),Be(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Me(Mt.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=Qe(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var r=Yt.delayedCall(0,t||de,n);return r.data="isPause",this._hasPause=1,qe(this,r,Qe(this,e))},n.removePause=function(e){var t=this._first;for(e=Qe(this,e);t;)t._start===e&&"isPause"===t.data&&Fe(t),t=t._next},n.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)jt!==r[i]&&r[i].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n,r=[],i=it(e),o=this._first,a=V(t);o;)o instanceof Yt?Ee(o._targets,i)&&(a?(!jt||o._initted&&o._ts)&&o.globalTime(0)<=t&&o.globalTime(o.totalDuration())>t:!t||o.isActive())&&r.push(o):(n=o.getTweensOf(i,t)).length&&r.push.apply(r,n),o=o._next;return r},n.tweenTo=function(e,t){t=t||{};var n=this,r=Qe(n,e),i=t,o=i.startAt,a=i.onStart,s=i.onStartParams,l=i.immediateRender,c=Yt.to(n,Re({ease:"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:t.duration||Math.abs((r-(o&&"time"in o?o.time:n._time))/n.timeScale())||1e-8,onStart:function(){n.pause();var e=t.duration||Math.abs((r-n._time)/n.timeScale());c._dur!==e&&$e(c,e,0,1).render(c._time,!0,!0),a&&a.apply(c,s||[])}},t));return l?c.render(0):c},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,Re({startAt:{time:Qe(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return void 0===e&&(e=this._time),ft(this,Qe(this,e))},n.previousLabel=function(e){return void 0===e&&(e=this._time),ft(this,Qe(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+1e-8)},n.shiftChildren=function(e,t,n){void 0===n&&(n=0);for(var r,i=this._first,o=this.labels;i;)i._start>=n&&(i._start+=e,i._end+=e),i=i._next;if(t)for(r in o)o[r]>=n&&(o[r]+=e);return Be(this)},n.invalidate=function(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return e.prototype.invalidate.call(this)},n.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),Be(this)},n.totalDuration=function(e){var t,n,r,i=0,o=this,s=o._last,l=D;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-e:e));if(o._dirty){for(r=o.parent;s;)t=s._prev,s._dirty&&s.totalDuration(),(n=s._start)>l&&o._sort&&s._ts&&!o._lock?(o._lock=1,qe(o,s,n-s._delay,1)._lock=0):l=n,n<0&&s._ts&&(i-=n,(!r&&!o._dp||r&&r.smoothChildTiming)&&(o._start+=n/o._ts,o._time-=n,o._tTime-=n),o.shiftChildren(-n,!1,-1/0),l=0),s._end>i&&s._ts&&(i=s._end),s=t;$e(o,o===a&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(e){if(a._ts&&(Ae(a,He(e,a)),d=Mt.frame),Mt.frame>=ve){ve+=O.autoSleep||120;var t=a._first;if((!t||!t._ts)&&O.autoSleep&&Mt._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Mt.sleep()}}},t}(Ft);Re(Bt.prototype,{_lock:0,_hasPause:0,_forcing:0});var jt,Ut=function(e,t,n,r,i,o,a){var s,l,c,u,d,h,f,p,m=new cn(this._pt,e,t,0,1,nn,null,i),g=0,v=0;for(m.b=n,m.e=r,n+="",(f=~(r+="").indexOf("random("))&&(r=dt(r)),o&&(o(p=[n,r],e,t),n=p[0],r=p[1]),l=n.match(te)||[];s=te.exec(r);)u=s[0],d=r.substring(g,s.index),c?c=(c+1)%5:"rgba("===d.substr(-5)&&(c=1),u!==l[v++]&&(h=parseFloat(l[v-1])||0,m._pt={_next:m._pt,p:d||1===v?d:",",s:h,c:"="===u.charAt(1)?parseFloat(u.substr(2))*("-"===u.charAt(0)?-1:1):parseFloat(u)-h,m:c&&c<4?Math.round:0},g=te.lastIndex);return m.c=g0)k||(t._startAt=0);else if(P&&!(n<0&&R))return void(n&&(t._zTime=n))}else if(T&&P)if(R)!k&&(t._startAt=0);else if(n&&(w=!1),s=Re({overwrite:!1,data:"isFromStart",lazy:w&&X(_),immediateRender:w,stagger:0,parent:O},r),g&&(s[h.prop]=g),Fe(t._startAt=Yt.set(L,s)),w){if(!n)return}else e(t._startAt,1e-8);for(t._pt=0,_=P&&X(_)||_&&!P,i=0;i")}));else{if(h=A.length,m=w?at(w):de,q(w))for(f in w)~qt.indexOf(f)&&(g||(g={}),g[f]=w[f]);for(u=0;uf-1e-8&&e>=0?f:e<1e-8?0:e;if(p){if(m!==this._tTime||!e||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=e<0){if(r=m,u=this.timeline,this._repeat){if(a=p+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*a+e,t,n);if(r=Me(m%a),m===f?(o=this._repeat,r=p):((o=~~(m/a))&&o===m/a&&(r=p,o--),r>p&&(r=p)),(l=this._yoyo&&1&o)&&(d=this._yEase,r=p-r),s=Ue(this._tTime,a),r===h&&!n&&this._initted)return this;o!==s&&(u&&this._yEase&&Rt(u,l),!this.vars.repeatRefresh||l||this._lock||(this._lock=n=1,this.render(Me(a*o),!0).invalidate()._lock=0))}if(!this._initted){if(Ye(this,e<0?e:r,n,t))return this._tTime=0,this;if(p!==this._dur)return this.render(e,t,n)}for(this._tTime=m,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(d||this._ease)(r/p),this._from&&(this.ratio=c=1-c),r&&!h&&!t&&pt(this,"onStart"),i=this._pt;i;)i.r(c,i.d),i=i._next;u&&u.render(e<0?e:!r&&l?-1e-8:u._dur*c,t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(e<0&&this._startAt&&this._startAt.render(e,!0,n),pt(this,"onUpdate")),this._repeat&&o!==s&&this.vars.onRepeat&&!t&&this.parent&&pt(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(e<0&&this._startAt&&!this._onUpdate&&this._startAt.render(e,!0,!0),(e||!p)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&Fe(this,1),t||e<0&&!h||!m&&!h||(pt(this,m===f?"onComplete":"onReverseComplete",!0),this._prom&&!(m0)&&this._prom()))}}else!function(e,t,n,r){var i,o,a,s=e.ratio,l=t<0||!t&&(!e._start&&function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||e(n))}(e)||(e._ts<0||e._dp._ts<0)&&"isFromStart"!==e.data&&"isStart"!==e.data)?0:1,c=e._rDelay,u=0;if(c&&e._repeat&&(u=et(0,e._tDur,t),o=Ue(u,c),a=Ue(e._tTime,c),e._yoyo&&1&o&&(l=1-l),o!==a&&(s=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==s||r||1e-8===e._zTime||!t&&e._zTime){if(!e._initted&&Ye(e,t,r,n))return;for(a=e._zTime,e._zTime=t||(n?1e-8:0),n||(n=t&&!a),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=u,n||pt(e,"onStart"),i=e._pt;i;)i.r(l,i.d),i=i._next;e._startAt&&t<0&&e._startAt.render(t,!0,!0),e._onUpdate&&!n&&pt(e,"onUpdate"),u&&e._repeat&&!n&&e.parent&&pt(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&Fe(e,1),n||(pt(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)}(this,e,t,n);return this},n.targets=function(){return this._targets},n.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),e.prototype.invalidate.call(this)},n.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t))return this._lazy=this._pt=0,this.parent?mt(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,jt&&!0!==jt.vars.overwrite)._first||mt(this),this.parent&&n!==this.timeline.totalDuration()&&$e(this,this._dur*this.timeline._tDur/n,0,1),this}var r,i,o,a,s,l,c,u=this._targets,d=e?it(e):u,h=this._ptLookup,f=this._pt;if((!t||"all"===t)&&function(e,t){for(var n=e.length,r=n===t.length;r&&n--&&e[n]===t[n];);return n<0}(u,d))return"all"===t&&(this._pt=0),mt(this);for(r=this._op=this._op||[],"all"!==t&&(H(t)&&(s={},Se(t,(function(e){return s[e]=1})),t=s),t=function(e,t){var n,r,i,o,a=e[0]?we(e[0]).harness:0,s=a&&a.aliases;if(!s)return t;for(r in n=Oe({},t),s)if(r in n)for(i=(o=s[r].split(",")).length;i--;)n[o[i]]=n[r];return n}(u,t)),c=u.length;c--;)if(~d.indexOf(u[c]))for(s in i=h[c],"all"===t?(r[c]=t,a=i,o={}):(o=r[c]=r[c]||{},a=t),a)(l=i&&i[s])&&("kill"in l.d&&!0!==l.d.kill(s)||Ie(this,l,"_pt"),delete i[s]),"all"!==o&&(o[s]=1);return this._initted&&!this._pt&&f&&mt(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,n){return new t(e,Te(arguments,1))},t.delayedCall=function(e,n,r,i){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},t.fromTo=function(e,n,r){return new t(e,Te(arguments,2))},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return a.killTweensOf(e,t,n)},t}(Ft);Re(Yt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Se("staggerTo,staggerFrom,staggerFromTo",(function(e){Yt[e]=function(){var t=new Bt,n=nt.call(arguments,0);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}}));var $t=function(e,t,n){return e[t]=n},Zt=function(e,t,n){return e[t](n)},Jt=function(e,t,n,r){return e[t](r.fp,n)},Qt=function(e,t,n){return e.setAttribute(t,n)},Kt=function(e,t){return G(e[t])?Zt:W(e[t])&&e.setAttribute?Qt:$t},en=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4,t)},tn=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},nn=function(e,t){var n=t._pt,r="";if(!e&&t.b)r=t.b;else if(1===e&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round(1e4*(n.s+n.c*e))/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},rn=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},on=function(e,t,n,r){for(var i,o=this._pt;o;)i=o._next,o.p===r&&o.modifier(e,t,n),o=i},an=function(e){for(var t,n,r=this._pt;r;)n=r._next,r.p===e&&!r.op||r.op===e?Ie(this,r,"_pt"):r.dep||(t=1),r=n;return!t},sn=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},ln=function(e){for(var t,n,r,i,o=e._pt;o;){for(t=o._next,n=r;n&&n.pr>o.pr;)n=n._next;(o._prev=n?n._prev:i)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:i=o,o=t}e._pt=r},cn=function(){function e(e,t,n,r,i,o,a,s,l){this.t=t,this.s=r,this.c=i,this.p=n,this.r=o||en,this.d=a||this,this.set=s||$t,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=sn,this.m=e,this.mt=n,this.tween=t},e}();Se(be+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(e){return he[e]=1})),oe.TweenMax=oe.TweenLite=Yt,oe.TimelineLite=oe.TimelineMax=Bt,a=new Bt({sortChildren:!1,defaults:z,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),O.stringFilter=St;var un={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){var r=e.map((function(e){return fn.quickSetter(e,t,n)})),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var o=me[t],a=we(e),s=a.harness&&(a.harness.aliases||{})[t]||t,l=o?function(t){var r=new o;h._pt=0,r.init(e,n?t+n:t,h,0,[e]),r.render(1,r),h._pt&&rn(1,h)}:a.set(e,s);return o?l:function(t){return l(e,s,n?t+n:t,a,1)}},isTweening:function(e){return a.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Lt(e.ease,z.ease)),ze(z,e||{})},config:function(e){return ze(O,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach((function(e){return e&&!me[e]&&!oe[e]&&ce(t+" effect requires "+e+" plugin.")})),ge[t]=function(e,t,r){return n(it(e),Re(t||{},i),r)},o&&(Bt.prototype[t]=function(e,n,r){return this.add(ge[t](e,q(n)?n:(r=n)&&{},this),r)})},registerEase:function(e,t){Tt[e]=Lt(t)},parseEase:function(e,t){return arguments.length?Lt(e,t):Tt},getById:function(e){return a.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,r,i=new Bt(e);for(i.smoothChildTiming=X(e.smoothChildTiming),a.remove(i),i._dp=0,i._time=i._tTime=a._time,n=a._first;n;)r=n._next,!t&&!n._dur&&n instanceof Yt&&n.vars.onComplete===n._targets[0]||qe(i,n,n._start-n._delay),n=r;return qe(a,i,0),i},utils:{wrap:function e(t,n,r){var i=n-t;return J(t)?ut(t,e(0,t.length),n):Ke(r,(function(e){return(i+(e-t)%i)%i+t}))},wrapYoyo:function e(t,n,r){var i=n-t,o=2*i;return J(t)?ut(t,e(0,t.length-1),n):Ke(r,(function(e){return t+((e=(o+(e-t)%o)%o||0)>i?o-e:e)}))},distribute:at,random:ct,snap:lt,normalize:function(e,t,n){return ht(e,t,0,1,n)},getUnit:tt,clamp:function(e,t,n){return Ke(n,(function(n){return et(e,t,n)}))},splitColor:yt,toArray:it,mapRange:ht,pipe:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0?ur[i]:"")+e},hr=function(){"undefined"!=typeof window&&window.document&&(pn=window,mn=pn.document,gn=mn.documentElement,yn=lr("div")||{style:{}},bn=lr("div"),ar=dr(ar),sr=ar+"Origin",yn.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",wn=!!dr("perspective"),vn=1)},fr=function e(t){var n,r=lr("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,a=this.style.cssText;if(gn.appendChild(r),r.appendChild(this),this.style.display="block",t)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(e){}else this._gsapBBox&&(n=this._gsapBBox());return i&&(o?i.insertBefore(this,o):i.appendChild(this)),gn.removeChild(r),this.style.cssText=a,n},pr=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},mr=function(e){var t;try{t=e.getBBox()}catch(n){t=fr.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===fr||(t=fr.call(e,!0)),!t||t.width||t.x||t.y?t:{x:+pr(e,["x","cx","x1"])||0,y:+pr(e,["y","cy","y1"])||0,width:0,height:0}},gr=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!mr(e))},vr=function(e,t){if(t){var n=e.style;t in jn&&t!==sr&&(t=ar),n.removeProperty?("ms"!==t.substr(0,2)&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty(t.replace(Vn,"-$1").toLowerCase())):n.removeAttribute(t)}},yr=function(e,t,n,r,i,o){var a=new cn(e._pt,t,n,0,1,o?Kn:Qn);return e._pt=a,a.b=r,a.e=i,e._props.push(n),a},br={deg:1,rad:1,turn:1},xr=function e(t,n,r,i){var o,a,s,l,c=parseFloat(r)||0,u=(r+"").trim().substr((c+"").length)||"px",d=yn.style,h=Wn.test(n),f="svg"===t.tagName.toLowerCase(),p=(f?"client":"offset")+(h?"Width":"Height"),m="px"===i,g="%"===i;return i===u||!c||br[i]||br[u]?c:("px"!==u&&!m&&(c=e(t,n,r,"px")),l=t.getCTM&&gr(t),!g&&"%"!==u||!jn[n]&&!~n.indexOf("adius")?(d[h?"width":"height"]=100+(m?u:i),a=~n.indexOf("adius")||"em"===i&&t.appendChild&&!f?t:t.parentNode,l&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==mn&&a.appendChild||(a=mn.body),(s=a._gsap)&&g&&s.width&&h&&s.time===Mt.time?Me(c/s.width*100):((g||"%"===u)&&(d.position=cr(t,"position")),a===t&&(d.position="static"),a.appendChild(yn),o=yn[p],a.removeChild(yn),d.position="absolute",h&&g&&((s=we(a)).time=Mt.time,s.width=a[p]),Me(m?o*c/100:o&&c?100/o*c:0))):(o=l?t.getBBox()[h?"width":"height"]:t[p],Me(g?c/o*100:c/100*o)))},wr=function(e,t,n,r){var i;return vn||hr(),t in Xn&&"transform"!==t&&~(t=Xn[t]).indexOf(",")&&(t=t.split(",")[0]),jn[t]&&"transform"!==t?(i=Lr(e,r),i="transformOrigin"!==t?i[t]:Or(cr(e,sr))+" "+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=Er[t]&&Er[t](e,t,n)||cr(e,t)||_e(e,t)||("opacity"===t?1:0)),n&&!~(i+"").trim().indexOf(" ")?xr(e,t,i,n)+n:i},_r=function(e,t,n,r){if(!n||"none"===n){var i=dr(t,e,1),o=i&&cr(e,i,1);o&&o!==n?(t=i,n=o):"borderColor"===t&&(n=cr(e,"borderTopColor"))}var a,s,l,c,u,d,h,f,p,m,g,v,y=new cn(this._pt,e.style,t,0,1,nn),b=0,x=0;if(y.b=n,y.e=r,n+="","auto"===(r+="")&&(e.style[t]=r,r=cr(e,t)||r,e.style[t]=n),St(a=[n,r]),r=a[1],l=(n=a[0]).match(ee)||[],(r.match(ee)||[]).length){for(;s=ee.exec(r);)h=s[0],p=r.substring(b,s.index),u?u=(u+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(u=1),h!==(d=l[x++]||"")&&(c=parseFloat(d)||0,g=d.substr((c+"").length),(v="="===h.charAt(1)?+(h.charAt(0)+"1"):0)&&(h=h.substr(2)),f=parseFloat(h),m=h.substr((f+"").length),b=ee.lastIndex-m.length,m||(m=m||O.units[t]||g,b===r.length&&(r+=m,y.e+=m)),g!==m&&(c=xr(e,t,d,m)||0),y._pt={_next:y._pt,p:p||1===x?p:",",s:c,c:v?v*f:f-c,m:u&&u<4||"zIndex"===t?Math.round:0});y.c=b-1;)n=s[i],jn[n]&&(r=1,n="transformOrigin"===n?sr:ar),vr(o,n);r&&(vr(o,ar),l&&(l.svg&&o.removeAttribute("transform"),Lr(o,1),l.uncache=1))}},Er={clearProps:function(e,t,n,r,i){if("isFromStart"!==i.data){var o=e._pt=new cn(e._pt,t,n,0,0,Mr);return o.u=r,o.pr=-10,o.tween=i,e._props.push(n),1}}},Tr=[1,0,0,1,0,0],Cr={},Ar=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},kr=function(e){var t=cr(e,ar);return Ar(t)?Tr:t.substr(7).match(K).map(Me)},Pr=function(e,t){var n,r,i,o,a=e._gsap||we(e),s=e.style,l=kr(e);return a.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(i=e.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?Tr:l:(l!==Tr||e.offsetParent||e===gn||a.svg||(i=s.display,s.display="block",(n=e.parentNode)&&e.offsetParent||(o=1,r=e.nextSibling,gn.appendChild(e)),l=kr(e),i?s.display=i:vr(e,"display"),o&&(r?n.insertBefore(e,r):n?n.appendChild(e):gn.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},Rr=function(e,t,n,r,i,o){var a,s,l,c=e._gsap,u=i||Pr(e,!0),d=c.xOrigin||0,h=c.yOrigin||0,f=c.xOffset||0,p=c.yOffset||0,m=u[0],g=u[1],v=u[2],y=u[3],b=u[4],x=u[5],w=t.split(" "),_=parseFloat(w[0])||0,S=parseFloat(w[1])||0;n?u!==Tr&&(s=m*y-g*v)&&(l=_*(-g/s)+S*(m/s)-(m*x-g*b)/s,_=_*(y/s)+S*(-v/s)+(v*x-y*b)/s,S=l):(_=(a=mr(e)).x+(~w[0].indexOf("%")?_/100*a.width:_),S=a.y+(~(w[1]||w[0]).indexOf("%")?S/100*a.height:S)),r||!1!==r&&c.smooth?(b=_-d,x=S-h,c.xOffset=f+(b*m+x*v)-b,c.yOffset=p+(b*g+x*y)-x):c.xOffset=c.yOffset=0,c.xOrigin=_,c.yOrigin=S,c.smooth=!!r,c.origin=t,c.originIsAbsolute=!!n,e.style[sr]="0px 0px",o&&(yr(o,c,"xOrigin",d,_),yr(o,c,"yOrigin",h,S),yr(o,c,"xOffset",f,c.xOffset),yr(o,c,"yOffset",p,c.yOffset)),e.setAttribute("data-svg-origin",_+" "+S)},Lr=function(e,t){var n=e._gsap||new It(e);if("x"in n&&!t&&!n.uncache)return n;var r,i,o,a,s,l,c,u,d,h,f,p,m,g,v,y,b,x,w,_,S,M,E,T,C,A,k,P,R,L,z,D,N=e.style,I=n.scaleX<0,F=cr(e,sr)||"0";return r=i=o=l=c=u=d=h=f=0,a=s=1,n.svg=!(!e.getCTM||!gr(e)),g=Pr(e,n.svg),n.svg&&(T=!n.uncache&&e.getAttribute("data-svg-origin"),Rr(e,T||F,!!T||n.originIsAbsolute,!1!==n.smooth,g)),p=n.xOrigin||0,m=n.yOrigin||0,g!==Tr&&(x=g[0],w=g[1],_=g[2],S=g[3],r=M=g[4],i=E=g[5],6===g.length?(a=Math.sqrt(x*x+w*w),s=Math.sqrt(S*S+_*_),l=x||w?Gn(w,x)*Un:0,(d=_||S?Gn(_,S)*Un+l:0)&&(s*=Math.cos(d*Hn)),n.svg&&(r-=p-(p*x+m*_),i-=m-(p*w+m*S))):(D=g[6],L=g[7],k=g[8],P=g[9],R=g[10],z=g[11],r=g[12],i=g[13],o=g[14],c=(v=Gn(D,R))*Un,v&&(T=M*(y=Math.cos(-v))+k*(b=Math.sin(-v)),C=E*y+P*b,A=D*y+R*b,k=M*-b+k*y,P=E*-b+P*y,R=D*-b+R*y,z=L*-b+z*y,M=T,E=C,D=A),u=(v=Gn(-_,R))*Un,v&&(y=Math.cos(-v),z=S*(b=Math.sin(-v))+z*y,x=T=x*y-k*b,w=C=w*y-P*b,_=A=_*y-R*b),l=(v=Gn(w,x))*Un,v&&(T=x*(y=Math.cos(v))+w*(b=Math.sin(v)),C=M*y+E*b,w=w*y-x*b,E=E*y-M*b,x=T,M=C),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,u=180-u),a=Me(Math.sqrt(x*x+w*w+_*_)),s=Me(Math.sqrt(E*E+D*D)),v=Gn(M,E),d=Math.abs(v)>2e-4?v*Un:0,f=z?1/(z<0?-z:z):0),n.svg&&(T=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!Ar(cr(e,ar)),T&&e.setAttribute("transform",T))),Math.abs(d)>90&&Math.abs(d)<270&&(I?(a*=-1,d+=l<=0?180:-180,l+=l<=0?180:-180):(s*=-1,d+=d<=0?180:-180)),n.x=r-((n.xPercent=r&&(n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-r)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+"px",n.y=i-((n.yPercent=i&&(n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+"px",n.z=o+"px",n.scaleX=Me(a),n.scaleY=Me(s),n.rotation=Me(l)+"deg",n.rotationX=Me(c)+"deg",n.rotationY=Me(u)+"deg",n.skewX=d+"deg",n.skewY=h+"deg",n.transformPerspective=f+"px",(n.zOrigin=parseFloat(F.split(" ")[2])||0)&&(N[sr]=Or(F)),n.xOffset=n.yOffset=0,n.force3D=O.force3D,n.renderTransform=n.svg?Ir:wn?Nr:Dr,n.uncache=0,n},Or=function(e){return(e=e.split(" "))[0]+" "+e[1]},zr=function(e,t,n){var r=tt(t);return Me(parseFloat(t)+parseFloat(xr(e,"x",n+"px",r)))+r},Dr=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Nr(e,t)},Nr=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,o=n.x,a=n.y,s=n.z,l=n.rotation,c=n.rotationY,u=n.rotationX,d=n.skewX,h=n.skewY,f=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,v=n.target,y=n.zOrigin,b="",x="auto"===g&&e&&1!==e||!0===g;if(y&&("0deg"!==u||"0deg"!==c)){var w,_=parseFloat(c)*Hn,S=Math.sin(_),M=Math.cos(_);_=parseFloat(u)*Hn,w=Math.cos(_),o=zr(v,o,S*w*-y),a=zr(v,a,-Math.sin(_)*-y),s=zr(v,s,M*w*-y+y)}"0px"!==m&&(b+="perspective("+m+") "),(r||i)&&(b+="translate("+r+"%, "+i+"%) "),(x||"0px"!==o||"0px"!==a||"0px"!==s)&&(b+="0px"!==s||x?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+") "),"0deg"!==l&&(b+="rotate("+l+") "),"0deg"!==c&&(b+="rotateY("+c+") "),"0deg"!==u&&(b+="rotateX("+u+") "),"0deg"===d&&"0deg"===h||(b+="skew("+d+", "+h+") "),1===f&&1===p||(b+="scale("+f+", "+p+") "),v.style[ar]=b||"translate(0, 0)"},Ir=function(e,t){var n,r,i,o,a,s=t||this,l=s.xPercent,c=s.yPercent,u=s.x,d=s.y,h=s.rotation,f=s.skewX,p=s.skewY,m=s.scaleX,g=s.scaleY,v=s.target,y=s.xOrigin,b=s.yOrigin,x=s.xOffset,w=s.yOffset,_=s.forceCSS,S=parseFloat(u),M=parseFloat(d);h=parseFloat(h),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),h+=p),h||f?(h*=Hn,f*=Hn,n=Math.cos(h)*m,r=Math.sin(h)*m,i=Math.sin(h-f)*-g,o=Math.cos(h-f)*g,f&&(p*=Hn,a=Math.tan(f-p),i*=a=Math.sqrt(1+a*a),o*=a,p&&(a=Math.tan(p),n*=a=Math.sqrt(1+a*a),r*=a)),n=Me(n),r=Me(r),i=Me(i),o=Me(o)):(n=m,o=g,r=i=0),(S&&!~(u+"").indexOf("px")||M&&!~(d+"").indexOf("px"))&&(S=xr(v,"x",u,"px"),M=xr(v,"y",d,"px")),(y||b||x||w)&&(S=Me(S+y-(y*n+b*i)+x),M=Me(M+b-(y*r+b*o)+w)),(l||c)&&(a=v.getBBox(),S=Me(S+l/100*a.width),M=Me(M+c/100*a.height)),a="matrix("+n+","+r+","+i+","+o+","+S+","+M+")",v.setAttribute("transform",a),_&&(v.style[ar]=a)},Fr=function(e,t,n,r,i,o){var a,s,l=H(i),c=parseFloat(i)*(l&&~i.indexOf("rad")?Un:1),u=o?c*o:c-r,d=r+u+"deg";return l&&("short"===(a=i.split("_")[1])&&(u%=360)!==u%180&&(u+=u<0?360:-360),"cw"===a&&u<0?u=(u+36e9)%360-360*~~(u/360):"ccw"===a&&u>0&&(u=(u-36e9)%360-360*~~(u/360))),e._pt=s=new cn(e._pt,t,n,r,u,$n),s.e=d,s.u="deg",e._props.push(n),s},Br=function(e,t,n){var r,i,o,a,s,l,c,u=bn.style,d=n._gsap;for(i in u.cssText=getComputedStyle(n).cssText+";position:absolute;display:block;",u[ar]=t,mn.body.appendChild(bn),r=Lr(bn,1),jn)(o=d[i])!==(a=r[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(s=tt(o)!==(c=tt(a))?xr(n,i,o,c):parseFloat(o),l=parseFloat(a),e._pt=new cn(e._pt,d,i,s,l-s,Yn),e._pt.u=c||0,e._props.push(i));mn.body.removeChild(bn)};Se("padding,margin,Width,Radius",(function(e,t){var n="Top",r="Right",i="Bottom",o="Left",a=(t<3?[n,r,i,o]:[n+o,n+r,i+r,i+o]).map((function(n){return t<2?e+n:"border"+n+e}));Er[t>1?"border"+e:e]=function(e,t,n,r,i){var o,s;if(arguments.length<4)return o=a.map((function(t){return wr(e,t,n)})),5===(s=o.join(" ")).split(o[0]).length?o[0]:s;o=(r+"").split(" "),s={},a.forEach((function(e,t){return s[e]=o[t]=o[t]||o[(t-1)/2|0]})),e.init(t,s,i)}}));var jr,Ur,Hr={name:"css",register:hr,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,i){var o,a,s,l,c,u,d,h,f,p,m,g,v,y,b,x,w,_,S,M=this._props,E=e.style,T=n.vars.startAt;for(d in vn||hr(),t)if("autoRound"!==d&&(a=t[d],!me[d]||!Gt(d,t,n,r,e,i)))if(c=typeof a,u=Er[d],"function"===c&&(c=typeof(a=a.call(n,r,e,i))),"string"===c&&~a.indexOf("random(")&&(a=dt(a)),u)u(this,e,d,a,n)&&(b=1);else if("--"===d.substr(0,2))o=(getComputedStyle(e).getPropertyValue(d)+"").trim(),a+="",h=tt(o),(f=tt(a))?h!==f&&(o=xr(e,d,o,f)+f):h&&(a+=h),this.add(E,"setProperty",o,a,r,i,0,0,d);else if("undefined"!==c){if(T&&d in T?(o="function"==typeof T[d]?T[d].call(n,r,e,i):T[d],d in O.units&&!tt(o)&&(o+=O.units[d]),"="===(o+"").charAt(1)&&(o=wr(e,d))):o=wr(e,d),l=parseFloat(o),(p="string"===c&&"="===a.charAt(1)?+(a.charAt(0)+"1"):0)&&(a=a.substr(2)),s=parseFloat(a),d in Xn&&("autoAlpha"===d&&(1===l&&"hidden"===wr(e,"visibility")&&s&&(l=0),yr(this,E,"visibility",l?"inherit":"hidden",s?"inherit":"hidden",!s)),"scale"!==d&&"transform"!==d&&~(d=Xn[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in jn)if(g||((v=e._gsap).renderTransform&&!t.parseTransform||Lr(e,t.parseTransform),y=!1!==t.smoothOrigin&&v.smooth,(g=this._pt=new cn(this._pt,E,ar,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new cn(this._pt,v,"scaleY",v.scaleY,p?p*s:s-v.scaleY),M.push("scaleY",d),d+="X";else{if("transformOrigin"===d){w=void 0,_=void 0,S=void 0,_=(w=(x=a).split(" "))[0],S=w[1]||"50%","top"!==_&&"bottom"!==_&&"left"!==S&&"right"!==S||(x=_,_=S,S=x),w[0]=Sr[_]||_,w[1]=Sr[S]||S,a=w.join(" "),v.svg?Rr(e,a,0,y,0,this):((f=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&yr(this,v,"zOrigin",v.zOrigin,f),yr(this,E,d,Or(o),Or(a)));continue}if("svgOrigin"===d){Rr(e,a,1,y,0,this);continue}if(d in Cr){Fr(this,v,d,l,a,p);continue}if("smoothOrigin"===d){yr(this,v,"smooth",v.smooth,a);continue}if("force3D"===d){v[d]=a;continue}if("transform"===d){Br(this,a,e);continue}}else d in E||(d=dr(d)||d);if(m||(s||0===s)&&(l||0===l)&&!qn.test(a)&&d in E)s||(s=0),(h=(o+"").substr((l+"").length))!==(f=tt(a)||(d in O.units?O.units[d]:h))&&(l=xr(e,d,o,f)),this._pt=new cn(this._pt,m?v:E,d,l,p?p*s:s-l,m||"px"!==f&&"zIndex"!==d||!1===t.autoRound?Yn:Jn),this._pt.u=f||0,h!==f&&(this._pt.b=o,this._pt.r=Zn);else if(d in E)_r.call(this,e,d,o,a);else{if(!(d in e)){le(d,a);continue}this.add(e,d,e[d],a,r,i)}M.push(d)}b&&ln(this)},get:wr,aliases:Xn,getSetter:function(e,t,n){var r=Xn[t];return r&&r.indexOf(",")<0&&(t=r),t in jn&&t!==sr&&(e._gsap.x||wr(e,"x"))?n&&xn===n?"scale"===t?rr:nr:(xn=n||{})&&("scale"===t?ir:or):e.style&&!W(e.style[t])?er:~t.indexOf("-")?tr:Kt(e,t)},core:{_removeProperty:vr,_getMatrix:Pr}};fn.utils.checkPrefix=dr,Ur=Se("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+(jr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){jn[e]=1})),Se(jr,(function(e){O.units[e]="deg",Cr[e]=1})),Xn[Ur[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+jr,Se("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");Xn[t[1]]=Ur[t[0]]})),Se("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){O.units[e]="px"})),fn.registerPlugin(Hr);var Gr=fn.registerPlugin(Hr)||fn,Vr=Gr.core.Tween},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(6));else{var i=t.Zdog;i.PathCommand=r(i.Vector)}}(this,(function(e){function t(t,i,o){this.method=t,this.points=i.map(n),this.renderPoints=i.map(r),this.previousPoint=o,this.endRenderPoint=this.renderPoints[this.renderPoints.length-1],"arc"==t&&(this.controlPoints=[new e,new e])}function n(t){return t instanceof e?t:new e(t)}function r(t){return new e(t)}return t.prototype.reset=function(){var e=this.points;this.renderPoints.forEach((function(t,n){var r=e[n];t.set(r)}))},t.prototype.transform=function(e,t,n){this.renderPoints.forEach((function(r){r.transform(e,t,n)}))},t.prototype.render=function(e,t,n){return this[this.method](e,t,n)},t.prototype.move=function(e,t,n){return n.move(e,t,this.renderPoints[0])},t.prototype.line=function(e,t,n){return n.line(e,t,this.renderPoints[0])},t.prototype.bezier=function(e,t,n){var r=this.renderPoints[0],i=this.renderPoints[1],o=this.renderPoints[2];return n.bezier(e,t,r,i,o)},t.prototype.arc=function(e,t,n){var r=this.previousPoint,i=this.renderPoints[0],o=this.renderPoints[1],a=this.controlPoints[0],s=this.controlPoints[1];return a.set(r).lerp(i,9/16),s.set(o).lerp(i,9/16),n.bezier(e,t,a,s,o)},t}))},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(5));else{var i=t.Zdog;i.Ellipse=r(i.Shape)}}(this,(function(e){var t=e.subclass({diameter:1,width:void 0,height:void 0,quarters:4,closed:!1});return t.prototype.setPath=function(){var e=(null!=this.width?this.width:this.diameter)/2,t=(null!=this.height?this.height:this.diameter)/2;this.path=[{x:0,y:-t},{arc:[{x:e,y:-t},{x:e,y:0}]}],this.quarters>1&&this.path.push({arc:[{x:e,y:t},{x:0,y:t}]}),this.quarters>2&&this.path.push({arc:[{x:-e,y:t},{x:-e,y:0}]}),this.quarters>3&&this.path.push({arc:[{x:-e,y:-t},{x:0,y:-t}]})},t}))},function(e,t,n){"use strict";n.r(t),n.d(t,"ACESFilmicToneMapping",(function(){return ne})),n.d(t,"AddEquation",(function(){return E})),n.d(t,"AddOperation",(function(){return J})),n.d(t,"AdditiveAnimationBlendMode",(function(){return qt})),n.d(t,"AdditiveBlending",(function(){return w})),n.d(t,"AlphaFormat",(function(){return Ne})),n.d(t,"AlwaysDepth",(function(){return H})),n.d(t,"AlwaysStencilFunc",(function(){return Mn})),n.d(t,"AmbientLight",(function(){return Ld})),n.d(t,"AmbientLightProbe",(function(){return eh})),n.d(t,"AnimationClip",(function(){return Bu})),n.d(t,"AnimationLoader",(function(){return Xu})),n.d(t,"AnimationMixer",(function(){return Rh})),n.d(t,"AnimationObjectGroup",(function(){return kh})),n.d(t,"AnimationUtils",(function(){return Tu})),n.d(t,"ArcCurve",(function(){return td})),n.d(t,"ArrayCamera",(function(){return Ps})),n.d(t,"ArrowHelper",(function(){return wf})),n.d(t,"Audio",(function(){return dh})),n.d(t,"AudioAnalyser",(function(){return vh})),n.d(t,"AudioContext",(function(){return Jd})),n.d(t,"AudioListener",(function(){return uh})),n.d(t,"AudioLoader",(function(){return Qd})),n.d(t,"AxesHelper",(function(){return _f})),n.d(t,"AxisHelper",(function(){return bp})),n.d(t,"BackSide",(function(){return m})),n.d(t,"BasicDepthPacking",(function(){return on})),n.d(t,"BasicShadowMap",(function(){return u})),n.d(t,"BinaryTextureLoader",(function(){return Mp})),n.d(t,"Bone",(function(){return pl})),n.d(t,"BooleanKeyframeTrack",(function(){return Lu})),n.d(t,"BoundingBoxHelper",(function(){return xp})),n.d(t,"Box2",(function(){return Uh})),n.d(t,"Box3",(function(){return er})),n.d(t,"Box3Helper",(function(){return gf})),n.d(t,"BoxBufferGeometry",(function(){return mo})),n.d(t,"BoxGeometry",(function(){return Zl})),n.d(t,"BoxHelper",(function(){return mf})),n.d(t,"BufferAttribute",(function(){return Ei})),n.d(t,"BufferGeometry",(function(){return Xi})),n.d(t,"BufferGeometryLoader",(function(){return jd})),n.d(t,"ByteType",(function(){return Ee})),n.d(t,"Cache",(function(){return Uu})),n.d(t,"Camera",(function(){return xo})),n.d(t,"CameraHelper",(function(){return hf})),n.d(t,"CanvasRenderer",(function(){return Cp})),n.d(t,"CanvasTexture",(function(){return Gl})),n.d(t,"CatmullRomCurve3",(function(){return sd})),n.d(t,"CineonToneMapping",(function(){return te})),n.d(t,"CircleBufferGeometry",(function(){return Jl})),n.d(t,"CircleGeometry",(function(){return Ql})),n.d(t,"ClampToEdgeWrapping",(function(){return he})),n.d(t,"Clock",(function(){return ih})),n.d(t,"ClosedSplineCurve3",(function(){return gp})),n.d(t,"Color",(function(){return yi})),n.d(t,"ColorKeyframeTrack",(function(){return Ou})),n.d(t,"CompressedTexture",(function(){return Hl})),n.d(t,"CompressedTextureLoader",(function(){return Yu})),n.d(t,"ConeBufferGeometry",(function(){return nc})),n.d(t,"ConeGeometry",(function(){return tc})),n.d(t,"CubeCamera",(function(){return _o})),n.d(t,"CubeGeometry",(function(){return Zl})),n.d(t,"CubeReflectionMapping",(function(){return oe})),n.d(t,"CubeRefractionMapping",(function(){return ae})),n.d(t,"CubeTexture",(function(){return So})),n.d(t,"CubeTextureLoader",(function(){return Zu})),n.d(t,"CubeUVReflectionMapping",(function(){return ce})),n.d(t,"CubeUVRefractionMapping",(function(){return ue})),n.d(t,"CubicBezierCurve",(function(){return dd})),n.d(t,"CubicBezierCurve3",(function(){return hd})),n.d(t,"CubicInterpolant",(function(){return Au})),n.d(t,"CullFaceBack",(function(){return s})),n.d(t,"CullFaceFront",(function(){return l})),n.d(t,"CullFaceFrontBack",(function(){return c})),n.d(t,"CullFaceNone",(function(){return a})),n.d(t,"Curve",(function(){return Ku})),n.d(t,"CurvePath",(function(){return bd})),n.d(t,"CustomBlending",(function(){return M})),n.d(t,"CustomToneMapping",(function(){return re})),n.d(t,"CylinderBufferGeometry",(function(){return Kl})),n.d(t,"CylinderGeometry",(function(){return ec})),n.d(t,"Cylindrical",(function(){return Bh})),n.d(t,"DataTexture",(function(){return Eo})),n.d(t,"DataTexture2DArray",(function(){return $o})),n.d(t,"DataTexture3D",(function(){return Zo})),n.d(t,"DataTextureLoader",(function(){return Ju})),n.d(t,"DataUtils",(function(){return Ef})),n.d(t,"DecrementStencilOp",(function(){return fn})),n.d(t,"DecrementWrapStencilOp",(function(){return mn})),n.d(t,"DefaultLoadingManager",(function(){return Gu})),n.d(t,"DepthFormat",(function(){return He})),n.d(t,"DepthStencilFormat",(function(){return Ge})),n.d(t,"DepthTexture",(function(){return Vl})),n.d(t,"DirectionalLight",(function(){return Rd})),n.d(t,"DirectionalLightHelper",(function(){return cf})),n.d(t,"DiscreteInterpolant",(function(){return Pu})),n.d(t,"DodecahedronBufferGeometry",(function(){return ic})),n.d(t,"DodecahedronGeometry",(function(){return oc})),n.d(t,"DoubleSide",(function(){return g})),n.d(t,"DstAlphaFactor",(function(){return N})),n.d(t,"DstColorFactor",(function(){return F})),n.d(t,"DynamicBufferAttribute",(function(){return ap})),n.d(t,"DynamicCopyUsage",(function(){return Ln})),n.d(t,"DynamicDrawUsage",(function(){return Tn})),n.d(t,"DynamicReadUsage",(function(){return kn})),n.d(t,"EdgesGeometry",(function(){return uc})),n.d(t,"EdgesHelper",(function(){return wp})),n.d(t,"EllipseCurve",(function(){return ed})),n.d(t,"EqualDepth",(function(){return W})),n.d(t,"EqualStencilFunc",(function(){return bn})),n.d(t,"EquirectangularReflectionMapping",(function(){return se})),n.d(t,"EquirectangularRefractionMapping",(function(){return le})),n.d(t,"Euler",(function(){return Or})),n.d(t,"EventDispatcher",(function(){return Nn})),n.d(t,"ExtrudeBufferGeometry",(function(){return Fc})),n.d(t,"ExtrudeGeometry",(function(){return jc})),n.d(t,"Face3",(function(){return bi})),n.d(t,"Face4",(function(){return Wf})),n.d(t,"FaceColors",(function(){return $f})),n.d(t,"FileLoader",(function(){return qu})),n.d(t,"FlatShading",(function(){return v})),n.d(t,"Float16BufferAttribute",(function(){return Oi})),n.d(t,"Float32Attribute",(function(){return pp})),n.d(t,"Float32BufferAttribute",(function(){return zi})),n.d(t,"Float64Attribute",(function(){return mp})),n.d(t,"Float64BufferAttribute",(function(){return Di})),n.d(t,"FloatType",(function(){return Pe})),n.d(t,"Fog",(function(){return Fs})),n.d(t,"FogExp2",(function(){return Is})),n.d(t,"Font",(function(){return Xd})),n.d(t,"FontLoader",(function(){return $d})),n.d(t,"FrontSide",(function(){return p})),n.d(t,"Frustum",(function(){return Ao})),n.d(t,"GLBufferAttribute",(function(){return zh})),n.d(t,"GLSL1",(function(){return zn})),n.d(t,"GLSL3",(function(){return Dn})),n.d(t,"GammaEncoding",(function(){return Qt})),n.d(t,"Geometry",(function(){return $l})),n.d(t,"GeometryUtils",(function(){return Tp})),n.d(t,"GreaterDepth",(function(){return X})),n.d(t,"GreaterEqualDepth",(function(){return q})),n.d(t,"GreaterEqualStencilFunc",(function(){return Sn})),n.d(t,"GreaterStencilFunc",(function(){return wn})),n.d(t,"GridHelper",(function(){return rf})),n.d(t,"Group",(function(){return Rs})),n.d(t,"HalfFloatType",(function(){return Re})),n.d(t,"HemisphereLight",(function(){return Sd})),n.d(t,"HemisphereLightHelper",(function(){return nf})),n.d(t,"HemisphereLightProbe",(function(){return Kd})),n.d(t,"IcosahedronBufferGeometry",(function(){return Uc})),n.d(t,"IcosahedronGeometry",(function(){return Hc})),n.d(t,"ImageBitmapLoader",(function(){return Wd})),n.d(t,"ImageLoader",(function(){return $u})),n.d(t,"ImageUtils",(function(){return Gn})),n.d(t,"ImmediateRenderObject",(function(){return Wh})),n.d(t,"IncrementStencilOp",(function(){return hn})),n.d(t,"IncrementWrapStencilOp",(function(){return pn})),n.d(t,"InstancedBufferAttribute",(function(){return Bd})),n.d(t,"InstancedBufferGeometry",(function(){return Fd})),n.d(t,"InstancedInterleavedBuffer",(function(){return Oh})),n.d(t,"InstancedMesh",(function(){return _l})),n.d(t,"Int16Attribute",(function(){return up})),n.d(t,"Int16BufferAttribute",(function(){return ki})),n.d(t,"Int32Attribute",(function(){return hp})),n.d(t,"Int32BufferAttribute",(function(){return Ri})),n.d(t,"Int8Attribute",(function(){return sp})),n.d(t,"Int8BufferAttribute",(function(){return Ti})),n.d(t,"IntType",(function(){return Ae})),n.d(t,"InterleavedBuffer",(function(){return js})),n.d(t,"InterleavedBufferAttribute",(function(){return Hs})),n.d(t,"Interpolant",(function(){return Cu})),n.d(t,"InterpolateDiscrete",(function(){return Bt})),n.d(t,"InterpolateLinear",(function(){return jt})),n.d(t,"InterpolateSmooth",(function(){return Ut})),n.d(t,"InvertStencilOp",(function(){return gn})),n.d(t,"JSONLoader",(function(){return Ap})),n.d(t,"KeepStencilOp",(function(){return un})),n.d(t,"KeyframeTrack",(function(){return Ru})),n.d(t,"LOD",(function(){return sl})),n.d(t,"LatheBufferGeometry",(function(){return Gc})),n.d(t,"LatheGeometry",(function(){return Vc})),n.d(t,"Layers",(function(){return Nr})),n.d(t,"LensFlare",(function(){return Pp})),n.d(t,"LessDepth",(function(){return G})),n.d(t,"LessEqualDepth",(function(){return V})),n.d(t,"LessEqualStencilFunc",(function(){return xn})),n.d(t,"LessStencilFunc",(function(){return yn})),n.d(t,"Light",(function(){return _d})),n.d(t,"LightProbe",(function(){return Dd})),n.d(t,"Line",(function(){return kl})),n.d(t,"Line3",(function(){return Vh})),n.d(t,"LineBasicMaterial",(function(){return Sl})),n.d(t,"LineCurve",(function(){return fd})),n.d(t,"LineCurve3",(function(){return pd})),n.d(t,"LineDashedMaterial",(function(){return Mu})),n.d(t,"LineLoop",(function(){return Ol})),n.d(t,"LinePieces",(function(){return Xf})),n.d(t,"LineSegments",(function(){return Ll})),n.d(t,"LineStrip",(function(){return qf})),n.d(t,"LinearEncoding",(function(){return Zt})),n.d(t,"LinearFilter",(function(){return be})),n.d(t,"LinearInterpolant",(function(){return ku})),n.d(t,"LinearMipMapLinearFilter",(function(){return Se})),n.d(t,"LinearMipMapNearestFilter",(function(){return we})),n.d(t,"LinearMipmapLinearFilter",(function(){return _e})),n.d(t,"LinearMipmapNearestFilter",(function(){return xe})),n.d(t,"LinearToneMapping",(function(){return K})),n.d(t,"Loader",(function(){return Vu})),n.d(t,"LoaderUtils",(function(){return Id})),n.d(t,"LoadingManager",(function(){return Hu})),n.d(t,"LogLuvEncoding",(function(){return en})),n.d(t,"LoopOnce",(function(){return Nt})),n.d(t,"LoopPingPong",(function(){return Ft})),n.d(t,"LoopRepeat",(function(){return It})),n.d(t,"LuminanceAlphaFormat",(function(){return je})),n.d(t,"LuminanceFormat",(function(){return Be})),n.d(t,"MOUSE",(function(){return i})),n.d(t,"Material",(function(){return wi})),n.d(t,"MaterialLoader",(function(){return Nd})),n.d(t,"Math",(function(){return Bn})),n.d(t,"MathUtils",(function(){return Bn})),n.d(t,"Matrix3",(function(){return Un})),n.d(t,"Matrix4",(function(){return Er})),n.d(t,"MaxEquation",(function(){return k})),n.d(t,"Mesh",(function(){return ho})),n.d(t,"MeshBasicMaterial",(function(){return _i})),n.d(t,"MeshDepthMaterial",(function(){return Ms})),n.d(t,"MeshDistanceMaterial",(function(){return Es})),n.d(t,"MeshFaceMaterial",(function(){return Jf})),n.d(t,"MeshLambertMaterial",(function(){return _u})),n.d(t,"MeshMatcapMaterial",(function(){return Su})),n.d(t,"MeshNormalMaterial",(function(){return wu})),n.d(t,"MeshPhongMaterial",(function(){return bu})),n.d(t,"MeshPhysicalMaterial",(function(){return yu})),n.d(t,"MeshStandardMaterial",(function(){return vu})),n.d(t,"MeshToonMaterial",(function(){return xu})),n.d(t,"MinEquation",(function(){return A})),n.d(t,"MirroredRepeatWrapping",(function(){return fe})),n.d(t,"MixOperation",(function(){return Z})),n.d(t,"MultiMaterial",(function(){return Qf})),n.d(t,"MultiplyBlending",(function(){return S})),n.d(t,"MultiplyOperation",(function(){return $})),n.d(t,"NearestFilter",(function(){return pe})),n.d(t,"NearestMipMapLinearFilter",(function(){return ye})),n.d(t,"NearestMipMapNearestFilter",(function(){return ge})),n.d(t,"NearestMipmapLinearFilter",(function(){return ve})),n.d(t,"NearestMipmapNearestFilter",(function(){return me})),n.d(t,"NeverDepth",(function(){return U})),n.d(t,"NeverStencilFunc",(function(){return vn})),n.d(t,"NoBlending",(function(){return b})),n.d(t,"NoColors",(function(){return Yf})),n.d(t,"NoToneMapping",(function(){return Q})),n.d(t,"NormalAnimationBlendMode",(function(){return Wt})),n.d(t,"NormalBlending",(function(){return x})),n.d(t,"NotEqualDepth",(function(){return Y})),n.d(t,"NotEqualStencilFunc",(function(){return _n})),n.d(t,"NumberKeyframeTrack",(function(){return zu})),n.d(t,"Object3D",(function(){return Zr})),n.d(t,"ObjectLoader",(function(){return Ud})),n.d(t,"ObjectSpaceNormalMap",(function(){return ln})),n.d(t,"OctahedronBufferGeometry",(function(){return Wc})),n.d(t,"OctahedronGeometry",(function(){return qc})),n.d(t,"OneFactor",(function(){return R})),n.d(t,"OneMinusDstAlphaFactor",(function(){return I})),n.d(t,"OneMinusDstColorFactor",(function(){return B})),n.d(t,"OneMinusSrcAlphaFactor",(function(){return D})),n.d(t,"OneMinusSrcColorFactor",(function(){return O})),n.d(t,"OrthographicCamera",(function(){return kd})),n.d(t,"PCFShadowMap",(function(){return d})),n.d(t,"PCFSoftShadowMap",(function(){return h})),n.d(t,"PMREMGenerator",(function(){return Bf})),n.d(t,"ParametricBufferGeometry",(function(){return Xc})),n.d(t,"ParametricGeometry",(function(){return Yc})),n.d(t,"Particle",(function(){return ep})),n.d(t,"ParticleBasicMaterial",(function(){return rp})),n.d(t,"ParticleSystem",(function(){return tp})),n.d(t,"ParticleSystemMaterial",(function(){return ip})),n.d(t,"Path",(function(){return xd})),n.d(t,"PerspectiveCamera",(function(){return wo})),n.d(t,"Plane",(function(){return ei})),n.d(t,"PlaneBufferGeometry",(function(){return Ro})),n.d(t,"PlaneGeometry",(function(){return $c})),n.d(t,"PlaneHelper",(function(){return vf})),n.d(t,"PointCloud",(function(){return Kf})),n.d(t,"PointCloudMaterial",(function(){return np})),n.d(t,"PointLight",(function(){return Ad})),n.d(t,"PointLightHelper",(function(){return Qh})),n.d(t,"Points",(function(){return Bl})),n.d(t,"PointsMaterial",(function(){return zl})),n.d(t,"PolarGridHelper",(function(){return of})),n.d(t,"PolyhedronBufferGeometry",(function(){return rc})),n.d(t,"PolyhedronGeometry",(function(){return Zc})),n.d(t,"PositionalAudio",(function(){return gh})),n.d(t,"PropertyBinding",(function(){return Ah})),n.d(t,"PropertyMixer",(function(){return yh})),n.d(t,"QuadraticBezierCurve",(function(){return md})),n.d(t,"QuadraticBezierCurve3",(function(){return gd})),n.d(t,"Quaternion",(function(){return Zn})),n.d(t,"QuaternionKeyframeTrack",(function(){return Nu})),n.d(t,"QuaternionLinearInterpolant",(function(){return Du})),n.d(t,"REVISION",(function(){return r})),n.d(t,"RGBADepthPacking",(function(){return an})),n.d(t,"RGBAFormat",(function(){return Fe})),n.d(t,"RGBAIntegerFormat",(function(){return $e})),n.d(t,"RGBA_ASTC_10x10_Format",(function(){return yt})),n.d(t,"RGBA_ASTC_10x5_Format",(function(){return mt})),n.d(t,"RGBA_ASTC_10x6_Format",(function(){return gt})),n.d(t,"RGBA_ASTC_10x8_Format",(function(){return vt})),n.d(t,"RGBA_ASTC_12x10_Format",(function(){return bt})),n.d(t,"RGBA_ASTC_12x12_Format",(function(){return xt})),n.d(t,"RGBA_ASTC_4x4_Format",(function(){return st})),n.d(t,"RGBA_ASTC_5x4_Format",(function(){return lt})),n.d(t,"RGBA_ASTC_5x5_Format",(function(){return ct})),n.d(t,"RGBA_ASTC_6x5_Format",(function(){return ut})),n.d(t,"RGBA_ASTC_6x6_Format",(function(){return dt})),n.d(t,"RGBA_ASTC_8x5_Format",(function(){return ht})),n.d(t,"RGBA_ASTC_8x6_Format",(function(){return ft})),n.d(t,"RGBA_ASTC_8x8_Format",(function(){return pt})),n.d(t,"RGBA_BPTC_Format",(function(){return wt})),n.d(t,"RGBA_ETC2_EAC_Format",(function(){return at})),n.d(t,"RGBA_PVRTC_2BPPV1_Format",(function(){return rt})),n.d(t,"RGBA_PVRTC_4BPPV1_Format",(function(){return nt})),n.d(t,"RGBA_S3TC_DXT1_Format",(function(){return Je})),n.d(t,"RGBA_S3TC_DXT3_Format",(function(){return Qe})),n.d(t,"RGBA_S3TC_DXT5_Format",(function(){return Ke})),n.d(t,"RGBDEncoding",(function(){return rn})),n.d(t,"RGBEEncoding",(function(){return Kt})),n.d(t,"RGBEFormat",(function(){return Ue})),n.d(t,"RGBFormat",(function(){return Ie})),n.d(t,"RGBIntegerFormat",(function(){return Ye})),n.d(t,"RGBM16Encoding",(function(){return nn})),n.d(t,"RGBM7Encoding",(function(){return tn})),n.d(t,"RGB_ETC1_Format",(function(){return it})),n.d(t,"RGB_ETC2_Format",(function(){return ot})),n.d(t,"RGB_PVRTC_2BPPV1_Format",(function(){return tt})),n.d(t,"RGB_PVRTC_4BPPV1_Format",(function(){return et})),n.d(t,"RGB_S3TC_DXT1_Format",(function(){return Ze})),n.d(t,"RGFormat",(function(){return qe})),n.d(t,"RGIntegerFormat",(function(){return Xe})),n.d(t,"RawShaderMaterial",(function(){return gu})),n.d(t,"Ray",(function(){return Mr})),n.d(t,"Raycaster",(function(){return Dh})),n.d(t,"RectAreaLight",(function(){return Od})),n.d(t,"RedFormat",(function(){return Ve})),n.d(t,"RedIntegerFormat",(function(){return We})),n.d(t,"ReinhardToneMapping",(function(){return ee})),n.d(t,"RepeatWrapping",(function(){return de})),n.d(t,"ReplaceStencilOp",(function(){return dn})),n.d(t,"ReverseSubtractEquation",(function(){return C})),n.d(t,"RingBufferGeometry",(function(){return Jc})),n.d(t,"RingGeometry",(function(){return Qc})),n.d(t,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return Ot})),n.d(t,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Pt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Rt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return Lt})),n.d(t,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return zt})),n.d(t,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return Dt})),n.d(t,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return _t})),n.d(t,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return St})),n.d(t,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Mt})),n.d(t,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Et})),n.d(t,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Tt})),n.d(t,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return Ct})),n.d(t,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return At})),n.d(t,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return kt})),n.d(t,"Scene",(function(){return Bs})),n.d(t,"SceneUtils",(function(){return kp})),n.d(t,"ShaderChunk",(function(){return Lo})),n.d(t,"ShaderLib",(function(){return zo})),n.d(t,"ShaderMaterial",(function(){return bo})),n.d(t,"ShadowMaterial",(function(){return mu})),n.d(t,"Shape",(function(){return wd})),n.d(t,"ShapeBufferGeometry",(function(){return Kc})),n.d(t,"ShapeGeometry",(function(){return eu})),n.d(t,"ShapePath",(function(){return qd})),n.d(t,"ShapeUtils",(function(){return Dc})),n.d(t,"ShortType",(function(){return Te})),n.d(t,"Skeleton",(function(){return vl})),n.d(t,"SkeletonHelper",(function(){return Jh})),n.d(t,"SkinnedMesh",(function(){return fl})),n.d(t,"SmoothShading",(function(){return y})),n.d(t,"Sphere",(function(){return gr})),n.d(t,"SphereBufferGeometry",(function(){return tu})),n.d(t,"SphereGeometry",(function(){return nu})),n.d(t,"Spherical",(function(){return Fh})),n.d(t,"SphericalHarmonics3",(function(){return zd})),n.d(t,"Spline",(function(){return yp})),n.d(t,"SplineCurve",(function(){return vd})),n.d(t,"SplineCurve3",(function(){return vp})),n.d(t,"SpotLight",(function(){return Td})),n.d(t,"SpotLightHelper",(function(){return Xh})),n.d(t,"Sprite",(function(){return rl})),n.d(t,"SpriteMaterial",(function(){return Gs})),n.d(t,"SrcAlphaFactor",(function(){return z})),n.d(t,"SrcAlphaSaturateFactor",(function(){return j})),n.d(t,"SrcColorFactor",(function(){return L})),n.d(t,"StaticCopyUsage",(function(){return Rn})),n.d(t,"StaticDrawUsage",(function(){return En})),n.d(t,"StaticReadUsage",(function(){return An})),n.d(t,"StereoCamera",(function(){return rh})),n.d(t,"StreamCopyUsage",(function(){return On})),n.d(t,"StreamDrawUsage",(function(){return Cn})),n.d(t,"StreamReadUsage",(function(){return Pn})),n.d(t,"StringKeyframeTrack",(function(){return Iu})),n.d(t,"SubtractEquation",(function(){return T})),n.d(t,"SubtractiveBlending",(function(){return _})),n.d(t,"TOUCH",(function(){return o})),n.d(t,"TangentSpaceNormalMap",(function(){return sn})),n.d(t,"TetrahedronBufferGeometry",(function(){return ru})),n.d(t,"TetrahedronGeometry",(function(){return iu})),n.d(t,"TextBufferGeometry",(function(){return ou})),n.d(t,"TextGeometry",(function(){return au})),n.d(t,"Texture",(function(){return Wn})),n.d(t,"TextureLoader",(function(){return Qu})),n.d(t,"TorusBufferGeometry",(function(){return su})),n.d(t,"TorusGeometry",(function(){return lu})),n.d(t,"TorusKnotBufferGeometry",(function(){return cu})),n.d(t,"TorusKnotGeometry",(function(){return uu})),n.d(t,"Triangle",(function(){return di})),n.d(t,"TriangleFanDrawMode",(function(){return $t})),n.d(t,"TriangleStripDrawMode",(function(){return Yt})),n.d(t,"TrianglesDrawMode",(function(){return Xt})),n.d(t,"TubeBufferGeometry",(function(){return du})),n.d(t,"TubeGeometry",(function(){return hu})),n.d(t,"UVMapping",(function(){return ie})),n.d(t,"Uint16Attribute",(function(){return dp})),n.d(t,"Uint16BufferAttribute",(function(){return Pi})),n.d(t,"Uint32Attribute",(function(){return fp})),n.d(t,"Uint32BufferAttribute",(function(){return Li})),n.d(t,"Uint8Attribute",(function(){return lp})),n.d(t,"Uint8BufferAttribute",(function(){return Ci})),n.d(t,"Uint8ClampedAttribute",(function(){return cp})),n.d(t,"Uint8ClampedBufferAttribute",(function(){return Ai})),n.d(t,"Uniform",(function(){return Lh})),n.d(t,"UniformsLib",(function(){return Oo})),n.d(t,"UniformsUtils",(function(){return yo})),n.d(t,"UnsignedByteType",(function(){return Me})),n.d(t,"UnsignedInt248Type",(function(){return De})),n.d(t,"UnsignedIntType",(function(){return ke})),n.d(t,"UnsignedShort4444Type",(function(){return Le})),n.d(t,"UnsignedShort5551Type",(function(){return Oe})),n.d(t,"UnsignedShort565Type",(function(){return ze})),n.d(t,"UnsignedShortType",(function(){return Ce})),n.d(t,"VSMShadowMap",(function(){return f})),n.d(t,"Vector2",(function(){return jn})),n.d(t,"Vector3",(function(){return Jn})),n.d(t,"Vector4",(function(){return Xn})),n.d(t,"VectorKeyframeTrack",(function(){return Fu})),n.d(t,"Vertex",(function(){return op})),n.d(t,"VertexColors",(function(){return Zf})),n.d(t,"VideoTexture",(function(){return Ul})),n.d(t,"WebGL1Renderer",(function(){return Ns})),n.d(t,"WebGLCubeRenderTarget",(function(){return Mo})),n.d(t,"WebGLMultisampleRenderTarget",(function(){return $n})),n.d(t,"WebGLRenderTarget",(function(){return Yn})),n.d(t,"WebGLRenderTargetCube",(function(){return Ep})),n.d(t,"WebGLRenderer",(function(){return Ds})),n.d(t,"WebGLUtils",(function(){return ks})),n.d(t,"WireframeGeometry",(function(){return fu})),n.d(t,"WireframeHelper",(function(){return _p})),n.d(t,"WrapAroundEnding",(function(){return Vt})),n.d(t,"XHRLoader",(function(){return Sp})),n.d(t,"ZeroCurvatureEnding",(function(){return Ht})),n.d(t,"ZeroFactor",(function(){return P})),n.d(t,"ZeroSlopeEnding",(function(){return Gt})),n.d(t,"ZeroStencilOp",(function(){return cn})),n.d(t,"sRGBEncoding",(function(){return Jt}));const r="124",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},a=0,s=1,l=2,c=3,u=0,d=1,h=2,f=3,p=0,m=1,g=2,v=1,y=2,b=0,x=1,w=2,_=3,S=4,M=5,E=100,T=101,C=102,A=103,k=104,P=200,R=201,L=202,O=203,z=204,D=205,N=206,I=207,F=208,B=209,j=210,U=0,H=1,G=2,V=3,W=4,q=5,X=6,Y=7,$=0,Z=1,J=2,Q=0,K=1,ee=2,te=3,ne=4,re=5,ie=300,oe=301,ae=302,se=303,le=304,ce=306,ue=307,de=1e3,he=1001,fe=1002,pe=1003,me=1004,ge=1004,ve=1005,ye=1005,be=1006,xe=1007,we=1007,_e=1008,Se=1008,Me=1009,Ee=1010,Te=1011,Ce=1012,Ae=1013,ke=1014,Pe=1015,Re=1016,Le=1017,Oe=1018,ze=1019,De=1020,Ne=1021,Ie=1022,Fe=1023,Be=1024,je=1025,Ue=Fe,He=1026,Ge=1027,Ve=1028,We=1029,qe=1030,Xe=1031,Ye=1032,$e=1033,Ze=33776,Je=33777,Qe=33778,Ke=33779,et=35840,tt=35841,nt=35842,rt=35843,it=36196,ot=37492,at=37496,st=37808,lt=37809,ct=37810,ut=37811,dt=37812,ht=37813,ft=37814,pt=37815,mt=37816,gt=37817,vt=37818,yt=37819,bt=37820,xt=37821,wt=36492,_t=37840,St=37841,Mt=37842,Et=37843,Tt=37844,Ct=37845,At=37846,kt=37847,Pt=37848,Rt=37849,Lt=37850,Ot=37851,zt=37852,Dt=37853,Nt=2200,It=2201,Ft=2202,Bt=2300,jt=2301,Ut=2302,Ht=2400,Gt=2401,Vt=2402,Wt=2500,qt=2501,Xt=0,Yt=1,$t=2,Zt=3e3,Jt=3001,Qt=3007,Kt=3002,en=3003,tn=3004,nn=3005,rn=3006,on=3200,an=3201,sn=0,ln=1,cn=0,un=7680,dn=7681,hn=7682,fn=7683,pn=34055,mn=34056,gn=5386,vn=512,yn=513,bn=514,xn=515,wn=516,_n=517,Sn=518,Mn=519,En=35044,Tn=35048,Cn=35040,An=35045,kn=35049,Pn=35041,Rn=35046,Ln=35050,On=35042,zn="100",Dn="300 es";function Nn(){}Object.assign(Nn.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}},dispatchEvent:function(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t>8&255]+In[e>>16&255]+In[e>>24&255]+"-"+In[255&t]+In[t>>8&255]+"-"+In[t>>16&15|64]+In[t>>24&255]+"-"+In[63&n|128]+In[n>>8&255]+"-"+In[n>>16&255]+In[n>>24&255]+In[255&r]+In[r>>8&255]+In[r>>16&255]+In[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(Fn=e%2147483647),Fn=16807*Fn%2147483647,(Fn-1)/2147483646},degToRad:function(e){return e*Bn.DEG2RAD},radToDeg:function(e){return e*Bn.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((t+r)/2),u=a((t+r)/2),d=o((t-r)/2),h=a((t-r)/2),f=o((r-t)/2),p=a((r-t)/2);switch(i){case"XYX":e.set(s*u,l*d,l*h,s*c);break;case"YZY":e.set(l*h,s*u,l*d,s*c);break;case"ZXZ":e.set(l*d,l*h,s*u,s*c);break;case"XZX":e.set(s*u,l*p,l*f,s*c);break;case"YXY":e.set(l*f,s*u,l*p,s*c);break;case"ZYZ":e.set(l*p,l*f,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};class jn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class Un{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,o,a,s,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],c=n[4],u=n[7],d=n[2],h=n[5],f=n[8],p=r[0],m=r[3],g=r[6],v=r[1],y=r[4],b=r[7],x=r[2],w=r[5],_=r[8];return i[0]=o*p+a*v+s*x,i[3]=o*m+a*y+s*w,i[6]=o*g+a*b+s*_,i[1]=l*p+c*v+u*x,i[4]=l*m+c*y+u*w,i[7]=l*g+c*b+u*_,i[2]=d*p+h*v+f*x,i[5]=d*m+h*y+f*w,i[8]=d*g+h*b+f*_,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*o*c-t*a*l-n*i*c+n*a*s+r*i*l-r*o*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=c*o-a*l,d=a*s-c*i,h=l*i-o*s,f=t*u+n*d+r*h;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return e[0]=u*p,e[1]=(r*l-c*n)*p,e[2]=(a*n-r*o)*p,e[3]=d*p,e[4]=(c*t-r*s)*p,e[5]=(r*i-a*t)*p,e[6]=h*p,e[7]=(n*s-l*t)*p,e[8]=(o*t-n*i)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).copy(this).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,o,a){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*o+l*a)+o+e,-r*l,r*s,-r*(-l*o+s*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*l,r[6]=t*a+n*c,r[1]=-n*i+t*s,r[4]=-n*o+t*l,r[7]=-n*a+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}let Hn;const Gn={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Hn&&(Hn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Hn.width=e.width,Hn.height=e.height;const n=Hn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Hn}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};let Vn=0;function Wn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wn.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wn.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:he,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:he,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:be,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:_e,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Fe,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Me,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Zt;Object.defineProperty(this,"id",{value:Vn++}),this.uuid=Bn.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=s,this.offset=new jn(0,0),this.repeat=new jn(1,1),this.center=new jn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Un,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}function qn(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Gn.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Wn.DEFAULT_IMAGE=void 0,Wn.DEFAULT_MAPPING=ie,Wn.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Wn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,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};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=Bn.generateUUID()),!t&&void 0===e.images[r.uuid]){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e1)switch(this.wrapS){case de:e.x=e.x-Math.floor(e.x);break;case he:e.x=e.x<0?0:1;break;case fe:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case de:e.y=e.y-Math.floor(e.y);break;case he:e.y=e.y<0?0:1;break;case fe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Wn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});class Xn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const o=e.elements,a=o[0],s=o[4],l=o[8],c=o[1],u=o[5],d=o[9],h=o[2],f=o[6],p=o[10];if(Math.abs(s-c)<.01&&Math.abs(l-h)<.01&&Math.abs(d-f)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+h)<.1&&Math.abs(d+f)<.1&&Math.abs(a+u+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(a+1)/2,o=(u+1)/2,m=(p+1)/2,g=(s+c)/4,v=(l+h)/4,y=(d+f)/4;return e>o&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=g/n,i=v/n):o>m?o<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=g/r,i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(m),n=v/i,r=y/i),this.set(n,r,i,t),this}let m=Math.sqrt((f-d)*(f-d)+(l-h)*(l-h)+(c-s)*(c-s));return Math.abs(m)<.001&&(m=1),this.x=(f-d)/m,this.y=(l-h)/m,this.z=(c-s)/m,this.w=Math.acos((a+u+p-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}function Yn(e,t,n){this.width=e,this.height=t,this.scissor=new Xn(0,0,e,t),this.scissorTest=!1,this.viewport=new Xn(0,0,e,t),n=n||{},this.texture=new Wn(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:be,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}function $n(e,t,n){Yn.call(this,e,t,n),this.samples=4}Yn.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Yn,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),$n.prototype=Object.assign(Object.create(Yn.prototype),{constructor:$n,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Yn.prototype.copy.call(this,e),this.samples=e.samples,this}});class Zn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return n.copy(e).slerp(t,r)}static slerpFlat(e,t,n,r,i,o,a){let s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const d=i[o+0],h=i[o+1],f=i[o+2],p=i[o+3];if(u!==p||s!==d||l!==h||c!==f){let e=1-a;const t=s*d+l*h+c*f+u*p,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,t*n);e=Math.sin(e*o)/i,a=Math.sin(a*o)/i}const i=a*n;if(s=s*e+d*i,l=l*e+h*i,c=c*e+f*i,u=u*e+p*i,e===1-a){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,o){const a=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[o],d=i[o+1],h=i[o+2],f=i[o+3];return e[t]=a*f+c*u+s*h-l*d,e[t+1]=s*f+c*d+l*u-a*h,e[t+2]=l*f+c*h+a*d-s*u,e[t+3]=c*f-a*u-s*d-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,l=a(n/2),c=a(r/2),u=a(i/2),d=s(n/2),h=s(r/2),f=s(i/2);switch(o){case"XYZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"YXZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"ZXY":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"ZYX":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"YZX":this._x=d*c*u+l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u-d*h*f;break;case"XZY":this._x=d*c*u-l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u+d*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],l=t[2],c=t[6],u=t[10],d=n+a+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-s)*e,this._y=(i-l)*e,this._z=(o-r)*e}else if(n>a&&n>u){const e=2*Math.sqrt(1+n-a-u);this._w=(c-s)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(i+l)/e}else if(a>u){const e=2*Math.sqrt(1+a-n-u);this._w=(i-l)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-a);this._w=(o-r)/e,this._x=(i+l)/e,this._y=(s+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Bn.clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+o*a+r*l-i*s,this._y=r*c+o*s+i*a-n*l,this._z=i*c+o*l+n*s-r*a,this._w=o*c-n*a-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,o=this._w;let a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;const s=1-a*a;if(s<=Number.EPSILON){const e=1-t;return this._w=e*o+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(s),c=Math.atan2(l,a),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=o*u+this._w*d,this._x=n*u+this._x*d,this._y=r*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}class Jn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Kn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Kn.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,l=s*t+o*r-a*n,c=s*n+a*t-i*r,u=s*r+i*n-o*t,d=-i*t-o*n-a*r;return this.x=l*s+d*-i+c*-a-u*-o,this.y=c*s+d*-o+u*-i-l*-a,this.z=u*s+d*-a+l*-o-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Qn.copy(this).projectOnVector(e),this.sub(Qn)}reflect(e){return this.sub(Qn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Bn.clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const Qn=new Jn,Kn=new Zn;class er{constructor(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Jn(1/0,1/0,1/0),this.max=void 0!==t?t:new Jn(-1/0,-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,l=e.length;si&&(i=l),c>o&&(o=c),u>a&&(a=u)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,l=e.count;si&&(i=l),c>o&&(o=c),u>a&&(a=u)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Jn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,rr),rr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(dr),hr.subVectors(this.max,dr),or.subVectors(e.a,dr),ar.subVectors(e.b,dr),sr.subVectors(e.c,dr),lr.subVectors(ar,or),cr.subVectors(sr,ar),ur.subVectors(or,sr);let t=[0,-lr.z,lr.y,0,-cr.z,cr.y,0,-ur.z,ur.y,lr.z,0,-lr.x,cr.z,0,-cr.x,ur.z,0,-ur.x,-lr.y,lr.x,0,-cr.y,cr.x,0,-ur.y,ur.x,0];return!!tr(t,or,ar,sr,hr)&&(t=[1,0,0,0,1,0,0,0,1],!!tr(t,or,ar,sr,hr)&&(fr.crossVectors(lr,cr),t=[fr.x,fr.y,fr.z],tr(t,or,ar,sr,hr)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Jn),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return rr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(rr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(nr)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function tr(e,t,n,r,i){for(let o=0,a=e.length-3;o<=a;o+=3){pr.fromArray(e,o);const a=i.x*Math.abs(pr.x)+i.y*Math.abs(pr.y)+i.z*Math.abs(pr.z),s=t.dot(pr),l=n.dot(pr),c=r.dot(pr);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>a)return!1}return!0}const nr=[new Jn,new Jn,new Jn,new Jn,new Jn,new Jn,new Jn,new Jn],rr=new Jn,ir=new er,or=new Jn,ar=new Jn,sr=new Jn,lr=new Jn,cr=new Jn,ur=new Jn,dr=new Jn,hr=new Jn,fr=new Jn,pr=new Jn,mr=new er;class gr{constructor(e,t){this.center=void 0!==e?e:new Jn,this.radius=void 0!==t?t:-1}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):mr.setFromPoints(e).getCenter(n);let r=0;for(let i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new er),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}}const vr=new Jn,yr=new Jn,br=new Jn,xr=new Jn,wr=new Jn,_r=new Jn,Sr=new Jn;class Mr{constructor(e,t){this.origin=void 0!==e?e:new Jn,this.direction=void 0!==t?t:new Jn(0,0,-1)}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Jn),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,vr)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Jn),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=vr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(vr.copy(this.direction).multiplyScalar(t).add(this.origin),vr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){yr.copy(e).add(t).multiplyScalar(.5),br.copy(t).sub(e).normalize(),xr.copy(this.origin).sub(yr);const i=.5*e.distanceTo(t),o=-this.direction.dot(br),a=xr.dot(this.direction),s=-xr.dot(br),l=xr.lengthSq(),c=Math.abs(1-o*o);let u,d,h,f;if(c>0)if(u=o*s-a,d=o*a-s,f=i*c,u>=0)if(d>=-f)if(d<=f){const e=1/c;u*=e,d*=e,h=u*(u+o*d+2*a)+d*(o*u+d+2*s)+l}else d=i,u=Math.max(0,-(o*d+a)),h=-u*u+d*(d+2*s)+l;else d=-i,u=Math.max(0,-(o*d+a)),h=-u*u+d*(d+2*s)+l;else d<=-f?(u=Math.max(0,-(-o*i+a)),d=u>0?-i:Math.min(Math.max(-i,-s),i),h=-u*u+d*(d+2*s)+l):d<=f?(u=0,d=Math.min(Math.max(-i,-s),i),h=d*(d+2*s)+l):(u=Math.max(0,-(o*i+a)),d=u>0?i:Math.min(Math.max(-i,-s),i),h=-u*u+d*(d+2*s)+l);else d=o>0?-i:i,u=Math.max(0,-(o*d+a)),h=-u*u+d*(d+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(br).multiplyScalar(d).add(yr),h}intersectSphere(e,t){vr.subVectors(e.center,this.origin);const n=vr.dot(this.direction),r=vr.dot(vr)-n*n,i=e.radius*e.radius;if(r>i)return null;const o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,o,a,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,r=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,r=(e.min.x-d.x)*l),c>=0?(i=(e.min.y-d.y)*c,o=(e.max.y-d.y)*c):(i=(e.max.y-d.y)*c,o=(e.min.y-d.y)*c),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(a=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,vr)}intersectTriangle(e,t,n,r,i){wr.subVectors(t,e),_r.subVectors(n,e),Sr.crossVectors(wr,_r);let o,a=this.direction.dot(Sr);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}xr.subVectors(this.origin,e);const s=o*this.direction.dot(_r.crossVectors(xr,_r));if(s<0)return null;const l=o*this.direction.dot(wr.cross(xr));if(l<0)return null;if(s+l>a)return null;const c=-o*xr.dot(Sr);return c<0?null:this.at(c/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}class Er{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,o,a,s,l,c,u,d,h,f,p,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=h,g[7]=f,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Er).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Tr.setFromMatrixColumn(e,0).length(),i=1/Tr.setFromMatrixColumn(e,1).length(),o=1/Tr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=o*c,n=o*u,r=a*c,i=a*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-a*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=o*s}else if("YXZ"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e+i*a,t[4]=r*a-n,t[8]=o*l,t[1]=o*u,t[5]=o*c,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=o*s}else if("ZXY"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e-i*a,t[4]=-o*u,t[8]=r+n*a,t[1]=n+r*a,t[5]=o*c,t[9]=i-e*a,t[2]=-o*l,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){const e=o*c,n=o*u,r=a*c,i=a*u;t[0]=s*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){const e=o*s,n=o*l,r=a*s,i=a*l;t[0]=s*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=o*c,t[9]=-a*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=o*s,n=o*l,r=a*s,i=a*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=o*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=a*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Ar,e,kr)}lookAt(e,t,n){const r=this.elements;return Lr.subVectors(e,t),0===Lr.lengthSq()&&(Lr.z=1),Lr.normalize(),Pr.crossVectors(n,Lr),0===Pr.lengthSq()&&(1===Math.abs(n.z)?Lr.x+=1e-4:Lr.z+=1e-4,Lr.normalize(),Pr.crossVectors(n,Lr)),Pr.normalize(),Rr.crossVectors(Lr,Pr),r[0]=Pr.x,r[4]=Rr.x,r[8]=Lr.x,r[1]=Pr.y,r[5]=Rr.y,r[9]=Lr.y,r[2]=Pr.z,r[6]=Rr.z,r[10]=Lr.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],c=n[1],u=n[5],d=n[9],h=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],x=n[15],w=r[0],_=r[4],S=r[8],M=r[12],E=r[1],T=r[5],C=r[9],A=r[13],k=r[2],P=r[6],R=r[10],L=r[14],O=r[3],z=r[7],D=r[11],N=r[15];return i[0]=o*w+a*E+s*k+l*O,i[4]=o*_+a*T+s*P+l*z,i[8]=o*S+a*C+s*R+l*D,i[12]=o*M+a*A+s*L+l*N,i[1]=c*w+u*E+d*k+h*O,i[5]=c*_+u*T+d*P+h*z,i[9]=c*S+u*C+d*R+h*D,i[13]=c*M+u*A+d*L+h*N,i[2]=f*w+p*E+m*k+g*O,i[6]=f*_+p*T+m*P+g*z,i[10]=f*S+p*C+m*R+g*D,i[14]=f*M+p*A+m*L+g*N,i[3]=v*w+y*E+b*k+x*O,i[7]=v*_+y*T+b*P+x*z,i[11]=v*S+y*C+b*R+x*D,i[15]=v*M+y*A+b*L+x*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],l=e[13],c=e[2],u=e[6],d=e[10],h=e[14];return e[3]*(+i*s*u-r*l*u-i*a*d+n*l*d+r*a*h-n*s*h)+e[7]*(+t*s*h-t*l*d+i*o*d-r*o*h+r*l*c-i*s*c)+e[11]*(+t*l*u-t*a*h-i*o*u+n*o*h+i*a*c-n*l*c)+e[15]*(-r*a*c-t*s*u+t*a*d+r*o*u-n*o*d+n*s*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=u*m*l-p*d*l+p*s*h-a*m*h-u*s*g+a*d*g,y=f*d*l-c*m*l-f*s*h+o*m*h+c*s*g-o*d*g,b=c*p*l-f*u*l+f*a*h-o*p*h-c*a*g+o*u*g,x=f*u*s-c*p*s-f*a*d+o*p*d+c*a*m-o*u*m,w=t*v+n*y+r*b+i*x;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/w;return e[0]=v*_,e[1]=(p*d*i-u*m*i-p*r*h+n*m*h+u*r*g-n*d*g)*_,e[2]=(a*m*i-p*s*i+p*r*l-n*m*l-a*r*g+n*s*g)*_,e[3]=(u*s*i-a*d*i-u*r*l+n*d*l+a*r*h-n*s*h)*_,e[4]=y*_,e[5]=(c*m*i-f*d*i+f*r*h-t*m*h-c*r*g+t*d*g)*_,e[6]=(f*s*i-o*m*i-f*r*l+t*m*l+o*r*g-t*s*g)*_,e[7]=(o*d*i-c*s*i+c*r*l-t*d*l-o*r*h+t*s*h)*_,e[8]=b*_,e[9]=(f*u*i-c*p*i-f*n*h+t*p*h+c*n*g-t*u*g)*_,e[10]=(o*p*i-f*a*i+f*n*l-t*p*l-o*n*g+t*a*g)*_,e[11]=(c*a*i-o*u*i-c*n*l+t*u*l+o*n*h-t*a*h)*_,e[12]=x*_,e[13]=(c*p*r-f*u*r+f*n*d-t*p*d-c*n*m+t*u*m)*_,e[14]=(f*a*r-o*p*r-f*n*s+t*p*s+o*n*m-t*a*m)*_,e[15]=(o*u*r-c*a*r+c*n*s-t*u*s-o*n*d+t*a*d)*_,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,l=i*o,c=i*a;return this.set(l*o+n,l*a-r*s,l*s+r*a,0,l*a+r*s,c*a+n,c*s-r*o,0,l*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,l=i+i,c=o+o,u=a+a,d=i*l,h=i*c,f=i*u,p=o*c,m=o*u,g=a*u,v=s*l,y=s*c,b=s*u,x=n.x,w=n.y,_=n.z;return r[0]=(1-(p+g))*x,r[1]=(h+b)*x,r[2]=(f-y)*x,r[3]=0,r[4]=(h-b)*w,r[5]=(1-(d+g))*w,r[6]=(m+v)*w,r[7]=0,r[8]=(f+y)*_,r[9]=(m-v)*_,r[10]=(1-(d+p))*_,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=Tr.set(r[0],r[1],r[2]).length();const o=Tr.set(r[4],r[5],r[6]).length(),a=Tr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Cr.copy(this);const s=1/i,l=1/o,c=1/a;return Cr.elements[0]*=s,Cr.elements[1]*=s,Cr.elements[2]*=s,Cr.elements[4]*=l,Cr.elements[5]*=l,Cr.elements[6]*=l,Cr.elements[8]*=c,Cr.elements[9]*=c,Cr.elements[10]*=c,t.setFromRotationMatrix(Cr),n.x=i,n.y=o,n.z=a,this}makePerspective(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),d=-(o+i)/(o-i),h=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,o){const a=this.elements,s=1/(t-e),l=1/(n-r),c=1/(o-i),u=(t+e)*s,d=(n+r)*l,h=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Tr=new Jn,Cr=new Er,Ar=new Jn(0,0,0),kr=new Jn(1,1,1),Pr=new Jn,Rr=new Jn,Lr=new Jn;class Or{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Or.DefaultOrder;Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const r=Bn.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],h=i[6],f=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(h,f),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return zr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(zr,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return Dr.setFromEuler(this),this.setFromQuaternion(Dr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new Jn(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Or.DefaultOrder="XYZ",Or.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const zr=new Er,Dr=new Zn;class Nr{constructor(){this.mask=1}set(e){this.mask=1<1){for(let e=0;e1){for(let e=0;e0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=r,n;function o(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let n=0;n1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Jn),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Kr.getNormalMatrix(e),r=this.coplanarPoint(Jr).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}const ti=new Jn,ni=new Jn,ri=new Jn,ii=new Jn,oi=new Jn,ai=new Jn,si=new Jn,li=new Jn,ci=new Jn,ui=new Jn;class di{constructor(e,t,n){this.a=void 0!==e?e:new Jn,this.b=void 0!==t?t:new Jn,this.c=void 0!==n?n:new Jn}static getNormal(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Jn),r.subVectors(n,t),ti.subVectors(e,t),r.cross(ti);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){ti.subVectors(r,t),ni.subVectors(n,t),ri.subVectors(e,t);const o=ti.dot(ti),a=ti.dot(ni),s=ti.dot(ri),l=ni.dot(ni),c=ni.dot(ri),u=o*l-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Jn),0===u)return i.set(-2,-1,-1);const d=1/u,h=(l*s-a*c)*d,f=(o*c-a*s)*d;return i.set(1-h-f,f,h)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ii),ii.x>=0&&ii.y>=0&&ii.x+ii.y<=1}static getUV(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,ii),s.set(0,0),s.addScaledVector(i,ii.x),s.addScaledVector(o,ii.y),s.addScaledVector(a,ii.z),s}static isFrontFacing(e,t,n,r){return ti.subVectors(n,t),ni.subVectors(e,t),ti.cross(ni).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ti.subVectors(this.c,this.b),ni.subVectors(this.a,this.b),.5*ti.cross(ni).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Jn),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return di.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new ei),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return di.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return di.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return di.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return di.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Jn);const n=this.a,r=this.b,i=this.c;let o,a;oi.subVectors(r,n),ai.subVectors(i,n),li.subVectors(e,n);const s=oi.dot(li),l=ai.dot(li);if(s<=0&&l<=0)return t.copy(n);ci.subVectors(e,r);const c=oi.dot(ci),u=ai.dot(ci);if(c>=0&&u<=c)return t.copy(r);const d=s*u-c*l;if(d<=0&&s>=0&&c<=0)return o=s/(s-c),t.copy(n).addScaledVector(oi,o);ui.subVectors(e,i);const h=oi.dot(ui),f=ai.dot(ui);if(f>=0&&h<=f)return t.copy(i);const p=h*l-s*f;if(p<=0&&l>=0&&f<=0)return a=l/(l-f),t.copy(n).addScaledVector(ai,a);const m=c*f-h*u;if(m<=0&&u-c>=0&&h-f>=0)return si.subVectors(i,r),a=(u-c)/(u-c+(h-f)),t.copy(r).addScaledVector(si,a);const g=1/(m+p+d);return o=p*g,a=d*g,t.copy(n).addScaledVector(oi,o).addScaledVector(ai,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const hi={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},fi={h:0,s:0,l:0},pi={h:0,s:0,l:0};function mi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function gi(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vi(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class yi{constructor(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=Bn.euclideanModulo(e,1),t=Bn.clamp(t,0,1),n=Bn.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=mi(i,r,e+1/3),this.g=mi(i,r,e),this.b=mi(i,r,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){let e;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=hi[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=gi(e.r),this.g=gi(e.g),this.b=gi(e.b),this}copyLinearToSRGB(e){return this.r=vi(e.r),this.g=vi(e.g),this.b=vi(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),o=Math.min(t,n,r);let a,s;const l=(o+i)/2;if(o===i)a=0,s=0;else{const e=i-o;switch(s=l<=.5?e/(i+o):e/(2-i-o),i){case t:a=(n-r)/e+(n1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}yi.NAMES=hi,yi.prototype.r=1,yi.prototype.g=1,yi.prototype.b=1;class bi{constructor(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Jn,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new yi,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=o}clone(){return(new this.constructor).copy(this)}copy(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(let t=0,n=e.vertexNormals.length;t0&&(n.alphaTest=this.alphaTest),!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.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(wi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),_i.prototype=Object.create(wi.prototype),_i.prototype.constructor=_i,_i.prototype.isMeshBasicMaterial=!0,_i.prototype.copy=function(e){return wi.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};const Si=new Jn,Mi=new jn;function Ei(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=En,this.updateRange={offset:0,count:-1},this.version=0}function Ti(e,t,n){Ei.call(this,new Int8Array(e),t,n)}function Ci(e,t,n){Ei.call(this,new Uint8Array(e),t,n)}function Ai(e,t,n){Ei.call(this,new Uint8ClampedArray(e),t,n)}function ki(e,t,n){Ei.call(this,new Int16Array(e),t,n)}function Pi(e,t,n){Ei.call(this,new Uint16Array(e),t,n)}function Ri(e,t,n){Ei.call(this,new Int32Array(e),t,n)}function Li(e,t,n){Ei.call(this,new Uint32Array(e),t,n)}function Oi(e,t,n){Ei.call(this,new Uint16Array(e),t,n)}function zi(e,t,n){Ei.call(this,new Float32Array(e),t,n)}function Di(e,t,n){Ei.call(this,new Float64Array(e),t,n)}Object.defineProperty(Ei.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ei.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Ti.prototype=Object.create(Ei.prototype),Ti.prototype.constructor=Ti,Ci.prototype=Object.create(Ei.prototype),Ci.prototype.constructor=Ci,Ai.prototype=Object.create(Ei.prototype),Ai.prototype.constructor=Ai,ki.prototype=Object.create(Ei.prototype),ki.prototype.constructor=ki,Pi.prototype=Object.create(Ei.prototype),Pi.prototype.constructor=Pi,Ri.prototype=Object.create(Ei.prototype),Ri.prototype.constructor=Ri,Li.prototype=Object.create(Ei.prototype),Li.prototype.constructor=Li,Oi.prototype=Object.create(Ei.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isFloat16BufferAttribute=!0,zi.prototype=Object.create(Ei.prototype),zi.prototype.constructor=zi,Di.prototype=Object.create(Ei.prototype),Di.prototype.constructor=Di;class Ni{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(e){const t=[];let n,r,i;const o=e.faces;for(r=0;r0,o=r[1]&&r[1].length>0,a=e.morphTargets,s=a.length;let l;if(s>0){l=[];for(let e=0;e0){d=[];for(let e=0;e0&&0===t.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;gt&&(t=e[n]);return t}const Fi={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Bi(e,t){return new Fi[e](t)}let ji=1;const Ui=new Er,Hi=new Zr,Gi=new Jn,Vi=new er,Wi=new er,qi=new Jn;function Xi(){Object.defineProperty(this,"id",{value:ji+=2}),this.uuid=Bn.generateUUID(),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={}}Xi.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Xi,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){return Array.isArray(e)?this.index=new(Ii(e)>65535?Li:Pi)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Un).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Ui.makeRotationX(e),this.applyMatrix4(Ui),this},rotateY:function(e){return Ui.makeRotationY(e),this.applyMatrix4(Ui),this},rotateZ:function(e){return Ui.makeRotationZ(e),this.applyMatrix4(Ui),this},translate:function(e,t,n){return Ui.makeTranslation(e,t,n),this.applyMatrix4(Ui),this},scale:function(e,t,n){return Ui.makeScale(e,t,n),this.applyMatrix4(Ui),this},lookAt:function(e){return Hi.lookAt(e),Hi.updateMatrix(),this.applyMatrix4(Hi.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gi).negate(),this.translate(Gi.x,Gi.y,Gi.z),this},setFromObject:function(e){const t=e.geometry;if(e.isPoints||e.isLine){const e=new zi(3*t.vertices.length,3),n=new zi(3*t.colors.length,3);if(this.setAttribute("position",e.copyVector3sArray(t.vertices)),this.setAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){const e=new zi(t.lineDistances.length,1);this.setAttribute("lineDistance",e.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){const t=[];for(let n=0,r=e.length;n0){const t=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Ei(t,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const t=new Float32Array(3*e.colors.length);this.setAttribute("color",new Ei(t,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const t=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Ei(t,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const t=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Ei(t,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(const n in e.morphTargets){const t=[],r=e.morphTargets[n];for(let e=0,n=r.length;e0){const t=new zi(4*e.skinIndices.length,4);this.setAttribute("skinIndex",t.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const t=new zi(4*e.skinWeights.length,4);this.setAttribute("skinWeight",t.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new er);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Jn(-1/0,-1/0,-1/0),new Jn(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const s in n){const t=n[s],r=t.toJSON(e.data);""!==t.name&&(r.name=t.name),e.data.attributes[s]=r}const r={};let i=!1;for(const s in this.morphAttributes){const t=this.morphAttributes[s],n=[];for(let r=0,i=t.length;r0&&(r[s]=n,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e},clone:function(){return(new Xi).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const l in r){const e=r[l];this.setAttribute(l,e.clone(t))}const i=e.morphAttributes;for(const l in i){const e=[],n=i[l];for(let r=0,i=n.length;r0&&void 0!==arguments[0]?arguments[0]:new Xi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _i;Zr.call(this),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}function fo(e,t,n,r,i,o,a,s){let l;if(l=t.side===m?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,t.side!==g,s),null===l)return null;uo.copy(s),uo.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(uo);return cn.far?null:{distance:c,point:uo.clone(),object:e}}function po(e,t,n,r,i,o,a,s,l,c,u,d){Ji.fromBufferAttribute(i,c),Qi.fromBufferAttribute(i,u),Ki.fromBufferAttribute(i,d);const h=e.morphTargetInfluences;if(t.morphTargets&&o&&h){ro.set(0,0,0),io.set(0,0,0),oo.set(0,0,0);for(let e=0,t=o.length;e0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Zi.copy(n.boundingSphere),Zi.applyMatrix4(i),!1===e.ray.intersectsSphere(Zi))return;if(Yi.copy(i).invert(),$i.copy(e.ray).applyMatrix4(Yi),null!==n.boundingBox&&!1===$i.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,d=n.groups,h=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,f=d.length;n0&&(l=c);for(let n=0,u=s.length;n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const s=[],l=[],c=[],u=[];let d=0,h=0;function f(e,t,n,r,i,o,f,p,m,g,v){const y=o/m,b=f/g,x=o/2,w=f/2,_=p/2,S=m+1,M=g+1;let E=0,T=0;const C=new Jn;for(let a=0;a0?1:-1,c.push(C.x,C.y,C.z),u.push(s/m),u.push(1-a/g),E+=1}}for(let a=0;a0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;xo.call(this),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function _o(e,t,n){if(Zr.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new wo(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Jn(1,0,0)),this.add(r);const i=new wo(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Jn(-1,0,0)),this.add(i);const o=new wo(90,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Jn(0,1,0)),this.add(o);const a=new wo(90,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Jn(0,-1,0)),this.add(a);const s=new wo(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Jn(0,0,1)),this.add(s);const l=new wo(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Jn(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();const c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c}}function So(e,t,n,r,i,o,a,s,l,c){e=void 0!==e?e:[],t=void 0!==t?t:oe,a=void 0!==a?a:Ie,Wn.call(this,e,t,n,r,i,o,a,s,l,c),this.flipY=!1,this._needsFlipEnvMap=!0}function Mo(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),Yn.call(this,e,e,t),t=t||{},this.texture=new So(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}function Eo(e,t,n,r,i,o,a,s,l,c,u,d){Wn.call(this,null,o,a,s,l,c,r,i,u,d),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:pe,this.minFilter=void 0!==c?c:pe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}bo.prototype=Object.create(wi.prototype),bo.prototype.constructor=bo,bo.prototype.isShaderMaterial=!0,bo.prototype.copy=function(e){return wi.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=go(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this},bo.prototype.toJSON=function(e){const t=wi.prototype.toJSON.call(this,e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const r in this.extensions)!0===this.extensions[r]&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t},xo.prototype=Object.assign(Object.create(Zr.prototype),{constructor:xo,isCamera:!0,copy:function(e,t){return Zr.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Jn),this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Zr.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){Zr.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),wo.prototype=Object.assign(Object.create(xo.prototype),{constructor:wo,isPerspectiveCamera:!0,copy:function(e,t){return xo.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Bn.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){const e=Math.tan(.5*Bn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Bn.RAD2DEG*Math.atan(Math.tan(.5*Bn.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=this.near;let t=e*Math.tan(.5*Bn.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,a=o.fullHeight;i+=o.offsetX*r/e,t-=o.offsetY*n/a,r*=o.width/e,n*=o.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){const t=Zr.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),_o.prototype=Object.create(Zr.prototype),_o.prototype.constructor=_o,So.prototype=Object.create(Wn.prototype),So.prototype.constructor=So,So.prototype.isCubeTexture=!0,Object.defineProperty(So.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Mo.prototype=Object.create(Yn.prototype),Mo.prototype.constructor=Mo,Mo.prototype.isWebGLCubeRenderTarget=!0,Mo.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=Fe,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={tEquirect:{value:null}},r="\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include \n\t\t\t\t#include \n\n\t\t\t}\n\t\t",i="\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t",o=new mo(5,5,5),a=new bo({name:"CubemapFromEquirect",uniforms:go(n),vertexShader:r,fragmentShader:i,side:m,blending:b});a.uniforms.tEquirect.value=t;const s=new ho(o,a),l=t.minFilter;return t.minFilter===_e&&(t.minFilter=be),new _o(1,10,this).update(e,s),t.minFilter=l,s.geometry.dispose(),s.material.dispose(),this},Mo.prototype.clear=function(e,t,n,r){const i=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(i)},Eo.prototype=Object.create(Wn.prototype),Eo.prototype.constructor=Eo,Eo.prototype.isDataTexture=!0;const To=new gr,Co=new Jn;class Ao{constructor(e,t,n,r,i,o){this.planes=[void 0!==e?e:new ei,void 0!==t?t:new ei,void 0!==n?n:new ei,void 0!==r?r:new ei,void 0!==i?i:new ei,void 0!==o?o:new ei]}set(e,t,n,r,i,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}clone(){return(new this.constructor).copy(this)}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],d=n[8],h=n[9],f=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(a-r,u-s,p-d,y-m).normalize(),t[1].setComponents(a+r,u+s,p+d,y+m).normalize(),t[2].setComponents(a+i,u+l,p+h,y+g).normalize(),t[3].setComponents(a-i,u-l,p-h,y-g).normalize(),t[4].setComponents(a-o,u-c,p-f,y-v).normalize(),t[5].setComponents(a+o,u+c,p+f,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),To.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSprite(e){return To.center.set(0,0,0),To.radius=.7071067811865476,To.applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let i=0;i<6;i++)if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,Co.y=r.normal.y>0?e.max.y:e.min.y,Co.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Co)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}function ko(){let e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Po(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,o=t/2,a=Math.floor(n),s=Math.floor(r),l=a+1,c=s+1,u=e/a,d=t/s,h=[],f=[],p=[],m=[];for(let g=0;g 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_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_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( 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 ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#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",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\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 max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\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 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}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\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 linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.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}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.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\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\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\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + 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 ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_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",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\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}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, 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#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"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 GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\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 getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.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 getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.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 getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.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 GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_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_Diffuse_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)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, 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_Diffuse_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)",lights_physical_fragment:"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.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\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_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\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.specularRoughness;\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#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_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_Diffuse_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 CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\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\tgetPointDirectLightIrradiance( 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\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\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\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, vSpotShadowCoord[ 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\tgetDirectionalDirectLightIrradiance( 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 );\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 );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#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",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#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",logdepthbuf_vertex:"#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",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#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",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#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 * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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 * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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;",normal_fragment_maps:"#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 * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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 );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#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 ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#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 );\n\t#endif\n#endif",clearcoat_pars_fragment:"#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",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#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\tvarying vec4 vSpotShadowCoord[ 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",shadowmap_pars_vertex:"#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\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ 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 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",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 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_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ 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",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.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, vSpotShadowCoord[ 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}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn 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; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#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",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\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",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include